-
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (111 loc) · 3.32 KB
/
build_native.yml
File metadata and controls
130 lines (111 loc) · 3.32 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
name: Build Native
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'CMakeLists.txt'
- 'src/native/**'
- .github/workflows/build_native.yml
pull_request:
paths:
- 'CMakeLists.txt'
- 'src/native/**'
- .github/workflows/build_native.yml
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get CMake
uses: lukka/get-cmake@v3.29.4
- name: Configure win-x64
run: cmake -S "src/native" -B "build_win_64" -G "Visual Studio 17 2022" -A x64 -D CMAKE_SYSTEM_VERSION=10.0.26100.0
- name: Build win-x64
run: cmake --build build_win_64 --config Distribution
- name: Package Windows
run: |
mkdir bin/win-x64
mv build_win_64\bin\Distribution\alimer_physics.dll bin/win-x64
- uses: actions/upload-artifact@v4
with:
name: libs_windows
path: bin
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get CMake
uses: lukka/get-cmake@v3.29.4
- name: Configure linux-x64
run: cmake -S "src/native" -B "build_linux_x64" -G Ninja -DCMAKE_BUILD_TYPE=Distribution
- name: Build linux-x64
run: cmake --build build_linux_x64 --config Distribution --verbose --parallel
# Linux artifact
- name: package_linux
run: |
mkdir -p bin/linux-x64
mv build_linux_x64/lib/libalimer_physics.so bin/linux-x64/libalimer_physics.so
- uses: actions/upload-artifact@v4
with:
name: libs_linux
path: bin
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Get CMake
uses: lukka/get-cmake@v3.29.4
- name: Configure osx-universal
run: cmake -S "src/native" -B "build_osx" -G Ninja -DCMAKE_BUILD_TYPE=Distribution -D"CMAKE_OSX_ARCHITECTURES=x86_64;arm64"
- name: Build osx-universal
run: cmake --build build_osx --config Distribution --verbose --parallel
# macOS artifacts
- name: package_osx
run: |
mkdir -p bin/osx
mv build_osx/lib/libalimer_physics.dylib bin/osx/libalimer_physics.dylib
- uses: actions/upload-artifact@v4
with:
name: libs_osx
path: bin
update_libs:
name: Update Native Libs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [windows, linux, macos]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download windows artifacts
uses: actions/download-artifact@v4
with:
name: libs_windows
path: native
- name: Download linux artifacts
uses: actions/download-artifact@v4
with:
name: libs_linux
path: native
- name: Download osx artifacts
uses: actions/download-artifact@v4
with:
name: libs_osx
path: native
- name: Display structure of downloaded files
run: ls -R
working-directory: native
- name: Commit changes
uses: EndBug/add-and-commit@v9.1.4
with:
message: Updated native libs
committer_name: GitHub Actions
committer_email: actions@github.com
- uses: geekyeggo/delete-artifact@v5
with:
name: |
libs_windows
libs_linux
libs_osx