-
-
Notifications
You must be signed in to change notification settings - Fork 118
48 lines (41 loc) · 1.3 KB
/
release.yaml
File metadata and controls
48 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: release
on:
workflow_call:
inputs:
upload-type:
required: true
type: string
workflow_dispatch:
jobs:
build:
uses: ./.github/workflows/build.yaml
upload-artefact:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artefact
uses: actions/download-artifact@v4
with:
name: installer-build
path: releases/.
- name: Push to Bunny
env:
PKG_URL: "https://storage.bunnycdn.com/asahilinux/${{ inputs.upload-type }}"
PKG_VER: "installer-${{ needs.build.outputs.installer_ver }}"
ACCESS_KEY: ${{ secrets.BUNNY_TOKEN }}
run: |
if [ ! -e "releases/${PKG_VER}" ]; then
echo "Package not found!"
exit 1
fi
upload() {
curl -# --fail --request PUT \
--url "${2}" \
--variable %ACCESS_KEY \
--expand-header 'AccessKey: {{ACCESS_KEY}}' \
-H "Content-Type: ${3}" \
-H "Accept: application/json" \
--data-binary @${1}
}
upload "releases/${PKG_VER}" "${PKG_URL}/${PKG_VER}" "application/octet-stream"
upload "releases/latest" "${PKG_URL}/latest" "text/plain"