Disable all builds, except web #338
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
name: 🌈 All Builds | |
on: | |
push: | |
branches: [ master, temp/fix-web-build ] | |
tags: | |
- "v*" | |
# Global Settings | |
env: | |
PROJECT_FOLDER: . | |
TARGET_PATH: demo/addons/godot-sqlite/bin/ | |
TARGET_NAME: libgdsqlite | |
VAR_PATH: .github/workflows/build_var.json | |
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/ | |
EM_VERSION: 3.1.64 | |
EM_CACHE_FOLDER: emsdk-cache | |
GODOT_VERSION: 4.3 | |
EXPORT_NAME: ./demo/ | |
jobs: | |
matrix: | |
name: Generate build matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix-json: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-matrix | |
shell: pwsh | |
# Use a small PowerShell script to generate the build matrix | |
run: "& .github/workflows/create-build-matrix.ps1" | |
build: | |
needs: [ matrix ] | |
name: ${{ matrix.name }} - ${{ matrix.target == 'template_debug' && 'Debug' || 'Release' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJson(needs.matrix.outputs.matrix-json) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Restore Godot build cache | |
uses: ./godot-cpp/.github/actions/godot-cache-restore | |
with: | |
cache-name: ${{ matrix.cache-name }}-${{ matrix.target }} | |
continue-on-error: true | |
# Use python 3.x release (works cross platform; best to keep self contained in it's own step) | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 | |
with: | |
# Semantic version range syntax or exact version of a Python version | |
python-version: '3.x' | |
# Optional - x64 or x86 architecture, defaults to x64 | |
architecture: 'x64' | |
- name: Android dependencies | |
if: ${{ matrix.platform == 'android' }} | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r23c | |
link-to-sdk: true | |
- name: Web dependencies | |
if: ${{ matrix.platform == 'web' }} | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
version: ${{ env.EM_VERSION }} | |
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}-${{ matrix.target }} | |
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build. | |
- name: Configuring Python packages | |
run: | | |
python -c "import sys; print(sys.version)" | |
python -m pip install scons ${{ matrix.additional-python-packages }} | |
python --version | |
scons --version | |
- name: Windows Compilation | |
if: runner.os == 'Windows' | |
run: | | |
if(-Not (Test-Path -Path ${{ env.PROJECT_FOLDER }}\${{ env.TARGET_PATH }})) | |
{ | |
mkdir ${{ env.PROJECT_FOLDER }}\${{ env.TARGET_PATH }} | |
} | |
cd ${{ env.PROJECT_FOLDER }} | |
scons platform=windows target=${{ matrix.target }} target_path=${{ env.TARGET_PATH }} target_name=${{ env.TARGET_NAME }} -j6 ${{ matrix.flags }} | |
- name: iOS Compilation | |
if: matrix.platform == 'ios' | |
run: | | |
mkdir -v -p ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
cd ${{ env.PROJECT_FOLDER }} | |
scons arch=universal ios_simulator=yes platform=ios target=${{ matrix.target }} target_path=${{ env.TARGET_PATH }} target_name=${{ env.TARGET_NAME }} -j6 | |
scons arch=arm64 ios_simulator=no platform=ios target=${{ matrix.target }} target_path=${{ env.TARGET_PATH }} target_name=${{ env.TARGET_NAME }} -j6 | |
xcodebuild -create-xcframework -library ${{ env.TARGET_PATH }}/${{ env.TARGET_NAME }}.ios.${{ matrix.target }}.a -library ${{ env.TARGET_PATH }}/${{ env.TARGET_NAME }}.ios.${{ matrix.target }}.simulator.a -output ${{ env.TARGET_PATH }}/${{ env.TARGET_NAME }}.ios.${{ matrix.target }}.xcframework | |
xcodebuild -create-xcframework -library godot-cpp/bin/libgodot-cpp.ios.${{ matrix.target }}.arm64.a -library godot-cpp/bin/libgodot-cpp.ios.${{ matrix.target }}.universal.simulator.a -output ${{ env.TARGET_PATH }}/libgodot-cpp.ios.${{ matrix.target }}.xcframework | |
- name: Not Windows or iOS Compilation | |
if: runner.os != 'Windows' && matrix.platform != 'ios' | |
run: | | |
mkdir -v -p ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
cd ${{ env.PROJECT_FOLDER }} | |
scons platform=${{ matrix.platform }} target=${{ matrix.target }} target_path=${{ env.TARGET_PATH }} target_name=${{ env.TARGET_NAME }} -j6 ${{ matrix.flags }} | |
- name: Save Godot build cache | |
uses: ./godot-cpp/.github/actions/godot-cache-save | |
with: | |
cache-name: ${{ matrix.cache-name }}-${{ matrix.target }} | |
continue-on-error: true | |
- name: Upload Artifact | |
env: | |
ARTIFACT_FOLDER: ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.cache-name }}-${{ matrix.target }} | |
path: ${{ env.ARTIFACT_FOLDER }}*.${{ matrix.artifact-extension }} | |
if-no-files-found: error | |
web-deploy: | |
name: Web Deploy | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
container: | |
image: barichello/godot-ci:4.3 # Ideally this would be ${GODOT_VERSION}, but Github Actions doesn't allow this! :( | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Download Artefacts | |
uses: actions/download-artifact@v4 | |
- name: Copy Libraries to Project Folder | |
run: | | |
mkdir -v -p ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
cp --verbose web-wasm32-*/*.wasm ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
- name: Setup | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates | |
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable | |
- name: Web Build | |
run: | | |
mkdir -v -p build/web | |
cd $EXPORT_NAME | |
godot --headless --verbose --export-release "Web" ../build/web/index.html | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: web | |
path: build/web | |
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail. | |
- name: Install rsync 📚 | |
run: | | |
apt-get update && apt-get install -y rsync | |
- name: Deploy to GitHub Pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@releases/v4 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: build/web # The folder the action should deploy. | |
release: | |
name: Release | |
runs-on: "ubuntu-20.04" | |
needs: [ build ] | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
- name: Download Artifacts | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Copy Artifacts to bin/-folder | |
run: | | |
mkdir -v -p ${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }} | |
cd ${{ env.PROJECT_FOLDER }} | |
cp -r ${{steps.download.outputs.download-path}}/**/* ${{ env.TARGET_PATH }} | |
zip -r demo.zip demo/ | |
cd ${{ env.TARGET_PATH }}/.. | |
zip -r bin.zip bin/ | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: ${{ env.PROJECT_FOLDER }}/.github/workflows/release_template.md | |
files: | | |
${{ env.PROJECT_FOLDER }}/demo.zip | |
${{ env.PROJECT_FOLDER }}/${{ env.TARGET_PATH }}/../bin.zip | |
draft: true | |
prerelease: true |