Release 1.0.0 - Space2StatsClient #10
Workflow file for this run
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: Client Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./space2stats_client | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Install dependencies | |
run: | | |
poetry install --with test | |
- name: Run tests | |
run: poetry run pytest | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./space2stats_client | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Build package | |
run: poetry build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: | | |
space2stats_client/dist/*.whl | |
space2stats_client/dist/*.tar.gz | |
publish: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/space2stats-client/ | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |