From 2f0a040b765902616f01ba9189ad637ad3700bda Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:11:44 +0400 Subject: [PATCH] feat: add release workflow --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..75a3c36 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.13' + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.8.4 + - name: Install dependencies + run: poetry install + - name: Build + run: poetry build + + publish: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.13' + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.8.4 + - name: Publish to PyPI + run: | + poetry config repositories.remote https://upload.pypi.org/legacy/ + poetry --no-interaction -v publish --build --repository remote --username "__token__" --password "$PYPI_API_TOKEN" + env: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}