Add photonlibpy #1
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 and Distribute PhotonLibPy | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 # CHose earliest that robotpy supports | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel | |
pip install robotpy | |
- name: Build wheel | |
working-directory: ./photon-lib/py | |
run: | | |
git fetch --tags --force | |
python setup.py sdist bdist_wheel | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: ./photon-lib/py/dist/ | |
pypi-publish: | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
environment: | |
name: pypi | |
url: https://pypi.org/p/photonlibpy | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
- name: Publish package distributions to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |