This document describes the release process for the get-cmake action after a new CMake or Ninja version has been merged to the main branch.
The get-cmake action uses two key reference points for users:
latestbranch - Points to the most recent stable release- Version tags (e.g.,
vX.Y.Z) - Allow users to pin to specific versions
When a new CMake version is detected and merged to main via automated PR, a release is performed automatically (or can be done manually) to make it available to users.
The auto-release.yml workflow automatically handles releases when automated CMake version PRs are merged:
- When a PR with title matching
[Automated] Adding cmake-vX.Y.Zis merged to main - The workflow automatically:
- Reads the version from
.latest_cmake_version - Updates the
latestbranch to matchmain - Creates and pushes the version tag (if it doesn't exist)
- Reads the version from
No manual action needed - the release happens automatically!
If you need to manually trigger a release or override the automatic process:
- Go to the Actions tab in GitHub
- Select "Sync latest branch and create release tag" workflow
- Click "Run workflow"
- Enter the tag name (e.g.,
v4.2.3) - Click "Run workflow" button
The workflow will:
- Validate the tag name format
- Update the
latestbranch to matchmain - Create and push the specified version tag
If you prefer to do this manually via command line:
# 1. Ensure you're on the main branch and up to date
git checkout main
git pull origin main
# 2. Get the current commit SHA
MAIN_SHA=$(git rev-parse HEAD)
echo "Main is at: $MAIN_SHA"
# 3. Read the version from the version file
CMAKE_VERSION=$(cat .latest_cmake_version)
echo "CMake version: $CMAKE_VERSION"
# 4. Update the latest branch to point to main
git push origin HEAD:refs/heads/latest --force
# 5. Create and push the version tag
git tag -a "v${CMAKE_VERSION}" -m "Release v${CMAKE_VERSION}"
git push origin "v${CMAKE_VERSION}"After the release process:
-
Verify the latest branch:
git fetch origin git log origin/latest --oneline -1 git log origin/main --oneline -1 # These should show the same commit -
Verify the tag was created:
git ls-remote --tags origin | grep "vX.Y.Z"
-
Test the action: Create a test workflow using:
- uses: lukka/get-cmake@latest - uses: lukka/get-cmake@vX.Y.Z # Replace with actual version
After the release:
- Users using
@latest: Will automatically get the new CMake version - Users using
@vX.Y.Z: Can pin to specific versions - Users using older tags: Will continue to use their pinned version
The build-test-tmpl.yml workflow:
- Runs
npm run generate-catalogto query GitHub for new CMake/Ninja releases - Compares with
.latest_cmake_versionand.latestrc_cmake_version - If new versions found, creates an automated PR to main
- When the PR is merged, the
auto-release.ymlworkflow automatically creates the release
For manual releases or verification:
- Verify the PR with new CMake version was merged to
main - Check the version in
.latest_cmake_versionon main branch - Verify
latestbranch points to same commit asmain - Verify the version tag was created
- Test the action using
@latestreference - Update any release notes or announcements if needed
Problem: Tag already exists
- Solution: The auto-release workflow will skip tag creation but still sync the latest branch. For manual workflow, check if release was already done. If tag is incorrect, delete it first:
git push origin :refs/tags/vX.Y.Z git tag -d vX.Y.Z
Problem: Latest branch won't update
- Solution: Ensure you have write permissions to the repository. Check workflow logs in GitHub Actions.
Problem: Users not getting new version with @latest
- Solution: GitHub may cache action references. Users can try clearing cache or using a specific tag. Verify the latest branch is actually updated.
Problem: Auto-release workflow didn't trigger
- Solution: Check that the PR title matches the pattern
[Automated] Adding cmake-vX.Y.Z. If needed, use the manual workflow as a fallback.