Skip to content

Release

Release #9

Workflow file for this run

---
name: Release
on:
release:
types:
- published
workflow_dispatch:
jobs:
dist:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up uv
if: github.event_name == 'workflow_dispatch'
uses: astral-sh/setup-uv@v7
with:
python-version: 3.14
- name: Set build version for TestPyPI
if: github.event_name == 'workflow_dispatch'
run: |-
uv sync --only-dev
VERSION=$(uv run hatchling version | cut -d+ -f1)
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION" >> "$GITHUB_ENV"
- uses: hynek/build-and-inspect-python-package@v2
publish-pypi:
if: github.event_name == 'release' && github.event.action == 'published'
needs: dist
runs-on: ubuntu-latest
environment:
name: publish
url: https://pypi.org/project/glass
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v7
with:
name: Packages
path: dist
- name: List distributions to be deployed
run: ls -l dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
publish-test-pypi:
if: github.event_name == 'workflow_dispatch'
needs: dist
runs-on: ubuntu-latest
environment:
name: test-publish
url: https://test.pypi.org/project/glass
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v7
with:
name: Packages
path: dist
- name: List distributions to be deployed
run: ls -l dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true