From 67b081e40fe0829186a75266b54480c0d9d3f431 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Sun, 13 Sep 2026 12:47:49 +0000 Subject: [PATCH] fix: deploy docs only on release tags so the published version is clean sphinx-build was running on every push to main, but the release tag isn't created until a later step in create-tag.yml, so setuptools_scm resolved a dev version (e.g. 0.1.2.dev0+g...) instead of the clean release version (e.g. 0.1.2). Gate the GitHub Pages deploy on the tag push instead. Also adds a docs status badge to the README. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_0126spNDGtqDKMoYtuPT7JfW --- .github/workflows/docs.yml | 9 ++++++++- CHANGELOG.md | 7 +++++++ README.md | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fe76270..7f79bea 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,8 @@ on: branches: - main - dev + tags: + - "*.*.*" paths: - "docs/**" - "src/**" @@ -60,7 +62,12 @@ jobs: path: docs/build/html deploy: - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + # Only deploy from an actual release tag: setuptools_scm only produces a + # clean version (e.g. "0.1.2") when building from the exact tagged + # commit. Building from a branch push resolves to a dev version (e.g. + # "0.1.2.dev0+g...") because the release tag doesn't exist yet at + # merge time - it's created by a later step in create-tag.yml. + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') needs: build runs-on: ubuntu-latest environment: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2aeb6..4a6adaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. ## Next Release +### Bug Fixes + +#### Documentation + +- Only deploy documentation to GitHub Pages on release tag pushes, so the published version reflects the clean release version (e.g. `0.1.2`) instead of a dev version (e.g. `0.1.2.dev0+g...`) +- Add `docs` status badge to the README + ## [0.1.2](https://github.com/repo/owner/releases/tag/0.1.2) - 2026-09-13 diff --git a/README.md b/README.md index a58f501..44e5101 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # DevOps [![pytest](https://github.com/97gamjak/devops/actions/workflows/pytest.yml/badge.svg)](https://github.com/97gamjak/devops/actions/workflows/pytest.yml) -[![codecov](https://codecov.io/gh/97gamjak/devops/graph/badge.svg?token=yqdcZCNRzK)](https://codecov.io/gh/97gamjak/devops) \ No newline at end of file +[![codecov](https://codecov.io/gh/97gamjak/devops/graph/badge.svg?token=yqdcZCNRzK)](https://codecov.io/gh/97gamjak/devops) +[![docs](https://github.com/97gamjak/devops/actions/workflows/docs.yml/badge.svg)](https://97gamjak.github.io/devops/) \ No newline at end of file