Skip to content

Commit

Permalink
chore: add release-please to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
codito authored Oct 12, 2024
1 parent 0dfe693 commit 76cd598
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: publish

on: push

# Required by release-please
permissions:
contents: write
pull-requests: write

jobs:
build:
name: build 📦
Expand All @@ -23,12 +28,23 @@ jobs:
with:
name: python-package-distributions
path: dist/


# creates a release PR as appropriate, or if a release PR is merged
# creates a tag and gh release
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python

publish-to-pypi:
name: push pypi
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
needs: [build, release-please]
runs-on: ubuntu-latest
environment:
name: pypi
Expand Down Expand Up @@ -67,14 +83,6 @@ jobs:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down

0 comments on commit 76cd598

Please sign in to comment.