-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (136 loc) · 4.33 KB
/
release.yml
File metadata and controls
155 lines (136 loc) · 4.33 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: ProXPL Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-package:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: proxpl-linux
binary_path: build/proxpl
asset_name: proxpl-linux
- os: windows-latest
artifact_name: proxpl-windows
binary_path: build\Release\proxpl.exe
asset_name: proxpl-windows.exe
- os: macos-latest
artifact_name: proxpl-macos
binary_path: build/proxpl
asset_name: proxpl-macos
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install LLVM (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y llvm-dev libclang-dev clang
- name: Install LLVM (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install llvm
echo "CMAKE_PREFIX_PATH=$(brew --prefix llvm)" >> $GITHUB_ENV
- name: Install LLVM (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: ./scripts/setup_llvm_windows.ps1
- name: Configure (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Configure (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cmake -S . -B build `
-G "Visual Studio 17 2022" -A x64 `
-DCMAKE_BUILD_TYPE=Release `
-DLLVM_DIR="$env:LLVM_DIR" `
-DCMAKE_PREFIX_PATH="$env:LLVM_ROOT"
- name: Build
shell: bash
run: cmake --build build --config Release --verbose
- name: Verify Build (Check Binary Exists)
shell: bash
run: |
if [ -f "${{ matrix.binary_path }}" ]; then
echo "Binary found at ${{ matrix.binary_path }}"
else
echo "Binary NOT found at ${{ matrix.binary_path }}"
# List directory for debugging
ls -R build
exit 1
fi
- name: Build Installer (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
choco install innosetup -y
New-Item -ItemType Directory -Force -Path bin
Copy-Item "build/Release/proxpl.exe" -Destination "bin/"
Copy-Item "build/Release/prm.exe" -Destination "bin/"
if (Test-Path "build/Release/proxpl_lib.dll") {
Copy-Item "build/Release/proxpl_lib.dll" -Destination "bin/"
}
ISCC setup.iss
Get-ChildItem -Path build
- name: Rename Binary
shell: bash
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cp "${{ matrix.binary_path }}" ${{ matrix.asset_name }}
else
mv "${{ matrix.binary_path }}" ${{ matrix.asset_name }}
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: |
${{ matrix.asset_name }}
build/ProXPL_Installer_*.exe
release:
name: Create Release
needs: build-and-package
runs-on: ubuntu-latest
steps:
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
name: proxpl-windows.exe
- name: Download Windows Installer
uses: actions/download-artifact@v4
with:
name: proxpl-windows.exe
path: .
pattern: ProXPL_Installer_*.exe
merge-multiple: true
- name: Download Linux Artifact
uses: actions/download-artifact@v4
with:
name: proxpl-linux
- name: Download macOS Artifact
uses: actions/download-artifact@v4
with:
name: proxpl-macos
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
proxpl-windows.exe
ProXPL_Installer_*.exe
proxpl-linux
proxpl-macos
generate_release_notes: true
draft: false
prerelease: false