fix: pinning wasmtime version #14
This file contains hidden or 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: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux x86_64 | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact_name: componentize-go | |
| asset_name: componentize-go-linux-amd64 | |
| # Linux aarch64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| artifact_name: componentize-go | |
| asset_name: componentize-go-linux-arm64 | |
| # macOS x86_64 | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| artifact_name: componentize-go | |
| asset_name: componentize-go-darwin-amd64 | |
| # macOS aarch64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| artifact_name: componentize-go | |
| asset_name: componentize-go-darwin-arm64 | |
| # Windows x86_64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| artifact_name: componentize-go.exe | |
| asset_name: componentize-go-windows-amd64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Rust | |
| run: | | |
| rustup update stable --no-self-update | |
| rustup default stable | |
| rustup target add ${{ matrix.target }} | |
| - name: Install cross-compilation tools (Linux aarch64) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| - name: Strip binary (Linux and macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then | |
| aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| else | |
| strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| fi | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: artifacts | |
| - name: Flatten, rename, and compress artifacts | |
| run: | | |
| mkdir -p release | |
| for dir in artifacts/*/; do | |
| asset_name=$(basename "$dir") | |
| binary=$(ls "$dir") | |
| if [[ "$asset_name" == *windows* ]]; then | |
| cd "$dir" | |
| zip -9 "../../release/${asset_name}.zip" "$binary" | |
| cd ../.. | |
| else | |
| cd "$dir" | |
| tar -czvf "../../release/${asset_name}.tar.gz" "$binary" | |
| cd ../.. | |
| fi | |
| done | |
| - name: Generate checksums | |
| run: | | |
| cd release | |
| sha256sum * > checksums.txt | |
| - name: Create Release (tagged) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: gh release create --generate-notes ${{ github.ref_name }} release/* | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Create/Update Canary Release | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| # Delete existing canary release if it exists | |
| gh release delete canary --yes || true | |
| # Delete existing canary tag if it exists | |
| git push origin :refs/tags/canary || true | |
| # Create new canary release | |
| gh release create canary \ | |
| --title "Canary Release" \ | |
| --notes "**This is an unstable canary release built from the latest \`main\` branch.** | |
| Commit: ${{ github.sha }} | |
| Built: $(date -u +'%Y-%m-%d %H:%M:%S UTC') | |
| This release is automatically updated on every push to \`main\`. Use tagged releases for stable versions." \ | |
| --prerelease \ | |
| release/* | |
| env: | |
| GH_TOKEN: ${{ github.token }} |