1010 package :
1111 strategy :
1212 matrix :
13- platform : [ubuntu-latest]
13+ platform : [macos-latest, ubuntu-latest]
1414 runs-on : ${{ matrix.platform }}
15+ outputs :
16+ version : ${{ steps.version.outputs.version }}
17+ revision : ${{ steps.version.outputs.revision }}
1518 steps :
1619 - uses : actions/checkout@v3
1720 with :
2932 run : go install github.com/wailsapp/wails/v2/cmd/wails@latest
3033
3134 - name : Inject Version Info
35+ id : version
3236 run : |
3337 VERSION=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1) | tr -d v)
3438 [ "$VERSION" != "" ] || VERSION=0.0.0
4448 echo "VERSION_LDFLAGS=${VERSION_LDFLAGS}" >> $GITHUB_ENV
4549 echo "VERSION=${VERSION}" >> $GITHUB_ENV
4650 echo "REVISION=${REVISION}" >> $GITHUB_ENV
51+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
52+ echo "revision=${REVISION}" >> $GITHUB_OUTPUT
4753
4854 - name : Build macOS
4955 if : runner.os == 'macOS' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
6874
6975 # This one sucked to figure out, and it's slow, but it works!
7076 - name : Build Linux ARM
71- if : runner.os == 'Linux'
72- # && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
77+ if : runner.os == 'Linux' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
7378 uses : pguyot/arm-runner-action@v2
7479 with :
7580 base_image : https://cdimage.ubuntu.com/releases/22.10/release/ubuntu-22.10-preinstalled-desktop-arm64+raspi.img.xz
@@ -86,19 +91,17 @@ jobs:
8691 go build -o build/bin/toolbarr.arm64 -ldflags='${{ env.VERSION_LDFLAGS }}' .
8792
8893 - name : Build Windows
89- if : runner.os == 'Windows '
94+ if : runner.os == 'Linux '
9095 env :
9196 EXE_SIGNING_KEY : ${{ secrets.EXE_SIGNING_KEY }}
9297 EXE_SIGNING_KEY_PASSWORD : ${{ secrets.EXE_SIGNING_KEY_PASSWORD }}
9398 run : |
9499 wails build -s -m -trimpath -platform windows/amd64 -nsis -webview2 embed -o Toolbarr.amd64.exe -ldflags='${{ env.VERSION_LDFLAGS }}'
95100 wails build -s -m -trimpath -platform windows/arm64 -nsis -webview2 embed -o Toolbarr.arm64.exe -ldflags='${{ env.VERSION_LDFLAGS }}'
96- build/windows/signexe.sh
97- for FILE in build/bin/*.exe; do zip -9D "${FILE%.*}.zip" "${FILE}"; done
101+ for FILE in build/bin/*.a??64.exe; do zip -9j "${FILE%.*}.zip" "${FILE}"; done
98102
99103 - name : Package Linux Binaries
100- if : runner.os == 'Linux'
101- # && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
104+ if : runner.os == 'Linux' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable')
102105 env :
103106 KEYID : B93DD66EF98E54E2EAE025BA0166AD34ABC5A57C
104107 GPG_SIGNING_KEY : ${{ secrets.GPG_SIGNING_KEY }}
@@ -137,14 +140,32 @@ jobs:
137140 name : toolbarr-${{ matrix.platform }}
138141 path : build/bin/*
139142
143+ deploy-unstable-packagecloud :
144+ # description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
145+ if : github.ref == 'refs/heads/unstable'
146+ needs : package
147+ name : Deploy Unstable PackageCloud
148+ runs-on : ubuntu-latest
149+ steps :
150+ - name : Download release files
151+ uses : actions/download-artifact@v3
152+ with :
153+ name : toolbarr-ubuntu-latest
154+ - uses : golift/upload-packagecloud@v1
155+ with :
156+ userrepo : golift/unstable
157+ apitoken : ${{ secrets.PACKAGECLOUD_TOKEN }}
158+ packages : .
159+ rpmdists : el/6
160+ debdists : ubuntu/focal
161+
140162 deploy-unstable-unstable :
141163 # description: "Uploads pre-built binaries to unstable.golift.io."
142164 if : startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable'
143165 strategy :
144166 matrix :
145167 files : [toolbarr-macos-latest, toolbarr-ubuntu-latest]
146- needs :
147- - package
168+ needs : package
148169 name : Deploy Unstable
149170 runs-on : ubuntu-latest
150171 steps :
@@ -154,8 +175,57 @@ jobs:
154175 name : ${{ matrix.files }}
155176 - name : Upload files to unstable.golift.io
156177 run : >-
157- for file in *.{zip,dmg,gz}; do
178+ for file in *.{zip,dmg,gz,installer.exe }; do
158179 [ -f "$file" ] || continue;
159180 echo "Uploading: ${file}";
160181 curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=toolbarr" -F "file=@${file}";
161- done
182+ echo '{"version":"${{needs.package.outputs.version}}","revision":${{needs.package.outputs.revision}},"size":'$(stat --printf="%s" ${file})'}' >> ${file}.txt
183+ curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=toolbarr" -F "file=@${file}.txt";
184+ done
185+
186+ deploy-release-packagecloud :
187+ # description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
188+ if : startsWith(github.ref, 'refs/tags/v')
189+ needs : package
190+ name : Deploy Release PackageCloud
191+ runs-on : ubuntu-latest
192+ steps :
193+ - name : Download release files
194+ uses : actions/download-artifact@v3
195+ with :
196+ name : toolbarr-ubuntu-latest
197+ - uses : golift/upload-packagecloud@v1
198+ with :
199+ userrepo : golift/pkgs
200+ apitoken : ${{ secrets.PACKAGECLOUD_TOKEN }}
201+ packages : .
202+ rpmdists : el/6
203+ debdists : ubuntu/focal
204+
205+ deploy-github-release :
206+ # description: uploads all the built release assets to the GitHub Release.
207+ if : startsWith(github.ref, 'refs/tags/v')
208+ permissions :
209+ contents : write
210+ needs : package
211+ strategy :
212+ matrix :
213+ files : [toolbarr-macos-latest, toolbarr-ubuntu-latest]
214+ name : Deploy GitHub Release
215+ runs-on : ubuntu-latest
216+ steps :
217+ - name : Download ${{ matrix.files }} Files
218+ uses : actions/download-artifact@v3
219+ with :
220+ name : ${{ matrix.files }}
221+ - name : Publish ${{ matrix.files }} artifacts to github
222+ uses : softprops/action-gh-release@v1
223+ with :
224+ files : |
225+ *.rpm
226+ *.deb
227+ *.zip
228+ *.dmg
229+ *.gz
230+ *.txt
231+ *.installer.exe
0 commit comments