Skip to content

确保作为zip档下载该仓库时包含demo文件夹中的内容。 #139

确保作为zip档下载该仓库时包含demo文件夹中的内容。

确保作为zip档下载该仓库时包含demo文件夹中的内容。 #139

Workflow file for this run

name: 🛠️ Builds
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- identifier: linux-x64-debug
name: 🐧 Linux x64 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: linux
arch: x86_64
- identifier: linux-x64-release
name: 🐧Linux x64 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: linux
arch: x86_64
- identifier: linux-x86-debug
name: 🐧 Linux x86 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: linux
arch: x86_32
- identifier: linux-x86-release
name: 🐧Linux x86 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: linux
arch: x86_32
- identifier: macos-universal-debug
name: 🍎 macOS (universal) Debug
runner: macos-latest
target: template_debug
debug_symbol: yes
platform: macos
arch: universal
- identifier: macos-universal-release
name: 🍎 macOS (universal) Release
runner: macos-latest
target: template_release
debug_symbol: no
platform: macos
arch: universal
- identifier: ios-arm64-debug
name: 🍏 ios arm64 Debug
runner: macos-12
target: template_debug
debug_symbol: yes
platform: ios
arch: arm64
- identifier: ios-arm64-release
name: 🍏 ios arm64 Release
runner: macos-12
target: template_release
debug_symbol: no
platform: ios
arch: arm64
- identifier: windows-x64-debug
name: 🏁 Windows x64 Debug
runner: windows-latest
target: template_debug
debug_symbol: yes
platform: windows
arch: x86_64
- identifier: windows-x64-release
name: 🏁 Windows x64 Release
runner: windows-latest
target: template_release
debug_symbol: no
platform: windows
arch: x86_64
- identifier: windows-x86-debug
name: 🏁 Windows x86 Debug
runner: windows-latest
target: template_debug
debug_symbol: yes
platform: windows
arch: x86_32
- identifier: windows-x86-release
name: 🏁 Windows x86 Release
runner: windows-latest
target: template_release
debug_symbol: no
platform: windows
arch: x86_32
- identifier: android-arm64-debug
name: 🤖 Android arm64 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: android
arch: arm64
- identifier: android-arm64-release
name: 🤖 Android arm64 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: android
arch: arm64
- identifier: android-x86_64-debug
name: 🤖 Android x86_64 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: android
arch: x86_64
- identifier: android-x86_64-release
name: 🤖 Android x86_64 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: android
arch: x86_64
- identifier: android-arm32-debug
name: 🤖 Android arm32 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: android
arch: arm32
- identifier: android-arm32-release
name: 🤖 Android arm32 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: android
arch: arm32
- identifier: android-x86_32-debug
name: 🤖 Android x86_32 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: android
arch: x86_32
- identifier: android-x86_32-release
name: 🤖 Android x86_32 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: android
arch: x86_32
- identifier: web-wasm32-debug
name: 🌐 Web wasm32 Debug
runner: ubuntu-20.04
target: template_debug
debug_symbol: yes
platform: web
arch: wasm32
- identifier: web-wasm32-release
name: 🌐 Web wasm32 Release
runner: ubuntu-20.04
target: template_release
debug_symbol: no
platform: web
arch: wasm32
env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
EM_VERSION: 3.1.39
EM_CACHE_FOLDER: "emsdk-cache"
BUILD_VERSION: "v0.0.0"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up SCons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4
scons --version
- name: Checkout project
uses: actions/checkout@v4
with:
submodules: recursive
- name: (Windows) Install mingw64
if: ${{ matrix.platform == 'windows' }}
# change to egor-tensin/setup-mingw@v2 once pr #16 is merged
uses: e-t-l/setup-mingw@patch-1
- name: (Linux) Install dependencies
if: ${{ matrix.platform == 'linux' }}
run: |
sudo apt-get update -qq
sudo apt-get install -qqq build-essential pkg-config
- name: (Linux32) Install dependencies
if: ${{ matrix.platform == 'linux' && matrix.arch == 'x86_32' }}
run: |
sudo apt-get install gcc-multilib g++-multilib
- name: (Android) Install dependencies
if: ${{ matrix.platform == 'android' }}
uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
link-to-sdk: true
- name: (Web) Install dependencies
if: ${{ matrix.platform == 'web' }}
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Setup version
if: ${{ matrix.platform != 'windows' }}
run: |
python build_version.py >> $GITHUB_ENV
- name: Setup version (windows)
if: ${{ matrix.platform == 'windows' }}
run: |
python build_version.py >> $env:GITHUB_ENV
- name: Setup build cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.scons-cache/
key: ${{ matrix.identifier }}
# key: ${{ matrix.identifier }}-${{ github.ref }}
restore-keys: |
# ${{ matrix.identifier }}-${{ github.ref }}
${{ matrix.identifier }}
continue-on-error: true
- name: Compile extension
if: ${{ matrix.platform != 'ios' }}
shell: sh
env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
SCONS_CACHE_LIMIT: 7168
run: |
scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' debug_symbol=${{ matrix.debug_symbol }}
- name: Generate xcframework for ios
if: ${{ matrix.platform == 'ios' }}
shell: sh
env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
SCONS_CACHE_LIMIT: 7168
run: |
scons arch=universal ios_simulator=yes platform=ios target='${{ matrix.target }}' debug_symbol=${{ matrix.debug_symbol }}
scons arch=arm64 ios_simulator=no platform=ios target='${{ matrix.target }}' debug_symbol=${{ matrix.debug_symbol }}
xcodebuild -create-xcframework -library ./demo/addons/gddragonbones/bin/libgddragonbones.ios.'${{ matrix.target }}'.a -library ./demo/addons/gddragonbones/bin/libgddragonbones.ios.'${{ matrix.target }}'.simulator.a -output ./demo/addons/gddragonbones/bin/libgddragonbones.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 ./demo/addons/gddragonbones/bin/libgodot-cpp.ios.'${{ matrix.target }}'.xcframework
- name: Create artifact folder ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}
shell: sh
run: |
mkdir -p '${{ github.workspace }}/${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}/artifact/${{ github.event.repository.name }}/'
- name: Create artifact folder for all in one.
shell: sh
run: |
mkdir -p '${{ github.workspace }}/artifact/${{ github.event.repository.name }}/'
- name: Copy addons folder to artifact folder ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}
shell: sh
run: |
cp -n -r '${{ github.workspace }}/demo/addons' '${{ github.workspace }}/${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}/artifact/${{ github.event.repository.name }}/'
- name: Copy addons folder to artifact folder
shell: sh
run: |
cp -n -r '${{ github.workspace }}/demo/addons' '${{ github.workspace }}/artifact/${{ github.event.repository.name }}/'
- name: Upload artifact ${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}-${{ env.BUILD_VERSION }}-${{ github.sha }}
path: |
${{ github.workspace }}/${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.arch }}/artifact/
retention-days: 14
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-all-platforms-${{ env.BUILD_VERSION }}-${{ github.sha }}
path: |
${{ github.workspace }}/artifact
retention-days: 14
if-no-files-found: error