Skip to content

Publish Release

Publish Release #19

Workflow file for this run

name: Publish Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- shell: bash
env:
REPO_PASS: ${{ secrets.PYPI }}
VERSION_TAG: ${{ github.event.release.tag_name }}
BRANCH: ${{ github.event.release.target_commitish }}
run: |
VERSION=$(echo "${VERSION_TAG}" | cut -c2-) make install build
# Setup git
# https://api.github.com/users/github-actions%5Bbot%5D
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Commit and push updated release files
git checkout -b "${BRANCH}"
git add .
git commit -m "Update release version to ${VERSION_TAG}"
git push origin "${BRANCH}"
git tag --force "${VERSION_TAG}"
git push --force origin "${VERSION_TAG}"
- name: upload dists
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
pypi-publish:
runs-on: ubuntu-latest
needs:
- build
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1