-
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.7 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (56 loc) · 1.7 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-and-upload:
name: Build ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux (Musl/Static)
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: vwh
asset_name: vwh-linux-amd64
use_cross: true
# Windows (Standard)
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: vwh.exe
asset_name: vwh-windows-amd64.exe
use_cross: false
# macOS (Apple Silicon - ARM64)
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: vwh
asset_name: vwh-macos-arm64
use_cross: false
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Cross
if: matrix.use_cross
run: cargo install cross
- name: Build (Native)
if: matrix.use_cross == false
run: cargo build --release --target ${{ matrix.target }} --package vwh
- name: Build (Cross)
if: matrix.use_cross
run: cross build --release --target ${{ matrix.target }} --package vwh
- name: Rename Asset
shell: bash
run: |
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ${{ matrix.asset_name }}