perf: update github action workflows

This commit is contained in:
tiny-craft 2023-08-19 19:11:46 +08:00
parent 2f5d1e1d51
commit 2151f9b1b4
4 changed files with 26 additions and 16 deletions

View File

@ -90,13 +90,13 @@ jobs:
cd build/linux
mv tiny-rdm_0.0.0_amd64 "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
sed -i 's/0.0.0/${{ steps.normalise_version.outputs.version }}/g' "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64/DEBIAN/control"
dpkg-deb --build -zXZ "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
dpkg-deb --build -Zxz "tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64"
- name: Upload release asset
shell: bash
working-directory: ./build/linux/
run: |
filepath="tiny-rdm_${{ steps.normalise_version.outputs.version }}_amd64.deb"
filename="tiny-rdm_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.deb"
upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary @$filepath "$upload_url?name=$filename"
working-directory: ./build/linux/

View File

@ -77,24 +77,33 @@ jobs:
- name: Compress macOS app
shell: bash
working-directory: ./build/bin
run: |
cd build/bin
mv tinyrdm.app "Tiny RDM.app"
zip -r TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip "Tiny RDM.app"
- name: Get latest release from API
id: get_upload_url
shell: bash
run: |
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" > /tmp/releases.json
url=$(jq -r '.[0].upload_url' /tmp/releases.json)
echo "url=${url/%{?name,label}/}" >> "$GITHUB_OUTPUT"
- name: Upload release asset
- name: Upload release asset (ZIP Package)
shell: bash
working-directory: ./build/bin/
run: |
filepath="TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip"
filename="TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip"
upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/zip" --data-binary @$filepath "$upload_url?name=$filename"
- name: Build macOS DMG
shell: bash
working-directory: ./build/bin
run: |
rm TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip
ln -s /Applications Applications
hdiutil create -volname "Tiny RDM" -srcfolder . -ov -format UDBZ TinyRDM-${{ steps.normalise_platform.outputs.tag }}.dmg
- name: Upload release asset (DMG Package)
shell: bash
working-directory: ./build/bin/
run: |
filepath="TinyRDM-${{ steps.normalise_platform.outputs.tag }}.dmg"
filename="TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.dmg"
upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/x-apple-diskimage" --data-binary @$filepath "$upload_url?name=$filename"

View File

@ -62,23 +62,24 @@ jobs:
run: CGO_ENABLED=1 wails build -clean -platform ${{ matrix.platform }} -ldflags "-X main.version=${{ github.event.release.tag_name }}"
- name: Compress portable binary
run: Compress-Archive "Tiny RDM.exe" tiny-rdm.zip
working-directory: ./build/bin
run: Compress-Archive "Tiny RDM.exe" tiny-rdm.zip
- name: Upload release asset (Portable)
shell: bash
working-directory: ./build/bin
run: |
filepath="tiny-rdm.zip"
filename="TinyRDM_Portable_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip"
upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/zip" --data-binary @$filepath "$upload_url?name=$filename"
working-directory: ./build/bin
- name: Build Windows NSIS installer
shell: bash
run: CGO_ENABLED=1 wails build -clean -platform ${{ matrix.platform }} -nsis -ldflags "-X main.version=${{ github.event.release.tag_name }}"
- name: Codesign Windows NSIS installer
working-directory: ./build/bin
run: |
echo "Creating certificate file"
New-Item -ItemType directory -Path certificate
@ -86,13 +87,12 @@ jobs:
certutil -decode certificate\certificate.txt certificate\certificate.pfx
echo "Signing TinyRDM installer"
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ secrets.WIN_SIGNING_CERT_PASSWORD }}' TinyRDM-amd64-installer.exe
working-directory: ./build/bin
- name: Upload release asset (Installer)
shell: bash
working-directory: ./build/bin/
run: |
filepath="TinyRDM-amd64-installer.exe"
filename="TinyRDM_Setup_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.exe"
upload_url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets"
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Content-Type: application/octet-stream" --data-binary @$filepath "$upload_url?name=$filename"
working-directory: ./build/bin/

View File

@ -1,6 +1,7 @@
Package: {{.Name}}
Version: {{.Info.ProductVersion}}
Section: base
Depends: libc6 (>= 2.34), libc6 (>= 2.32)
Priority: optional
Architecture: amd64
Maintainer: {{.Author.Name}} <{{.Author.Email}}>