nightly-trigger #7
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
name: Nightly build | |
on: | |
workflow_dispatch: | |
workflow_call: | |
repository_dispatch: | |
types: [nightly-trigger] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: debian:bookworm | |
steps: | |
# Install git. | |
- name: Git | |
run: | | |
apt-get update | |
apt-get install -y git | |
# check out git repository. | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: '0' | |
fetch-tags: true | |
- name: Set nightly version in app | |
run: | | |
git config --global --add safe.directory /__w/SnekStudio/SnekStudio | |
sed -i "s/config\/name=.*/config\/name=\"SnekStudioNightly\"/" project.godot | |
sed -i "s/config\/version=.*/config\/version=\"$(git describe --tags --exclude nightly | cut -c2-)\"/" project.godot | |
# Do the build. | |
- name: Build | |
run: | | |
Build/run_this_inside_debian_container_to_build.bsh | |
- name: 🏷️ Create/update nightly tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/nightly', | |
sha: context.sha | |
}).catch(err => { | |
if (err.status !== 422) throw err; | |
github.rest.git.updateRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'tags/nightly', | |
sha: context.sha | |
}); | |
}) | |
- name: Delete old release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: nightly | |
fail-if-no-assets: false | |
fail-if-no-release: false | |
assets: | | |
* | |
- name: Release to nightly tag | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: Nightly build | |
body: Auto generated release | |
tag_name: nightly | |
prerelease: true | |
files: "Build/Builds/Dist/SnekStudio_*" |