-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 2.28 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (71 loc) · 2.28 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
73
74
75
76
77
78
79
80
81
name: Release Build Distribution
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Compile for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: gpupatch-cli.exe
asset_name: gpupatch-windows-amd64.exe
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: gpupatch-cli
asset_name: gpupatch-linux-amd64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: gpupatch-cli
asset_name: gpupatch-macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: gpupatch-cli
asset_name: gpupatch-macos-arm64
steps:
- name: Checkout Source
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Compile Production Binaries
run: |
cargo build --release --workspace --target ${{ matrix.target }}
cd node-module && npm install && npm run build
- name: Stage Assets for Upload
shell: bash
run: |
mkdir staging
# Define binaries
CLI_BIN="gpupatch-cli"
GUI_BIN="gpupatch-gui"
EXT=""
if [ "${{ matrix.os }}" = "windows-latest" ]; then
EXT=".exe"
fi
# Copy binaries
cp target/${{ matrix.target }}/release/gpupatch${EXT} ./staging/${CLI_BIN}-${{ matrix.target }}${EXT}
cp target/${{ matrix.target }}/release/companion${EXT} ./staging/${GUI_BIN}-${{ matrix.target }}${EXT}
# Copy Node module
cp node-module/*.node ./staging/gpupatch-node-${{ matrix.target }}.node
if [ "${{ matrix.os }}" != "windows-latest" ]; then
chmod +x ./staging/*
fi
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
./staging/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}