forked from GodotVR/godot_openxr_vendors
-
Notifications
You must be signed in to change notification settings - Fork 1
182 lines (168 loc) · 7.13 KB
/
build-addon-on-push.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Workflow to automatically create the godot openxr loaders addon
name: Build on push
on: [push, pull_request]
jobs:
build:
name: Building for ${{ matrix.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- name: Linux (x86_64)
os: ubuntu-20.04
platform: linux
flags: arch=x86_64
artifact_name: build-files-linux-x86_64
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
# Not sure how to cross compile these
# - name: Linux (arm64)
# os: ubuntu-20.04
# platform: linux
# flags: arch=arm64
# artifact_name: build-files-linux-arm64
# artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
# - name: Linux (rv64)
# os: ubuntu-20.04
# platform: linux
# flags: arch=rv64
# artifact_name: build-files-linux-rv64
# artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
- name: Windows
os: windows-latest
platform: windows
artifact_name: build-files-windows
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/windows/*/*/*.dll
- name: MacOS
os: macos-11
platform: macos
flags: arch=universal
artifact_name: build-files-macos
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/macos/*/*.framework
- name: Android AAR
os: ubuntu-20.04
platform: android
flags: arch=arm64
artifact_name: build-files-android-aar
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/android/*/*.aar
- name: Android SO
os: ubuntu-20.04
platform: android
flags: arch=arm64
artifact_name: build-files-android-so
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/android/*/*/*.so
# Note, to satisfy the asset library we need to make sure our zip files have a root folder
# this is why we checkout into aar and build into asset
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: aar
submodules: recursive
- name: Set up Python (for SCons)
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Android dependencies
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true
- name: Install scons
run: |
python -m pip install scons==4.0.0
- name: Create extension library
run: |
cd aar
scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} custom_api_file=thirdparty/godot_cpp_gdextension_api/extension_api.json
scons platform=${{ matrix.platform }} target=template_release ${{ matrix.flags }} custom_api_file=thirdparty/godot_cpp_gdextension_api/extension_api.json
cd ..
# On Android we build our loaders and build our extension with gradlew
- name: Setup java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "adopt"
if: matrix.platform == 'android'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
if: matrix.platform == 'android'
- name: Create Godot-CPP library
run: |
cd aar/thirdparty/godot-cpp
scons platform=${{ matrix.platform }} target=template_debug arch=arm64 custom_api_file=../godot_cpp_gdextension_api/extension_api.json
scons platform=${{ matrix.platform }} target=template_release arch=arm64 custom_api_file=../godot_cpp_gdextension_api/extension_api.json
scons platform=${{ matrix.platform }} target=template_debug arch=x86_64 custom_api_file=../godot_cpp_gdextension_api/extension_api.json
scons platform=${{ matrix.platform }} target=template_release arch=x86_64 custom_api_file=../godot_cpp_gdextension_api/extension_api.json
cd ../../..
if: matrix.platform == 'android'
- name: Create Godot OpenXR Vendors AARs
run: |
cd aar
./gradlew build
cd ..
if: matrix.platform == 'android'
- name: Upload build files (artifacts)
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: |
${{ matrix.artifact_path }}
# GODOT 4.2 ADDON GENERATION SECTION
asset:
name: Assembling the asset
runs-on: ubuntu-20.04
needs: build
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: aar
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Create Godot OpenXR Vendors Addon
run: |
mkdir asset
cp -r aar/demo/addons asset
cp aar/CHANGES.md asset/addons/godotopenxrvendors/GodotOpenXRVendors_CHANGES.md
- name: Adding vendor licences
run: |
mkdir -p asset/addons/godotopenxrvendors/meta/
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxrvendors/meta/
mkdir -p asset/addons/godotopenxrvendors/pico/
cp aar/godotopenxrpico/libs/pico_openxr_sdk/arm64-v8a/README.md asset/addons/godotopenxrvendors/pico/LICENSE.md
mkdir -p asset/addons/godotopenxrvendors/khronos/
cp aar/godotopenxrkhronos/LICENSE asset/addons/godotopenxrvendors/khronos/LICENSE
- name: Copying artifacts
run: |
mkdir -p asset/addons/godotopenxrvendors/.bin/android/
cp -r build-files-android-aar/* asset/addons/godotopenxrvendors/.bin/android/
cp -r build-files-android-so/* asset/addons/godotopenxrvendors/.bin/android/
mkdir -p asset/addons/godotopenxrvendors/.bin/linux/
cp -r build-files-linux-x86_64/* asset/addons/godotopenxrvendors/.bin/linux/
mkdir -p asset/addons/godotopenxrvendors/.bin/windows/
cp -r build-files-windows/* asset/addons/godotopenxrvendors/.bin/windows/
mkdir -p asset/addons/godotopenxrvendors/.bin/macos/
cp -r build-files-macos/* asset/addons/godotopenxrvendors/.bin/macos/
- name: Create Godot OpenXR Vendor addon artifact
uses: actions/upload-artifact@v3
with:
name: GodotOpenXRVendorsAddon
path: |
asset
- name: Zip addon
run: |
zip -qq -r godotopenxrvendorsaddon.zip asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
- name: Create and upload asset
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "godotopenxrvendorsaddon.zip"
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')