fix release action #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
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: ${{ needs.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: ${{ needs.release-please.outputs.release_created }} | |
needs: [release-please, 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 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
pypi-publish: | |
if: ${{ needs.release-please.outputs.release_created }} | |
needs: [release-please, 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 |