Release 0.2.1 #2
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 | |
| env: | |
| CARGO_TERM_COLOR: always | |
| BINARY_NAME: json-diff | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: macos-13 | |
| target: x86_64-apple-darwin | |
| - os: macos-14 | |
| target: aarch64-apple-darwin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build Binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Archive Binary | |
| shell: bash | |
| run: | | |
| mkdir -p dist | |
| # Copy to dist, renaming to simple binary name | |
| cp target/${{ matrix.target }}/release/${{ env.BINARY_NAME }} dist/ | |
| # Create tarball | |
| cd dist | |
| tar -czf ../${{ env.BINARY_NAME }}-${{ matrix.target }}.tar.gz ${{ env.BINARY_NAME }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.BINARY_NAME }}-${{ matrix.target }} | |
| path: ${{ env.BINARY_NAME }}-${{ matrix.target }}.tar.gz | |
| create_release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Display Artifacts | |
| run: ls -R artifacts | |
| - name: Generate SHA256 Checksums | |
| run: | | |
| cd artifacts | |
| for file in *.tar.gz; do | |
| shasum -a 256 "$file" > "$file.sha256" | |
| done | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| artifacts/*.tar.gz | |
| artifacts/*.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |