v0.16.1 #84
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: release | |
runs-on: macos-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 | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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 | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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 }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |