chore: sets up python-semantic-release (#7) #15
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
name: release | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
# job to determine appropriate version number, update changelog, and create a release commit | |
# release: | |
# runs-on: ubuntu-latest | |
# concurrency: release | |
# permissions: | |
# id-token: write | |
# contents: write | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - name: Python Semantic Release | |
# uses: python-semantic-release/python-semantic-release@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# job to build and inspect the package | |
dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: hynek/build-and-inspect-python-package@v1 | |
# job to publish the new version to pypi | |
publish: | |
needs: [dist] | |
environment: pypi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 |