test #18
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: | |
| - '*' | |
| jobs: | |
| #ci: | |
| # name: Run CI | |
| # uses: ./.github/workflows/ci-reusable.yml | |
| release: | |
| #needs: ci | |
| runs-on: ${{ matrix.runs-on }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runs-on: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| - runs-on: windows-latest | |
| target: i686-pc-windows-msvc | |
| - runs-on: windows-latest | |
| target: aarch64-pc-windows-msvc | |
| - runs-on: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - runs-on: ubuntu-latest | |
| target: i686-unknown-linux-musl | |
| - runs-on: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: clippy, rustfmt | |
| rustflags: "" | |
| target: ${{ matrix.target }} | |
| - name: Install cross | |
| if: ${{ matrix.runs-on == 'ubuntu-latest' }} | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| # This step seems absolutely necessary for 'cross' to work. | |
| - name: Clean build cache | |
| run: cargo clean | |
| - name: Build (Windows) | |
| if: ${{ matrix.runs-on == 'windows-latest' }} | |
| run: cargo build --release --all-features --target=${{ matrix.target }} | |
| - name: Build (Linux, cross compile) | |
| if: ${{ matrix.runs-on == 'ubuntu-latest' }} | |
| run: cross build --release --all-features --target=${{ matrix.target }} | |
| - name: Create a zip (windows) | |
| id: create-zip | |
| if: ${{ matrix.runs-on == 'windows-latest' }} | |
| run: | | |
| mkdir release | |
| cp LICENSE release/ | |
| cp target/${{ matrix.target }}/release/csm.exe release/ | |
| Compress-Archive -Path release/* -DestinationPath csm-${{ github.ref_name }}-${{ matrix.target }}.zip | |
| - name: Create a tar.gz (linux) | |
| id: create-tar | |
| if: ${{ matrix.runs-on == 'ubuntu-latest' }} | |
| run: | | |
| mkdir release | |
| cp LICENSE release/ | |
| cp target/${{ matrix.target }}/release/csm release/ | |
| tar -czvf csm-${{ github.ref_name }}-${{ matrix.target }}.tar.gz -C release . | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: | | |
| csm*.zip | |
| csm*.tar.gz |