Merge tag '0.5.0' into develop #1
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 & Publish Rust Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # triggers on tags like v0.4.1 | |
| jobs: | |
| build-and-release: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache Cargo registry & Git data | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install Rust stable | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Build (release) | |
| run: cargo build --locked --release | |
| - name: Package binary | |
| run: | | |
| mkdir -p dist | |
| case "${{ matrix.os }}" in | |
| ubuntu-latest) | |
| tar -czvf dist/myapp-linux-v${{ github.ref_name }}.tar.gz -C target/release myapp | |
| ;; | |
| macos-latest) | |
| tar -czvf dist/myapp-macos-v${{ github.ref_name }}.tar.gz -C target/release myapp | |
| ;; | |
| windows-latest) | |
| zip -j dist/myapp-windows-v${{ github.ref_name }}.zip target/release/myapp.exe | |
| ;; | |
| esac | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |