From 640a8e27f517a5f3b771e5076970a5d7faaa13de Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Fri, 18 Aug 2023 17:49:43 -0500 Subject: [PATCH 1/2] Add pypi trusted publishing --- ...{publish-to-test-pypi.yml => publish-to-pypi.yml} | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) rename .github/workflows/{publish-to-test-pypi.yml => publish-to-pypi.yml} (90%) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-pypi.yml similarity index 90% rename from .github/workflows/publish-to-test-pypi.yml rename to .github/workflows/publish-to-pypi.yml index f50a6f7..9a27589 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -14,6 +14,10 @@ on: branches: - '**' +permissions: + contents: read + id-token: write + jobs: build-n-publish: name: Build and publish Python distributions to PyPI @@ -23,18 +27,22 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + - run: | git fetch origin +refs/tags/*:refs/tags/* + - name: Set up Python 3.7 uses: actions/setup-python@v4 with: python-version: 3.7 + - name: Install pep517 run: >- python -m pip install pep517 --user + - name: Build a binary wheel and a source tarball run: >- python -m @@ -42,8 +50,10 @@ jobs: --binary --out-dir dist/ . + - name: Publish distribution to PyPI if: startsWith(github.event.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.pypi_password }} + packages-dir: dist/ + skip-existing: true From 9df1fc454a3ee216b1dacdac3af53ed189048d5d Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Fri, 18 Aug 2023 18:21:39 -0500 Subject: [PATCH 2/2] Update to 20.04 (18.04 not available now) and python 3.8, as the new minimum version we use --- .github/workflows/publish-to-pypi.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 9a27589..e4bb1df 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -21,7 +21,7 @@ permissions: jobs: build-n-publish: name: Build and publish Python distributions to PyPI - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -31,10 +31,10 @@ jobs: - run: | git fetch origin +refs/tags/*:refs/tags/* - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 - name: Install pep517 run: >-