-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 1.98 KB
/
Copy pathrelease.yml
File metadata and controls
72 lines (64 loc) · 1.98 KB
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
name: Build release binaries
on:
push:
tags:
- "v*"
- "*.*.*"
workflow_dispatch:
inputs:
tag:
description: 'Tag to build'
required: false
default: "9.99.99"
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
toolchain: stable
target: x86_64-unknown-linux-gnu
extension: ""
- os: macos-latest
toolchain: nightly
target: aarch64-apple-darwin
extension: ""
- os: windows-latest
toolchain: stable
target: x86_64-pc-windows-msvc
extension: ".exe"
permissions:
contents: write
runs-on: ${{ matrix.os }}
env:
VERSION: ${{ inputs.tag || github.ref_name }}
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
steps:
- uses: actions/checkout@v7
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
override: true
- name: Build release
run: cargo build --release --target ${{ matrix.target }}
- name: Stage release binary
shell: bash
run: |
mkdir -p ./artifacts
cp ./target/${{ matrix.target }}/release/byte-knight${{ matrix.extension }} \
./artifacts/byte-knight-${VERSION}-${{ matrix.target }}${{ matrix.extension }}
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: byte-knight-${{ matrix.target }}${{ matrix.extension }}
path: ./artifacts/byte-knight-${{ env.VERSION }}-${{ matrix.target }}${{ matrix.extension }}
retention-days: 1
- name: Upload to release
if: github.event_name == 'push'
uses: softprops/action-gh-release@v3
with:
files: ./artifacts/byte-knight-${{ env.VERSION }}-${{ matrix.target }}${{ matrix.extension }}