Build #5
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 | |
on: | |
workflow_call: | |
inputs: | |
rust: | |
type: string | |
solana: | |
type: string | |
workflow_dispatch: | |
inputs: | |
rust: | |
description: Rust version | |
default: 1.70.0 | |
required: true | |
type: string | |
solana: | |
description: Solana version | |
default: 1.16.18 | |
required: true | |
type: string | |
env: | |
CACHE: true | |
jobs: | |
build_cli: | |
name: Build | |
strategy: | |
matrix: | |
os: | |
- buildjet-8vcpu-ubuntu-2004 | |
- macos-latest | |
- macos-14 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Load environment variables | |
run: cat .github/.env >> $GITHUB_ENV | |
- name: Install Rust | |
uses: nifty-oss/actions/install-rust@v1 | |
with: | |
toolchain: ${{ inputs.rust || env.RUST_VERSION }} | |
- name: Install Solana | |
uses: nifty-oss/actions/install-solana@v1 | |
with: | |
version: ${{ inputs.solana || env.SOLANA_VERSION }} | |
cache: ${{ env.CACHE }} | |
- name: Cache Rust CLI dependencies | |
uses: nifty-oss/actions/buildjet-cache-crate@v1 | |
with: | |
folder: '.' | |
key: rust-cli-${{ matrix.os }} | |
- name: Build Rust CLI | |
working-directory: '.' | |
run: | | |
cargo build --all-features --release --bin nifty | |
mv ./target/release/nifty ./target/release/nifty-cli-${{ runner.os }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rust-cli-build-${{ matrix.os }} | |
path: ./target/release/*nifty-cli-${{ runner.os }} | |
if-no-files-found: error | |
- name: Release Tags | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./target/release/*nifty-cli-${{ runner.os }} |