Fix GitHub Action paths #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: Build & Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" # Only trigger on version tags like v1.0.0 | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact: redis-file-monitor-linux.tar.gz | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact: redis-file-monitor-macos.tar.gz | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact: redis-file-monitor-windows.zip | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build Release Binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package Binary (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: tar -czvf ${{ matrix.artifact }} -C target/${{ matrix.target }}/release redis-file-monitor | |
| - name: Package Binary (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: Compress-Archive -Path target/${{ matrix.target }}/release/redis-file-monitor.exe -DestinationPath ${{ matrix.artifact }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }} | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| target/release/redis-file-monitor-linux.tar.gz | |
| target/release/redis-file-monitor-macos.tar.gz | |
| target/release/redis-file-monitor-windows.zip | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| draft: false | |
| prerelease: false |