Skip to content

Commit eddee1a

Browse files
committed
workflows: release-prod: add prod release workflow
This workflow runs on every tagged release and uploads the build to the CDN as the latest production version Signed-off-by: James Calligeros <[email protected]>
1 parent 3e55e89 commit eddee1a

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: release-prod
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build.yaml
12+
13+
upload-prod-artefact:
14+
needs: build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Download artefact
18+
uses: actions/download-artifact@v4
19+
with:
20+
name: installer-build
21+
path: releases/.
22+
23+
- name: Set up env
24+
run: |
25+
echo "BURL=https://storage.bunnycdn.com/asahilinux/installer" >> $GITHUB_ENV
26+
echo "RELEASE_PKG=releases/installer-$(cat releases/latest).tar.gz" >> $GITHUB_ENV
27+
28+
- name: Push to Bunny
29+
run: |
30+
if [ ! -e "${RELEASE_PKG}" ]; then
31+
echo "Package not found!"
32+
exit 1
33+
fi
34+
35+
upload() {
36+
curl -# --fail --request PUT \
37+
--url "${2}" \
38+
-H "AccessKey: ${{ secrets.BUNNY_TOKEN }}" \
39+
-H "Content-Type: ${3}" \
40+
-H "Accept: application/json" \
41+
--data-binary @${1}
42+
}
43+
44+
upload "${RELEASE_PKG}" "${BURL}${RELEASE_PKG/releases/}" "application/octet-stream"
45+
upload "releases/latest" "${BURL}/latest" "text/plain"

0 commit comments

Comments
 (0)