--- name: Release on: push: tags: - "v*.*.*" workflow_dispatch: permissions: contents: write jobs: build-release: name: build-release runs-on: ubuntu-latest env: RUST_BACKTRACE: 1 steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4 with: fetch-tags: false # https://github.com/actions/checkout/issues/1467 - name: Install WASI SDK run: | wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz tar -xzf wasi-sdk-20.0-linux.tar.gz mv wasi-sdk-20.0 /opt/wasi-sdk env: WASI_SDK_PATH: /opt/wasi-sdk - run: git fetch --tags --all --force && git pull origin ${{ github.ref }} --unshallow --force name: Fetch tags manually as a workaround. See https://github.com/actions/checkout/issues/1467 - name: Install Rust uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 # stable with: profile: minimal override: true toolchain: "1.95.0" target: wasm32-wasip1 env: WASI_SDK_PATH: /opt/wasi-sdk - name: Build release binary run: cargo build --release - name: Generate a changelog uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v3 id: git-cliff with: config: cliff.toml args: -vv --latest --strip header env: OUTPUT: CHANGES.md - name: Create release uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: draft: true body: ${{ steps.git-cliff.outputs.content }} prerelease: false files: | ./target/wasm32-wasip1/release/zjstatus.wasm ./target/wasm32-wasip1/release/zjframes.wasm