Release #10
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: Release | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
env: | |
DO_NOT_TRACK: 1 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
uv pip install --system -e '.[dev,docs]' | |
- name: Build | |
run: | | |
python3 -m build --sdist --wheel . | |
twine check --strict dist/* | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: dist/ | |
testpypi: | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/chinese-whispers | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: dist/ | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
pypi: | |
if: github.event_name == 'release' | |
environment: | |
name: pypi | |
url: https://pypi.org/p/chinese-whispers | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: testpypi | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: packages | |
path: dist/ | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |