release #41
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: Build & Deploy Sideko CLI | |
concurrency: deploy-cli-${{ github.ref }} | |
on: | |
workflow_dispatch: {} | |
push: | |
tags: | |
- "v*.*.*" | |
env: | |
CRATE_NAME: sideko | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RUST_BACKTRACE: 1 | |
jobs: | |
release: | |
name: CLI Release - ${{ matrix.platform.release_for }} with rust ${{ matrix.toolchain }} | |
strategy: | |
matrix: | |
platform: | |
- release_for: Linux-x86_64 | |
os_name: Linux-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-linux-musl | |
bin: sideko | |
name: sideko-Linux-x86_64.tar.gz | |
- release_for: Windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
bin: sideko.exe | |
name: sideko-Windows-x86_64.zip | |
command: both | |
- release_for: macOS-x86_64 | |
os: macOS-latest | |
target: x86_64-apple-darwin | |
bin: sideko | |
name: sideko-Darwin-x86_64.tar.gz | |
command: both | |
- release_for: macOS-aarch64 | |
os_name: macOS-aarch64 | |
os: macOS-latest | |
target: aarch64-apple-darwin | |
bin: sideko | |
name: sideko-Darwin-aarch64.tar.gz | |
toolchain: | |
- stable | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache cargo & target directories | |
uses: Swatinem/rust-cache@v2 | |
- name: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "J. Doe" | |
- name: Install musl-tools on Linux | |
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools | |
if: contains(matrix.platform.target, 'musl') | |
- name: Build binary | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: "build" | |
target: ${{ matrix.platform.target }} | |
toolchain: ${{ matrix.toolchain }} | |
args: "--locked --release --package sideko" | |
strip: true | |
- name: Package as archive | |
shell: bash | |
run: | | |
cd target/${{ matrix.platform.target }}/release | |
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then | |
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | |
else | |
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} | |
fi | |
cd - | |
- name: Publish release artifacts | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sideko-${{ matrix.platform.os_name }} | |
path: "sideko-*" | |
- name: Generate SHA-256 | |
run: shasum -a 256 ${{ matrix.platform.name }} | |
if: | | |
startsWith(github.ref, 'refs/tags/') && | |
matrix.toolchain == 'stable' && | |
matrix.platform.os == 'macOS-latest' | |
- name: Publish GitHub release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "sideko-*" | |
body: | | |
# Sideko CLI Release |