diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6128480..ff06d6e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: CI +name: Tests on: push: @@ -7,8 +7,7 @@ on: # manually triggered jobs: - build: - + test: runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..a800afd --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,48 @@ +name: Publish Python distribution to PyPI + +on: + release: + types: [published] + +jobs: + build-distribution: + name: Build distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish Python distribution to PyPI + needs: + - build-distribution + runs-on: ubuntu-latest + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + 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