-
Notifications
You must be signed in to change notification settings - Fork 5
125 lines (110 loc) · 3.4 KB
/
Copy pathbuild.yml
File metadata and controls
125 lines (110 loc) · 3.4 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to build from (e.g., v1.0.0)'
required: false
type: string
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
npm_config_msvs_version: '2022'
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: pnpm install
- name: Build native overlay addon
run: pnpm rebuild-native
- name: Fetch GCPad DLLs (Windows only)
if: runner.os == 'Windows'
run: node ./scripts/fetch-gcpad.cjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Overlay DLL (Windows only)
if: runner.os == 'Windows'
run: |
powershell -ExecutionPolicy Bypass -File overlay-dll/setup-minhook.ps1
cmake -B overlay-dll/build -S overlay-dll -G "Visual Studio 17 2022" -A x64
cmake --build overlay-dll/build --config Release
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
- name: Verify Overlay DLL output (Windows only)
if: runner.os == 'Windows'
shell: pwsh
run: |
if (!(Test-Path "overlay-dll/build/Release/uc-overlay-x64.dll")) {
throw "Expected overlay DLL at overlay-dll/build/Release/uc-overlay-x64.dll"
}
- name: Build application
run: pnpm -s build && pnpm exec electron-builder --publish=never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_HARD_LINKS: false
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}
path: |
dist-packaged/*.exe
dist-packaged/*.blockmap
dist-packaged/*.zip
dist-packaged/latest*.yml
dist-packaged/*.AppImage
dist-packaged/*.tar.gz
release:
needs: build
if: startsWith(github.ref, 'refs/tags/') || (github.event.inputs.tag != '')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist-packaged
- name: Create or Update Release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.tag || github.ref_name }}
allowUpdates: true
omitBodyDuringUpdate: true
replacesArtifacts: true
artifacts: |
dist-packaged/**/*.exe
dist-packaged/**/*.blockmap
dist-packaged/**/*.zip
dist-packaged/**/latest*.yml
dist-packaged/**/*.AppImage
dist-packaged/**/*.tar.gz
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}