Skip to content

Commit 02b47d6

Browse files
committed
workflows: release-test: add test workflow
Signed-off-by: James Calligeros <[email protected]>
1 parent e45f211 commit 02b47d6

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches: [ main ]
66
workflow_dispatch:
7+
workflow_call:
78

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

0 commit comments

Comments
 (0)