Skip to content

Commit

Permalink
Expanded build matrix for cross-platform support
Browse files Browse the repository at this point in the history
Allow lower than python 3.10.
  • Loading branch information
fire committed Jul 21, 2024
1 parent 031908e commit 248abfb
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 161 deletions.
84 changes: 41 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
name: Build

on:
pull_request:
workflow_dispatch:
inputs:
python-version:
type: choice
required: true
default: '3.12'
default: "3.12"
options:
- 3.12
- 3.12
release:
type: boolean
required: false
default: false

jobs:
linux-build:
name: Linux build
runs-on: ubuntu-latest
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '${{ inputs.python-version }}'
python-version: ${{ github.event.inputs.python-version }}

- name: Setup SCons
shell: bash
Expand All @@ -27,63 +41,47 @@ jobs:
python -m pip install scons==4.4.0
scons --version
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Build extension (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
scons platform=linux arch=x86_64 single_source=true
- name: Build extension
- name: Build extension (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
scons platform=linux single_source=true
scons platform=windows arch=x86_64 single_source=true
# archive to preserve execute permission on library files
- name: Create archive
- name: Create archive (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cd bin/
zip -q -r ../godot-python-linux-x86_64.zip *
cd ../
- name: Upload artifacts
- name: Upload artifacts (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: godot-python-linux-x86_64
path: godot-python*.zip
retention-days: 30


windows-build:
name: Windows build
runs-on: windows-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '${{ inputs.python-version }}'

- name: Setup SCons
shell: bash
run: |
python -c 'import sys; print(sys.version)'
python -m pip install scons==4.4.0
scons --version
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Build extension
run: |
scons platform=windows single_source=true
- name: Upload artifacts
- name: Upload artifacts (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: godot-python-windows-x86_64
# everything under bin/ but exclude unneeded files that get generated for some reason
path: |
bin/**/*
!bin/**/*.lib
!bin/**/*.exp
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"
Loading

0 comments on commit 248abfb

Please sign in to comment.