Skip to content

Update release pipeline #11

Update release pipeline

Update release pipeline #11

Workflow file for this run

name: Release
defaults:
run:
shell: bash
working-directory: cli-client
permissions:
contents: write
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+-*"
jobs:
create-release:
name: Create release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
rust: stable
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
rust: stable
- target: x86_64-apple-darwin
os: macos-latest
rust: stable
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Get release version number
id: get_release_version
if: env.VERSION == ''
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Check that tag version and Cargo.toml version are the same
shell: bash
run: |
if ! grep -q "version = \"$VERSION\"" Cargo.toml; then
echo "version does not match Cargo.toml" >&2
exit 1
fi
- name: Install C compilation tooling (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y
sudo apt-get install clang gcc-aarch64-linux-gnu musl-tools -y
- name: Add rustup target
run: rustup target add ${{ matrix.target }}
- uses: taiki-e/install-action@v2
with:
tool: cross
- name: Build release
run: cross build --release --target ${{ matrix.target }}
- name: Create release directory
run: mkdir -p artifacts/strikes/strikes-${{ steps.get_release_version.outputs.VERSION }}-${{ matrix.target }}
- name: Move binary to release directory
run: mv target/${{ matrix.target }}/release/strikes/ artifacts/strikes/strikes-${{ steps.get_release_version.outputs.VERSION }}-${{ matrix.target }}