-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 1.89 KB
/
build.yml
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
name: Build MyPlugin
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Haxe 4.3.6
shell: powershell
run: |
Start-Process -FilePath "install/haxe-4.3.6-win64.exe" -ArgumentList "/S" -Wait # Silent install
- name: Add Haxe to PATH
shell: powershell
run: |
$haxePath = (Get-ChildItem -Path "C:\Program Files\Haxe*" -Directory).FullName
if ($haxePath) {
Write-Host "Adding Haxe to PATH: $haxePath"
[Environment]::SetEnvironmentVariable("PATH", "$haxePath;$env:PATH", "Machine") # Persist across sessions
} else {
Write-Host "Haxe installation directory not found!"
exit 1
}
# Refresh environment variables for the current session
refreshenv
- name: Run Haxe build
shell: powershell
run: |
haxe build.hxml
- name: Install CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: 'latest'
architecture: x64
- name: Create Build Directory
run: mkdir build
- name: Configure CMake
shell: powershell
working-directory: build
run: cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022"
- name: Build Project
shell: powershell
working-directory: build
run: cmake --build . --config Release
- name: Upload Release Artifact
uses: actions/upload-artifact@v3
with:
name: MyPlugin
path: build/Release/MyPlugin.exe
- name: Release
if: startsWith(github.ref, 'refs/tags/') # Only run on tag releases
uses: softprops/action-gh-release@v1
with:
files: build/Release/MyPlugin.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}