From e1ee4e692eec1608d62328e79ed3cecd93c0bb68 Mon Sep 17 00:00:00 2001 From: Simon Jones Date: Fri, 26 Apr 2024 09:24:56 -0400 Subject: [PATCH] feat: changing publish workflow to match pypis docs --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7c7a414 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,36 @@ +name: publish +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: 3.11 + - run: | + pip install poetry + poetry version ${GITHUB_REF##*/v} + poetry build + - uses: actions/upload-artifact@v3 + with: + path: ./dist + + publish-to-pypi: + name: Upload Release to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: ['build'] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/bosco + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1