-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 2.55 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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