Release #1
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: Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
strategy: | |
matrix: | |
python-version: [3.10] # single version deployment | |
runs-on: ["ubuntu-latest"] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Dynamic versioning | |
run: poetry self add "poetry-dynamic-versioning[plugin]" | |
- name: Enable dynamic versioning | |
run: poetry dynamic-versioning enable | |
- name: Set up cache | |
uses: actions/cache@v4 | |
id: cached-poetry-dependencies | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: venv-${{ runner.os }}-${{ matrix.python-version }}- | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction | |
- name: Check poetry | |
run: | | |
poetry check | |
- name: Build | |
run: | | |
poetry build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ github.sha }} | |
path: dist/ | |
- name: Show | |
run: ls -l dist/ | |
- name: Publish | |
run: | | |
poetry publish -u "__token__" -p ${{ secrets.PYPI_API_TOKEN }} | |
upload-packages: | |
runs-on: ["ubuntu-latest"] | |
permissions: write-all | |
needs: release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-${{ github.sha }} | |
path: dist/ | |
- name: Upload to release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' | |
with: | |
files: dist/* |