Skip to content

Rebase editor to 4.6.2 #135

Rebase editor to 4.6.2

Rebase editor to 4.6.2 #135

Workflow file for this run

# this actions workflow builds large dscript for desktop plus web. It also has
# some steps to deploy to itch.io through their upload program butler. We have a
# copy of the app on itch.
name: "Export Godot"
on:
workflow_call:
workflow_dispatch:
push:
branches:
- release
- staging
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
BUILD_GIT_COMMIT: ${{ github.sha }}
BUILD_GIT_BRANCH: ${{ github.ref_name }}
jobs:
# This setup job runs only once and first to prepare the environment to avoid
# downloading Godot and the export templates multiple times.
setup:
name: Setup environment
runs-on: ubuntu-latest
container: registry.gitlab.com/greenfox/godot-build-automation:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: false
- name: Install Python 3
run: apt-get update && apt-get install -y --no-install-recommends python3
- name: Prepare CI environment
run: python3 build.py prepare ci
- name: Upload prepared source
uses: actions/upload-artifact@v4
with:
name: prepared-source
path: |
.
!.git
retention-days: 1
include-hidden-files: true
export:
name: Export ${{ matrix.platform }}
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [linux, windows, osx, web]
include:
- platform: linux
artifact_name: linux
release_tag: linux
- platform: windows
artifact_name: windows
release_tag: windows
- platform: osx
artifact_name: macos-build
release_tag: osx
- platform: web
artifact_name: web
release_tag: web
steps:
- name: Checkout for GitHub Pages deploy
if: matrix.platform == 'web'
uses: actions/checkout@v4
with:
lfs: false
- name: Download prepared source
uses: actions/download-artifact@v4
with:
name: prepared-source
- name: Make Godot and butler executable and set up environment
run: |
chmod +x godot_server.x86_64
chmod +x butler
echo "$PWD" >> $GITHUB_PATH
echo "GODOT_TEMPLATES_DIR=$PWD/templates" >> $GITHUB_ENV
- name: Export for ${{ matrix.platform }}
run: python3 build.py export ${{ matrix.platform }}
- name: Push to itch.io
if: github.ref_name == 'release' || github.ref_name == 'staging'
run: python3 build.py push ${{ matrix.platform }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: build/${{ matrix.platform }}
retention-days: ${{ matrix.platform == 'osx' && 30 || 90 }}
- name: Upload desktop builds to GitHub Releases
if: matrix.release_tag != ''
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/${{ matrix.platform }}/*
tag: ${{ matrix.release_tag }}
file_glob: true
overwrite: true
- name: Deploy release web build to GitHub Pages
if: (matrix.platform == 'web') && (github.ref_name == 'release')
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/web
target-folder: ''
clean: false
- name: Deploy staging/other web build to GitHub Pages
if: (matrix.platform == 'web') && (github.ref_name != 'release')
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/web/${{ github.ref_name }}
target-folder: ${{ github.ref_name }}
clean: false