Files
remove-ai-watermarks/.github/workflows/publish.yml
T
dependabot[bot] 3bbcc0ee94 chore(deps): bump actions/checkout from 6 to 7 in the actions group (#52)
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 09:51:00 -07:00

41 lines
1.4 KiB
YAML

name: Publish to PyPI
on:
release:
types: [published]
permissions:
id-token: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
- name: Verify release tag matches package version
run: |
tag="${{ github.event.release.tag_name }}"
version="$(grep -m1 '^version = ' pyproject.toml | sed -E 's/^version = "([^"]+)"/\1/')"
if [ "${tag#v}" != "$version" ]; then
echo "Release tag '$tag' does not match pyproject.toml version '$version'" >&2
exit 1
fi
echo "Release tag '$tag' matches package version '$version'"
- name: Build package
run: uv build
# Publish with `uv publish` (its own uploader, not the twine bundled in the
# old pypa action). Trusted publishing is automatic in GitHub Actions: the
# `id-token: write` permission + the `pypi` environment supply the OIDC token,
# and PyPI's trusted-publisher entry matches on repo + workflow filename +
# environment name (all unchanged from the pypa-action setup), so no API token
# is needed. uv's uploader also accepts Metadata-Version 2.5 -- the permanent
# fix that lets the hatchling pin be relaxed (see pyproject [build-system]).
- name: Publish to PyPI
run: uv publish