From de1e35ebe35094665a0f292899f113d0cb563f68 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Wed, 14 Oct 2026 22:48:27 -0700 Subject: [PATCH] :construction_worker: Release v5 and v6 as separate version lines Releases 5.x from v5/ and 6.x from v6/ independently, using the shared semantic_release.yml from libhal/ci. It only reads (minor) and (patch) from commit subjects and has no (major) keyword, so the 6.x line starts when a maintainer publishes 6.0.0-alpha.1 by hand. deploy.yml deploys 5.* tags from v5/ and 6.* tags from v6/, and api.yml only builds API docs for 5.* releases. CONTRIBUTING.md now explains how releases are requested. --- .github/workflows/api.yml | 4 +++ .github/workflows/deploy.yml | 19 +++++++++++++- .github/workflows/semantic-release.yml | 36 +++++++++----------------- CONTRIBUTING.md | 14 ++++++++++ 4 files changed, 48 insertions(+), 25 deletions(-) diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 54e9734..73481b6 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -28,6 +28,10 @@ permissions: jobs: deploy_api_docs: + # Releases of other major versions (e.g. 6.0.0-alpha.1) are not v5 docs. + if: >- + github.event_name != 'release' || + startsWith(github.ref_name, '5.') runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2037c54..fc3e58b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,12 +5,29 @@ on: release: types: [published] +# The tag's major version picks the directory: 5.x.y deploys v5/, 6.x.y +# (including pre-releases such as 6.0.0-alpha.1) deploys v6/. jobs: deploy_v5: - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/5.') uses: libhal/ci/.github/workflows/package_and_upload_all.yml@5.x.y with: dir: v5 version: ${{ github.ref_name }} remote_url: https://libhal.jfrog.io/artifactory/api/conan/trunk-conan secrets: inherit + + deploy_v6: + if: startsWith(github.ref, 'refs/tags/6.') + uses: libhal/ci/.github/workflows/package_and_upload_all.yml@5.x.y + with: + version: ${{ github.ref_name }} + remote_url: https://libhal.jfrog.io/artifactory/api/conan/trunk-conan + modules_support_needed: true + coroutine_support_needed: false + dir: v6 + llvm_profile: hal/tc/llvm-23 + conan_version: 2.33.0 # first release that knows clang 23 + secrets: + conan_remote_password: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }} + conan_remote_user: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }} diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 943550f..7d9c45e 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -17,30 +17,18 @@ on: push: branches: [main] -permissions: - contents: write +# Versions are computed from the tags present when a run starts. Don't let two +# pushes compute the same version. +concurrency: + group: semantic-release + cancel-in-progress: false jobs: + # Releases v5/ and v6/ independently from (minor) and (patch) in commit + # subjects. See https://github.com/libhal/ci#semantic_releaseyml release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Version - id: version - uses: paulhatch/semantic-version@v5.4.0 - with: - bump_each_commit: true - major_pattern: "(major)" - minor_pattern: "(minor)" - bump_each_commit_patch_pattern: "(patch)" - tag_prefix: "" - debug: true - - name: Release - if: steps.version.outputs.version_type != 'none' - run: | - gh release create ${{ steps.version.outputs.version_tag }} \ - --generate-notes - env: - GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE }} + uses: libhal/ci/.github/workflows/semantic_release.yml@5.x.y + with: + lines: '[{"major": 5, "dir": "v5"}, {"major": 6, "dir": "v6"}]' + secrets: + release_token: ${{ secrets.SEMANTIC_RELEASE }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 561ff1b..f4cbee4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,6 +21,20 @@ with the phrase `.take` in it to get assigned by our github actions. small PRs such as fixing typos, fixing up documentation or removing unnecessary headers. +### :label: Releases + +Merging a PR releases a new version when its title (the squashed commit's +subject) contains a keyword: + +- `(minor)`: adds to the public API, e.g. a new type or function. +- `(patch)`: fixes a bug, or improves performance or code size. + +A PR without a keyword releases nothing. Each major version directory (`v5/`, +`v6/`) is released on its own, and only when the PR changes it. There is no +`(major)` keyword: a maintainer starts each major version by hand. See +[semantic_release.yml](https://github.com/libhal/ci#semantic_releaseyml) for +the details. + ### Code Reviews All submissions, including submissions by project members, require review. We