last try #50
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: "godot-ci export" | |
on: | |
push: | |
branches: | |
- main | |
env: | |
GODOT_VERSION: 4.1.2 | |
EXPORT_NAME: SmashEm | |
jobs: | |
project-version: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Get current tag | |
id: current-tag | |
uses: WyriHaximus/[email protected] | |
with: | |
fallback: v0 | |
- name: Increase tag version | |
id: next-tag | |
uses: WyriHaximus/[email protected] | |
with: | |
version: ${{ steps.current-tag.outputs.tag }} | |
strict: false | |
outputs: | |
projectVersion: ${{ steps.next-tag.outputs.v_major }} | |
export-windows: | |
name: Windows Export | |
needs: project-version | |
runs-on: ubuntu-20.04 | |
container: | |
image: barichello/godot-ci:4.1.2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates | |
cp -a /root/.local/share/godot/templates/. ~/.local/share/godot/export_templates/ | |
mkdir -v -p ~/.local/share/godot/templates | |
mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/templates/${GODOT_VERSION}.stable | |
- name: Windows Build | |
run: | | |
mkdir -v -p build/windows | |
godot -v --headless --export-release "Windows Desktop" build/windows/$EXPORT_NAME.exe | |
pwd | |
ls | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-${{ needs.project-version.outputs.projectVersion }} | |
path: build/windows/ | |
if-no-files-found: error | |
outputs: | |
projectVersion: ${{ needs.project-version.outputs.projectVersion }} | |
gitops: | |
runs-on: ubuntu-20.04 | |
needs: [export-windows] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Push gitops changes to git | |
run: | | |
tag=${{ needs.export-windows.outputs.projectVersion }} | |
message='Bump version - ${{ needs.export-windows.outputs.projectVersion }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}' | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git tag -a "${tag}" -m "${message}" | |
git push origin "${tag}" |