-
-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (50 loc) · 2 KB
/
release.yml
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
49
50
51
name: release
on:
release:
types: [created]
jobs:
build:
name: release
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v3
- name: Setup Fluent CI
uses: fluentci-io/setup-fluentci@v5
with:
wasm: true
plugin: deno
args: |
compile -A --output fluentci --target ${{ matrix.target }} main.ts
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Archive assets
run: |
tar czvf fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz fluentci
shasum -a 256 fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256
- name: Upload assets to Cloudflare R2
run: |
mkdir -p r2/fluentci/${{ env.RELEASE_VERSION }}
cp fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz r2/fluentci/${{ env.RELEASE_VERSION }}
cp fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 r2/fluentci/${{ env.RELEASE_VERSION }}
cd r2 && fluentci run --wasm r2-sync upload --endpoint-url https://$ACCOUNT_ID.r2.cloudflarestorage.com s3://assets
env:
TAG: ${{ env.RELEASE_VERSION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
ACCOUNT_ID: fe5b1e2ce9f94f4c0415ab94ce402012
- name: Upload release assets
run: |
for ext in tar.gz tar.gz.sha256; do
export FILE=fluentci_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext
fluentci run --wasm github release_upload $TAG $FILE
done
env:
TAG: ${{ env.RELEASE_VERSION }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}