test #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: | |
| - '*' | |
| 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 some build dependencies | |
| if: ${{ matrix.runs-on == 'ubuntu-latest' }} | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools pkg-config libssl-dev | |
| - name: Build | |
| run: cargo build --release --all-features --target=${{ matrix.target }} | |
| - name: Create a zip (windows) | |
| 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 | |
| echo "archive=csm-${{ github.ref_name }}-${{ matrix.target }}.zip" >> $GITHUB_OUTPUT | |
| - name: Create a tar.gz (linux) | |
| 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 . | |
| echo "archive=csm-${{ github.ref_name }}-${{ matrix.target }}.tar.gz" >> $GITHUB_OUTPUT | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| files: ${{ steps.build.outputs.archive }} |