forked from GodotVR/godot_openxr_vendors
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (76 loc) · 2.69 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
# Workflow to automatically create the godot openxr loaders addon
name: Build on push
on:
[push, pull_request]
jobs:
build:
name: Assembling artifacts
runs-on: ubuntu-20.04
# 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: Setup java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Create Godot OpenXR Vendors AARs
run: |
cd aar
cd thirdparty/godot-cpp
scons platform=android target=template_debug -j4
scons platform=android target=template_release -j4
cd ../..
./gradlew build
cd ..
# GODOT 4.2 ADDON GENERATION SECTION
- 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: |
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxrvendors/meta/
cp aar/godotopenxrpico/src/main/jniLibs/arm64-v8a/README.md asset/addons/godotopenxrvendors/pico/LICENSE.md
cp aar/godotopenxrkhronos/LICENSE asset/addons/godotopenxrvendors/khronos/LICENSE
- 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')