Skip to content

Add bin folder to python targets, and adapt the regular python layout (save for the zip). #100

Add bin folder to python targets, and adapt the regular python layout (save for the zip).

Add bin folder to python targets, and adapt the regular python layout (save for the zip). #100

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.os }}
strategy:
fail-fast: false
matrix:
include:
- 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:
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 }} single_source=true
- name: Build extension (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} single_source=true
- name: Build extension (macOS)
if: matrix.os == 'macos-latest'
run: |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} single_source=true
# Creating an archive explicitly preserves permissions in the artifact,
# which upload-artifact doesn't. See https://github.com/actions/upload-artifact/issues/38
- name: Create archive (Linux, macOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
cd bin/
zip -q -r ../godot-python-${{ matrix.platform }}-${{ matrix.arch }}.zip *
cd ../
- name: Upload artifacts (Linux, macOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: godot-python-${{ matrix.platform }}-${{ matrix.arch }}
path: godot-python-${{ matrix.platform }}-${{ matrix.arch }}.zip
retention-days: 30
- name: Upload artifacts (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: godot-python-${{ matrix.platform }}-${{ matrix.arch }}
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"
elif [[ "${{ matrix.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