Bump version #3
Workflow file for this run
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: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| # STEP 1: Create the release shell and generate notes once | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| # STEP 2: Build and upload for each platform | |
| publish: | |
| name: Build and Release | |
| needs: create-release # Wait for the release to be created | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - build: linux | |
| os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| archive_name: linux-x86_64.tar.gz | |
| - build: macos-intel | |
| os: macos-latest | |
| target: x86_64-apple-darwin | |
| archive_name: macos-x86_64.tar.gz | |
| - build: macos-arm | |
| os: macos-latest | |
| target: aarch64-apple-darwin | |
| archive_name: macos-arm64.tar.gz | |
| - build: windows | |
| os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| archive_name: windows-x86_64.zip | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build Binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Prepare Staging Area | |
| shell: bash | |
| run: | | |
| mkdir -p staging/bin | |
| mkdir -p staging/std | |
| BINARY_NAME="${{ github.event.repository.name }}" | |
| [ "${{ matrix.os }}" = "windows-latest" ] && EXT=".exe" || EXT="" | |
| # Copy binary into bin/ | |
| cp "target/${{ matrix.target }}/release/$BINARY_NAME$EXT" staging/bin/ | |
| # Copy stdlib | |
| cp -r std/* staging/std/ | |
| # Copy root files | |
| cp README.md LICENSE staging/ | |
| - name: Create Archive (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| cd staging | |
| tar -czf "../${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.archive_name }}" * | |
| - name: Create Archive (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| cd staging | |
| Compress-Archive -Path * -DestinationPath "../${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.archive_name }}" | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.archive_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |