rheinwerk-verlag / pganonymize

A commandline tool for anonymizing PostgreSQL databases
http://pganonymize.readthedocs.io/
Other
42 stars 26 forks source link

#56: Add Trusted Publisher Management workflow #57

Closed hkage closed 7 months ago

hkage commented 8 months ago

This PR changes the "publish" workflow to work with the Trusted Publisher Management, see

Unfortunately the test pipeline still fails (which will be addressed later in #55) and the workflow can only be tested using the TestPyPI and a slightly modified workflow, e.g.:

jobs:
  publish:
    name: Upload release to TestPyPI
    runs-on: ubuntu-latest
    environment:
      name: testing
      url: https://test.pypi.org/p/pganonymize/
    permissions:
      id-token: write  # IMPORTANT: mandatory for trusted publishing
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install setuptools wheel
      - name: Build and publish
        run: python setup.py sdist bdist_wheel
      - name: Publish package distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          repository-url: https://test.pypi.org/legacy/

I tested the upload in #55 and the upload was successful: https://github.com/rheinwerk-verlag/pganonymize/actions/runs/8284252773

W1ldPo1nter commented 7 months ago

LGTM