From ea855e876c9406c0c919c89dcba059ef4c2a55dd Mon Sep 17 00:00:00 2001 From: Etty Date: Mon, 20 May 2024 18:47:03 +0100 Subject: [PATCH] Add workflow to Release on PyPI --- .github/workflows/deploy.yaml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..eacae60 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,45 @@ +name: Publish to PyPI + +on: + push: + branches: + - main + +permissions: + id-token: write + contents: read + +jobs: + publish-library: + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/italia + + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - uses: pdm-project/setup-pdm@v4 + name: Setup Python and PDM + with: + python-version: "3.12" + cache: true + + - name: Install dependencies + run: | + pdm install + + - name: Ensure lock file is up to date + run: | + pdm lock --check + + - name: Install dependencies + run: | + pdm sync -d + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1