Skip to content

Commit

Permalink
ci(release): switch to PyPi trusted publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed May 2, 2024
1 parent 23d96a8 commit a611645
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ jobs:
release:
name: "🚀 GitHub Release"
runs-on: ubuntu-latest
needs: [build-macos, build-python-wheel, build-ubuntu, build-windows]
needs:
- build-macos
- build-python-wheel
- build-ubuntu
- build-windows

if: startsWith(github.ref, 'refs/tags/')

Expand Down Expand Up @@ -208,14 +212,21 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
discussion_category_name: announcements
fail_on_unmatched_files: true
files: builds/**/*
generate_release_notes: true

release-pypi:
name: "🐍 Release on PyPI"
runs-on: ubuntu-latest
needs: [build-python-wheel]
needs:
- build-python-wheel
environment:
name: pypi
url: https://pypi.org/project/geotribu/
permissions:
id-token: write

if: startsWith(github.ref, 'refs/tags/')

Expand All @@ -230,12 +241,15 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: builds/wheel
print-hash: true

release-ghcr:
name: "🐳 Release as Docker container"
runs-on: ubuntu-latest
needs: [release, release-pypi]
needs:
- release
- release-pypi
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand Down

0 comments on commit a611645

Please sign in to comment.