From 9c377bf4d36e1691633baee32b7f56f8c7a0c641 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Fri, 14 Jun 2024 06:43:53 +0000 Subject: [PATCH] ci: add release workflow --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c0e92cd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: release +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: fluentci-io/setup-fluentci@v5 + with: + wasm: true + plugin: rust + args: | + target_add wasm32-unknown-unknown + build --target wasm32-unknown-unknown --release + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Generate checksum + run: | + sha256sum target/wasm32-unknown-unknown/release/sqlfluff.wasm > target/wasm32-unknown-unknown/release/sqlfluff.wasm.sha256 + - name: Upload release assets + run: | + for ext in wasm wasm.sha256; do + export FILE=target/wasm32-unknown-unknown/release/sqlfluff.$ext + fluentci run --wasm github release_upload $TAG $FILE + done + env: + TAG: ${{ env.RELEASE_VERSION }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}