Skip to content

Manually Triggered Build and Release Upload #87

Manually Triggered Build and Release Upload

Manually Triggered Build and Release Upload #87

Workflow file for this run

name: Manually Triggered Build and Release Upload
on:
workflow_dispatch:
inputs:
ref:
description: 'Git reference (branch or commit) to build from'
required: true
release_name:
description: 'Release name or tag to upload the artifact to'
required: true
env:
CARGO_TERM_COLOR: always
GH_TOKEN: ${{ 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-musl
target: x86_64-unknown-linux-musl
- 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: 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 }} # This checks out the git reference specified by the user
- 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 }}
# Assuming you have gh CLI installed in the runner
- name: Upload Release Artifact
run: gh release upload ${{ github.event.inputs.release_name }} ${{ matrix.artifact_name }} # Upload to the specified release