Deploy #3
This file contains hidden or 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: 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: Retrieve submodules | |
| shell: cmd | |
| run: | | |
| python -m pip install pl-build | |
| git submodule update --init --recursive ./dependencies/cpython | |
| cd .. | |
| git clone https://github.com/PilotLightTech/pilotlight | |
| - name: Build package | |
| shell: cmd | |
| run: | | |
| cd %GITHUB_WORKSPACE% | |
| cd scripts | |
| python gen_build.py | |
| cd ../src | |
| build.bat -c release | |
| cd ../scripts | |
| python package.py | |
| 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 |