Skip to content

Commit

Permalink
feat: release package with github action
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-mue committed Jun 22, 2024
1 parent 6cc3882 commit bcdad1d
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,65 @@ name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: python

build:
if: ${{ jobs.release-please.outputs.release_created }}
needs: release-please
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install hatch
run: pip install hatch --upgrade
- name: Build package
run: hatch build
- name: Upload dists
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

test-pypi-publish:
if: ${{ jobs.release-please.outputs.release_created }}
needs: build
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/p/geometer
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: dists
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1

pypi-publish:
if: ${{ jobs.release-please.outputs.release_created }}
needs: test-pypi-publish
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/geometer
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: dists
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit bcdad1d

Please sign in to comment.