Skip to content

Commit 37d2d7c

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 0c5528a commit 37d2d7c

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
steps:
20+
- name: Download artefact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: installer-build
24+
path: releases/.
25+
26+
- name: Push to Bunny
27+
env:
28+
PKG_URL: "https://storage.bunnycdn.com/asahilinux/${{ inputs.upload-type }}"
29+
PKG_VER: "installer-${{ needs.build.outputs.installer_ver }}"
30+
run: |
31+
if [ ! -e "releases/${PKG_VER}" ]; then
32+
echo "Package not found!"
33+
exit 1
34+
fi
35+
36+
upload() {
37+
curl -# --fail --request PUT \
38+
--url "${2}" \
39+
-H "AccessKey: ${{ secrets.BUNNY_TOKEN }}" \
40+
-H "Content-Type: ${3}" \
41+
-H "Accept: application/json" \
42+
--data-binary @${1}
43+
}
44+
45+
upload "releases/${PKG_VER}" "${PKG_URL}/${PKG_VER}" "application/octet-stream"
46+
upload "releases/latest" "${PKG_URL}/latest" "text/plain"

0 commit comments

Comments
 (0)