chore: bump version to 0.3.1 #5
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*.*.*" | |
| workflow_dispatch: | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| build-release: | |
| needs: create-release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| build: | |
| - linux musl x64 | |
| - linux musl aarch64 | |
| - macos x64 | |
| - macos aarch64 | |
| include: | |
| - build: linux musl x64 | |
| os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - build: linux musl aarch64 | |
| os: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| - build: macos x64 | |
| os: macos-latest | |
| target: x86_64-apple-darwin | |
| - build: macos aarch64 | |
| os: macos-latest | |
| target: aarch64-apple-darwin | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies (Linux only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get install -y --no-install-recommends musl-tools | |
| - name: Install Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| - name: Build release binary | |
| run: cargo build --release --target=${{ matrix.target }} | |
| - name: Strip binary (Linux only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: strip target/${{ matrix.target }}/release/fswatcher | |
| - name: Create checksum | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| sha256sum fswatcher > fswatcher-${{ matrix.target }}.sha256sum | |
| - name: Tar release | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar -czvf fswatcher-${{ matrix.target }}.tar.gz fswatcher | |
| - name: Upload release artifact | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: target/${{ matrix.target }}/release/fswatcher-${{ matrix.target }}.tar.gz | |
| asset_name: fswatcher-${{ matrix.target }}.tar.gz | |
| asset_content_type: application/octet-stream | |
| - name: Upload checksum | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ needs.create-release.outputs.upload_url }} | |
| asset_path: target/${{ matrix.target }}/release/fswatcher-${{ matrix.target }}.sha256sum | |
| asset_name: fswatcher-${{ matrix.target }}.sha256sum | |
| asset_content_type: text/plain |