From 795163dd4ffbecbd75422702925c8c8643a2b7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Tue, 23 Jul 2024 07:48:54 +0200 Subject: [PATCH] Add release workflow to publish to PyPI --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..28310b4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +--- +name: release to PyPI + +on: + push: + +jobs: + pypi-publish: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install dependencies & build wheel + run: | + pipx install poetry + poetry install + poetry build + + - name: Check the wheel + run: | + pipx install twine + twine check dist/pytest_container-*whl + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: startsWith(github.ref, 'refs/tags')