Add config options for build and python versions. Add configs for windows and linux arm64. #85
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: Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
release: | |
type: boolean | |
required: false | |
default: false | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: linux | |
arch: x86_64 | |
os: ubuntu-latest | |
python_version: 3.12.0 | |
python_standalone_build: 20231002 | |
- platform: windows | |
arch: x86_64 | |
os: windows-latest | |
python_version: 3.12.0 | |
python_standalone_build: 20231002 | |
- platform: macos | |
arch: x86_64 | |
os: macos-latest | |
python_version: 3.12.0 | |
python_standalone_build: 20231002 | |
- platform: macos | |
arch: arm64 | |
os: macos-latest | |
python_version: 3.12.0 | |
python_standalone_build: 20231002 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
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.os == 'ubuntu-latest' | |
run: | | |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true | |
- name: Build extension (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true | |
- name: Build extension (macOS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} python_standalone_build=${{ matrix.python_standalone_build }} python_version=${{ matrix.python_version }} single_source=true | |
- name: Create archive (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cd bin/ | |
zip -q -r ../godot-python-${{ matrix.platform }}.${{ matrix.arch }}.${{ matrix.python_standalone_build }}.${{ matrix.python_version }}.zip * | |
cd ../ | |
- name: Upload artifacts (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: godot-python-${{ matrix.platform }}.${{ matrix.arch }}.${{ matrix.python_standalone_build }}.${{ matrix.python_version }} | |
path: godot-python*.zip | |
retention-days: 30 | |
- name: Upload artifacts (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: godot-python-${{ matrix.platform }}.${{ matrix.arch }}.${{ matrix.python_standalone_build }}.${{ matrix.python_version }} | |
path: | | |
bin/**/* | |
!bin/**/*.lib | |
!bin/**/*.exp | |
retention-days: 30 | |
- name: Upload artifacts (macOS) | |
if: matrix.os == 'macos-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: godot-python-${{ matrix.platform }}.${{ matrix.arch }}.${{ matrix.python_standalone_build }}.${{ matrix.python_version }} | |
path: bin/**/* | |
retention-days: 30 | |
- name: Release artifact | |
if: ${{ inputs.release }} | |
run: | | |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
echo "Releasing artifact for linux" | |
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
echo "Releasing artifact for windows" | |
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
echo "Releasing artifact for macOS" |