From 423fc88fd8d36cb2379c03379f96b09d75ef521f Mon Sep 17 00:00:00 2001 From: Michael Hayes Date: Thu, 29 Oct 2026 14:48:45 -0700 Subject: [PATCH] Implement security fixes --- .github/workflows/release.yml | 53 ++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1ca8c8..65714fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,29 +3,56 @@ name: Release on: push: tags: - - "*" + - "v[0-9]*.[0-9]*.[0-9]*" + +permissions: {} jobs: - release: - name: release + build: + name: Build distributions runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false - name: Set up Python 3.x - uses: actions/setup-python@v2 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: "3.x" - name: Install release dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine build + python -m pip install setuptools wheel build - - name: Build and publish package - env: - TWINE_USERNAME: ${{ secrets.PYPI_USER }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python -m build - twine upload dist/* + - name: Build package + run: python -m build + + - name: Upload distributions + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + with: + name: python-distributions + path: dist/* + if-no-files-found: error + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/planetary-computer/ + permissions: + id-token: write + steps: + - name: Download distributions + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 + with: + name: python-distributions + path: dist + + - name: Publish package + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1