Merge pull request #31 from hatoo/bevy016 #97
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: Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "*.*.*" | |
| pull_request: | |
| jobs: | |
| publish: | |
| name: Publish for ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| artifact_name: tempo-trainer.exe | |
| release_name: tempo-trainer-windows-amd64 | |
| target: x86_64-pc-windows-msvc | |
| use_cross: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: archive | |
| run: | | |
| mkdir tempo-trainer | |
| cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} tempo-trainer/ | |
| cp -r assets tempo-trainer/ | |
| 7z a tempo-trainer.zip tempo-trainer | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.release_name }} | |
| path: tempo-trainer | |
| - name: Upload binaries to release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: tempo-trainer.zip | |
| asset_name: ${{ matrix.release_name }}.zip | |
| tag: ${{ github.ref }} |