release(cli): v0.16.0 #9
Workflow file for this run
This file contains 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 CLI | |
on: | |
push: | |
tags: | |
- "cli-[0-9]+.[0-9]+.[0-9]+" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
uses: ./.github/workflows/test.yml | |
with: | |
package: cambridge-asm-cli | |
publish: | |
name: Publish crate | |
runs-on: ubuntu-latest | |
environment: Release | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Cargo login | |
run: cargo login ${{ secrets.CARGO_API_TOKEN }} | |
- name: Publish crate | |
run: cargo publish -p cambridge-asm-cli | |
release: | |
name: Publish CLI | |
strategy: | |
fail-fast: false | |
matrix: | |
caie: [true, false] | |
target: ['x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu', 'riscv64gc-unknown-linux-gnu', x86_64-pc-windows-gnu] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
container: ghcr.io/saadisave/cambridge-asm-ci:latest | |
environment: Release | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- run: git config --system --add safe.directory /__w/cambridge-asm/cambridge-asm | |
- name: Set release version | |
run: export RELEASE_VERSION=$(python3 .github/getversion-cli.py) && echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
- name: Build | |
if: ${{ !matrix.caie}} | |
run: cargo build --profile prod --target ${{ matrix.target }} -p cambridge-asm-cli | |
- name: Build caie | |
if: matrix.caie | |
run: cargo build --no-default-features --profile prod --target ${{ matrix.target }} -p cambridge-asm-cli | |
- run: mkdir release | |
- name: Zip | |
if: ${{ !contains(matrix.target, 'windows') }} | |
run: zip -j release/cambridge-asm-${{ matrix.target }} target/${{ matrix.target }}/prod/casm README.md LICENSE | |
- name: Zip windows | |
if: contains(matrix.target, 'windows') | |
run: zip -j release/cambridge-asm-${{ matrix.target }} target/${{ matrix.target }}/prod/casm.exe README.md LICENSE | |
- name: Checksum | |
run: sha256sum release/cambridge-asm-${{ matrix.target }}.zip > release/cambridge-asm-${{ matrix.target }}.zip.sha256sum | |
- name: Rename caie | |
if: matrix.caie | |
run: mv release/cambridge-asm-${{ matrix.target }}.zip release/cambridge-asm-${{ matrix.target }}-caie.zip && | |
mv release/cambridge-asm-${{ matrix.target }}.zip.sha256sum release/cambridge-asm-${{ matrix.target }}-caie.zip.sha256sum | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: release/* | |
allowUpdates: true | |
name: cli-${{ env.RELEASE_VERSION }} |