Manually Triggered Build and Attach Artifacts Without Release #38
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: Manually Triggered Build and Attach Artifacts Without Release | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Branch name to manually build and attach artifacts from' | |
required: true | |
env: | |
CARGO_TERM_COLOR: always | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build: | |
name: Build ${{ matrix.artifact_name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact_path: target/release/odd-box | |
artifact_name: odd-box-x86_64-unknown-linux-gnu | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
artifact_path: target/release/odd-box | |
artifact_name: odd-box-no-default-features-x86_64-unknown-linux-gnu | |
target: x86_64-unknown-linux-gnu | |
no_default_features: true | |
- os: windows-latest | |
artifact_path: target/release/odd-box.exe | |
artifact_name: odd-box-x86_64-pc-windows-msvc.exe | |
target: x86_64-pc-windows-msvc | |
- os: macos-latest | |
artifact_path: target/release/odd-box | |
artifact_name: odd-box-x86_64-apple-darwin | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
artifact_path: target/release/odd-box | |
artifact_name: odd-box-aarch64-apple-darwin | |
target: aarch64-apple-darwin | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
- name: Install NASM | |
if: startsWith(matrix.os, 'windows') | |
uses: ilammy/setup-nasm@v1 | |
- name: Configure NASM for CMake (Windows only) | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
$env:CMAKE_ASM_NASM_COMPILER = "nasm" | |
- name: Build | |
run: | | |
if ("${{ matrix.no_default_features }}" -eq "true") { | |
cargo build --release --verbose --no-default-features | |
} else { | |
cargo build --release --verbose | |
} | |
shell: pwsh | |
- name: Rename Artifact | |
run: mv ${{ matrix.artifact_path }} ${{ matrix.artifact_name }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: ${{ matrix.artifact_name }} |