-
Notifications
You must be signed in to change notification settings - Fork 75
70 lines (62 loc) · 2.29 KB
/
build-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
# Workflow to automatically create deliverables
name: Build on push
on:
[push, pull_request]
jobs:
build:
name: Assembling artifacts
runs-on: ubuntu-latest
# Note, to satisfy the asset library we need to make sure our zip files have a root folder
# this is why we checkout into demo/godot-xr-tools
# and build plugin/godot-xr-tools
steps:
# Check out into demo/godot-xr-tools
- name: Checkout
uses: actions/checkout@v4
with:
path: demo/godot-xr-tools
# Assemble the plugin folder and clean up the demo folder
- name: Create XR tools plugin
run: |
mkdir plugin
mkdir plugin/godot-xr-tools
mkdir plugin/godot-xr-tools/addons
cp -r demo/godot-xr-tools/addons/godot-xr-tools plugin/godot-xr-tools/addons
cp demo/godot-xr-tools/LICENSE plugin/godot-xr-tools/addons/godot-xr-tools
cp demo/godot-xr-tools/CONTRIBUTORS.md plugin/godot-xr-tools/addons/godot-xr-tools
cp demo/godot-xr-tools/VERSIONS.md plugin/godot-xr-tools/addons/godot-xr-tools
rm -rf demo/godot-xr-tools/.git
rm -rf demo/godot-xr-tools/.github
# Upload plugin
- name: Create XR tools library artifact
uses: actions/upload-artifact@v4
with:
name: godot-xr-tools
path: |
plugin
# Upload demo
- name: Create XR tools demo artifact
uses: actions/upload-artifact@v4
with:
name: godot-xr-tools-demo
path: |
demo
# For tagged builds create the artifact zips
- name: Zip asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
cd plugin
zip -qq -r ../godot-xr-tools.zip godot-xr-tools
cd ../demo
zip -qq -r ../godot-xr-tools-demo.zip godot-xr-tools
cd ..
# For tagged builds create the release
- name: Create and upload asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "godot-xr-tools.zip,godot-xr-tools-demo.zip"
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}