Skip to content

fix

fix #87

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*.*.*'
jobs:
publish-to-pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('./poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --all-extras
- name: Deploy to test-pypi
id: "publish-to-test-pypi"
run: |
poetry config repositories.test "https://test.pypi.org/legacy/"
poetry publish --skip-existing --build --repository test --username '__token__' --password ${{ secrets.TEST_PYPI_PASSWORD }}
- name: Deploy to pypi
id: "publish-to-pypi"
if: steps.publish-to-test-pypi.outcome == 'success'
run: poetry publish --skip-existing --username '__token__' --password ${{ secrets.PYPI_PASSWORD }}
- name: Store the distribution packages
uses: actions/upload-artifact@v3
if: steps.publish-to-pypi.outcome == 'success'
with:
name: python-package-distributions
path: dist/
github-release:
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'