Add github actions #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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_animation_recorder | |
# and build plugin/godot_animation_recorder | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: demo/godot_animation_recorder | |
- name: Create Godot XR Animation Recorder plugin | |
run: | | |
mkdir plugin | |
mkdir plugin/godot_animation_recorder | |
mkdir plugin/godot_animation_recorder/addons | |
cp -r demo/godot_animation_recorder/addons/godot_animation_recorder plugin/godot_animation_recorder/addons | |
cp demo/godot_animation_recorder/LICENSE plugin/godot_animation_recorder/addons/godot_animation_recorder | |
cp demo/godot_animation_recorder/CONTRIBUTORS.md plugin/godot_animation_recorder/addons/godot_animation_recorder | |
cp demo/godot_animation_recorder/VERSIONS.md plugin/godot_animation_recorder/addons/godot_animation_recorder | |
rm -rf demo/godot_animation_recorder/.git | |
rm -rf demo/godot_animation_recorder/.github | |
- name: Create Godot XR Animation Recorder library artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: godot_animation_recorder | |
path: | | |
plugin | |
- name: Create Godot XR Animation Recorder demo artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: godot_animation_recorder_demo | |
path: | | |
demo | |
- name: Zip asset | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
cd plugin | |
zip -qq -r ../godot_animation_recorder.zip godot_animation_recorder | |
cd ../demo | |
zip -qq -r ../godot_animation_recorder_demo.zip godot_animation_recorder | |
cd .. | |
- 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_animation_recorder.zip,godot_animation_recorder_demo.zip" | |
omitNameDuringUpdate: true | |
omitBodyDuringUpdate: true | |
token: ${{ secrets.GITHUB_TOKEN }} |