Skip to content

Add config options for build and python versions. Add configs for windows and linux arm64. #115

Add config options for build and python versions. Add configs for windows and linux arm64.

Add config options for build and python versions. Add configs for windows and linux arm64. #115

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
inputs:
release:
type: boolean
required: false
default: false
jobs:
build:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
python_standalone_build: [20231002]
python_version: [3.12.0]
target:
[
{ platform: linux, arch: x86_64, os: ubuntu-latest },
{ platform: windows, arch: x86_64, os: windows-latest },
{ platform: macos, arch: x86_64, os: macos-latest },
{ platform: macos, arch: arm64, os: macos-latest },
]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
# Note that this is for scons, not for the python version we are building.
python-version: 3.12
- name: Setup SCons
shell: bash
run: |
python -c 'import sys; print(sys.version)'
python -m pip install scons==4.4.0
scons --version
- name: Build extension (Linux)
if: matrix.target.os == 'ubuntu-latest'
run: |
scons platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true
- name: Build extension (Windows)
if: matrix.target.os == 'windows-latest'
shell: pwsh
run: |
scons platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true
- name: Build extension (macOS)
if: matrix.target.os == 'macos-latest'
run: |
scons platform=${{ matrix.target.platform }} arch=${{ matrix.target.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true
- name: Upload artifacts (Linux)
if: matrix.target.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: godot-python-${{ matrix.target.platform }}-${{ matrix.target.arch }}-py${{ matrix.python_version }}-ig${{ matrix.python_standalone_build }}
path: bin/**/*
retention-days: 30
- name: Upload artifacts (Windows)
if: matrix.target.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: godot-python-${{ matrix.target.platform }}-${{ matrix.target.arch }}-py${{ matrix.python_version }}-ig${{ matrix.python_standalone_build }}
path: |
bin/**/*
!bin/**/*.lib
!bin/**/*.exp
retention-days: 30
- name: Upload artifacts (macOS)
if: matrix.target.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: godot-python-${{ matrix.target.platform }}-${{ matrix.target.arch }}-py${{ matrix.python_version }}-ig${{ matrix.python_standalone_build }}
path: bin/**/*
retention-days: 30
- name: Release artifact
if: ${{ inputs.release }}
run: |
if [[ "${{ matrix.target.os }}" == "ubuntu-latest" ]]; then
echo "Releasing artifact for linux"
elif [[ "${{ matrix.target.os }}" == "windows-latest" ]]; then
echo "Releasing artifact for windows"
elif [[ "${{ matrix.target.os }}" == "macos-latest" ]]; then
echo "Releasing artifact for macOS"
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: godot-python
pattern: godot-python-*
delete-merged: true