Skip to content

update github ci

update github ci #8

name: Release package on GitHub and pypi
on:
push:
branches:
- main
# https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
# ---
# This action uses Python Semantic Release v7
# - name: Python Semantic Release
# uses: python-semantic-release/python-semantic-release@v7.34.6 # relekang/python-semantic-release@master
# with:
# github_token: ${{ secrets.GH_TOKEN }}
# repository_username: __token__
# repository_password: ${{ secrets.PyPI_TOKEN }}
- name: build package
run: |
pip install -q build
python -m build
# ---
# This action uses Python Semantic Release v8
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v8.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: MarkusPic
git_committer_email: markus.pichler@tugraz.at
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
# with:
# password: ${{ secrets.PyPI_TOKEN }}
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: MarkusPic
git_committer_email: markus.pichler@tugraz.at