Skip to content

0.8.6-rc.1

0.8.6-rc.1 #49

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-rc.*'
jobs:
Pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
concurrency: publish
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
# Checkout the tag that triggered the workflow
with:
ref: ${{ github.ref }}
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Build package
run: |
python -m build
- name: Publish package distributions to PyPI
# Only run if the tag is a release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'rc')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package to Test PyPI
# Only run if the tag is a release candidate
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'rc')
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Create draft release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create --draft --generate-notes --title ${{ env.TAG_NAME }} --verify-tag ${{ env.TAG_NAME }} ./dist/**