Adjust paths to artifacts and build release #4
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-cli | |
on: | |
push: | |
tags: | |
# 'v[0-9]+.[0-9]+.[0-9]+' to match semantic version tag, e.g. v2.0.8 | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
branches: | |
- feature/github-action-for-cli | |
workflow_dispatch: | |
jobs: | |
build: | |
name: build command line interfaces for ${{ matrix.platform || matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu | |
- macos | |
- windows | |
include: | |
- os: ubuntu | |
platform: linux | |
- os: windows | |
ls: dir | |
runs-on: ${{ format('{0}-latest', matrix.os) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up rust | |
if: matrix.os != 'ubuntu' | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: set up rust for ubuntu | |
if: matrix.os == 'ubuntu' | |
run: > | |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y && | |
rustup show | |
- run: rustup target add aarch64-apple-darwin | |
if: matrix.os == 'macos' | |
- name: run cargo tests | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cd rust/ && cargo test | |
- run: cd rust/ && cargo build --release | |
- name: list current directory files | |
run: ${{ matrix.ls || 'ls -lh' }} ./rust/target/release/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./rust/target/release/ |