Skip to content

Commit

Permalink
Add GitHub Actions release workflow for Trusted Publishing (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Feb 22, 2025
1 parent d637764 commit ce67526
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 129 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Create release

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"
UV_SYSTEM_PYTHON: "1" # make uv do global installs

jobs:
publish-pypi:
runs-on: ubuntu-latest
name: PyPI Release
environment: release
if: github.repository_owner == 'breathe-doc'
permissions:
id-token: write # for PyPI trusted publishing
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: latest
enable-cache: false

- name: Install build dependencies (pypa/build, twine)
run: uv pip install build "twine>=5.1"

- name: Build distribution
run: python -m build

- name: Check distribution
run: |
twine check --strict dist/*
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
12 changes: 5 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ Examples of projects that use Breathe:
Release
-------

See the ``mkrelease`` utility in the root of the repository.

Useful vim command for changelog conversion to the git tag format:

.. code:: vim
%s/\v`(#[0-9]+) \<[^`]*`__/\1/g
1. Update `CHANGELOG.rst` and create the git tag (`vX.Y.Z`).
2. Push the tag to GitHub.
3. The `create-release.yml` workflow will publish the release to PyPI.
4. Go to https://github.com/breathe-doc/breathe/tags, select the new tag,
and click the "Create release from tag" button to publish a GitHub release.

Maintainers
-----------
Expand Down
122 changes: 0 additions & 122 deletions mkrelease

This file was deleted.

0 comments on commit ce67526

Please sign in to comment.