From aa009b2dc7b5086b9e7a81ea2da151f1a6361a7f Mon Sep 17 00:00:00 2001 From: Harpo Date: Mon, 14 Aug 2023 09:01:55 -0700 Subject: [PATCH] Adds publish workflow (#115) --- .github/workflows/publish.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 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 00000000..56876a55 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: 🏛 Publish to PyPi +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + build: + name: 📦 Build package + runs-on: ubuntu-latest + steps: + - name: 📰 Checkout + uses: actions/checkout@v3 + + - name: 📲 Setup PDM + uses: pdm-project/setup-pdm@v3 + id: setup-python + with: + python-version: 3.x + + - name: 🚚 Install dependencies + run: pdm install --prod + + - name: 🏗️ Build package + run: pdm build + + - name: 🛫 Export build files + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + + publish: + name: 🗞 Publish package + needs: build + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - name: 🛬 Download artifacts + uses: actions/download-artifact@v3 + + - name: 🗞 Publish package + uses: pypa/gh-action-pypi-publish@release/v1