Skip to content

feat: release package with github action #6

feat: release package with github action

feat: release package with github action #6

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: ${{ jobs.release-please.outputs.release_created }}

Check failure on line 23 in .github/workflows/release-please.yaml

View workflow run for this annotation

GitHub Actions / release-please

Invalid workflow file

The workflow is not valid. .github/workflows/release-please.yaml (Line: 23, Col: 9): Unrecognized named-value: 'jobs'. Located at position 1 within expression: jobs.release-please.outputs.release_created .github/workflows/release-please.yaml (Line: 43, Col: 9): Unrecognized named-value: 'jobs'. Located at position 1 within expression: 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