Skip to content

Commit 4d22f6b

Browse files
committed
workflows: add main release workflow
This reusable workflow builds the installer then uploads the artefact to the correct endpoint. It is designed to be wrapped and called by workflows with the correct triggers and endpoint specified as an input. Signed-off-by: James Calligeros <[email protected]>
1 parent 7303b5d commit 4d22f6b

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/release.yaml

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

0 commit comments

Comments
 (0)