build: rebuild client using latest templates #4
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: Test and deploy to TestPyPI | generated-client branch | |
on: | |
push: | |
branches: | |
- generated-client | |
jobs: | |
pytest: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- python-version: '3.11' | |
tox: py311 | |
poetry-version: [ "1.8.2" ] | |
os: [ ubuntu-22.04, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
name: Python ${{ matrix.config.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Install Python ${{ matrix.config.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.config.python-version }} | |
cache: 'poetry' | |
- name: Install packages | |
run: poetry install --no-root | |
- name: Load cached tox | |
uses: actions/cache@v3 | |
with: | |
path: .tox | |
key: tox-${{ matrix.os }}-poetry-${{ matrix.poetry-version }}-python-${{ matrix.config.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Setup API Key | |
env: | |
ORS_API_KEY: ${{ secrets.ORS_API_KEY }} | |
run: printf "[ORS]\napiKey = $ORS_API_KEY\n" > tests-config.ini | |
- name: Run tox | |
run: | | |
poetry run tox -e pytest-${{ matrix.config.tox }} | |
build-and-publish: | |
name: Build and publish Python distributions 📦 to TestPyPI | |
runs-on: ubuntu-20.04 | |
needs: pytest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Install Python ${{ matrix.config.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.config.python-version }} | |
cache: 'poetry' | |
- name: Publish distribution 📦 with test.pypi.org | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
poetry config repositories.testpypi https://test.pypi.org/legacy/ | |
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} | |
poetry build | |
poetry publish -r testpypi |