From 81a0e09bf56d44cbe54552c623102b414ac3cc4d Mon Sep 17 00:00:00 2001 From: Luke Carrier Date: Sat, 9 Nov 2024 21:53:32 +0000 Subject: [PATCH] Release workflow --- .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..049f222 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + release: + types: [published] + +jobs: + publish: + timeout-minutes: 10 + + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + # Counterintuitively, we need to install Poetry before Python, because we source the Python + # version from pyproject.toml. The runner's default version of Python should be okay here. + - name: Install Poetry + run: pipx install poetry + + - name: Install Python + uses: actions/setup-python@v5 + with: + cache: poetry + python-version: "${{ matrix.python }}" + + - name: Install dependencies + run: poetry install --with dev + + - name: Publish + run: | + poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}" + poetry publish --build