diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 64f34a91af..7b5d194ac5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,11 @@ jobs: with: fetch-depth: 0 + - name: Configure git identity + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Apply feature version bumps run: | python tools/feature_version_audit.py \ diff --git a/.releaserc.js b/.releaserc.js index fe2685b59d..ceb35d7eb7 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -1,12 +1,11 @@ -const releaseType = process.env.RELEASE_TYPE || 'rc'; +const isRC = (process.env.RELEASE_TYPE || 'rc') === 'rc'; module.exports = { - branches: [ - { - name: 'dev', - ...(releaseType === 'rc' ? { prerelease: 'rc' } : {}), - }, - ], + // RC: needs 'main' as non-prerelease anchor (semantic-release v25 requires >= 1). + // Stable: 'dev' is the release branch directly. + branches: isRC + ? ['main', { name: 'dev', prerelease: 'rc' }] + : ['dev'], plugins: [ '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', @@ -17,16 +16,9 @@ module.exports = { { files: ['CMakeLists.txt'], from: 'VERSION [0-9]+\\.[0-9]+\\.[0-9]+', - to: 'VERSION ${nextRelease.version}', - results: [ - { - file: 'CMakeLists.txt', - hasChanged: true, - numReplacements: 1, - numMatches: 1, - }, - ], - countMatches: true, + // Strip prerelease suffix so CMake gets '1.5.0' not '1.5.0-rc.1'. + // No results assertion: stable after RC is a no-op (version already set). + to: "VERSION ${nextRelease.version.split('-')[0]}", }, ], },