Skip to content

Deploy

Deploy #9

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
version:
description: 'pilotlight version'
required: true
default: '0.1.0'
deploy:
description: 'Deploy (true will deploy to pypi)'
required: true
default: 'false'
deploytest:
description: 'Deploy (true will deploy to test pypi)'
required: true
default: 'false'
jobs:
build-package:
runs-on: windows-2022
strategy:
matrix:
python-version: [ 3.14 ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Show Python build paths
run: |
python -c "import sys, sysconfig; print(sys.executable); print(sys.version)"
python -c "import sysconfig; print('include=', sysconfig.get_paths()['include'])"
python -c "import sysconfig; print('platinclude=', sysconfig.get_paths().get('platinclude'))"
python -c "import sysconfig; print('EXT_SUFFIX=', sysconfig.get_config_var('EXT_SUFFIX'))"
- name: Install Dependencies
run: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.296.0/windows/VulkanSDK-1.3.296.0-Installer.exe" -OutFile VulkanSDK.exe
# ./VulkanSDK.exe --help
./VulkanSDK.exe --accept-licenses --default-answer --root D:/a/VulkanSDK --confirm-command install
- name: Retrieve submodules
shell: cmd
run: |
python -m pip install pl-build
rem git submodule update --init --recursive ./dependencies/cpython
cd ..
git clone https://github.com/PilotLightTech/pilotlight
cd pilotlight-python
- name: Build package
shell: cmd
run: |
set VULKAN_SDK=D:/a/VulkanSDK
cd %GITHUB_WORKSPACE%
cd scripts
python gen_build.py
cd ../src
build.bat -c deploy
cd ..
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine wheel setuptools
- name: Build Wheel
shell: cmd
run: |
cd %GITHUB_WORKSPACE%
python -m setup bdist_wheel --plat-name win_amd64 --dist-dir dist
- uses: actions/upload-artifact@v4
with:
name: pltools wheel
path: |
${{ github.workspace }}/dist/*.whl
${{ github.workspace }}/dist/*.tar.gz
retention-days: 1
if-no-files-found: error
- name: PyPi Deployment
shell: cmd
if: ${{contains(github.event.inputs.deploy, 'true') && github.ref == 'refs/heads/master'}}
run: |
python -m pip install twine
python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --skip-existing
- name: Test PyPi Deployment
shell: cmd
if: ${{contains(github.event.inputs.deploytest, 'true') && github.ref == 'refs/heads/master'}}
run: |
python -m pip install twine
python -m twine upload --repository testpypi dist/* -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} --skip-existing