-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.67 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
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
uses: actions/setup-python@v4
with:
python-version: '3.x' # 选择任意 Python 版本
env: |
PATH=${{ env.PATH }}:C:\HaxeToolkit\haxe\ # 将 Haxe 路径添加到 PATH
- name: Run Haxe build
shell: powershell
run: |
$env:PATH = "C:\HaxeToolkit\haxe\;$env:PATH" # 添加 Haxe 路径到 PATH
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 }}