From 7bdd047279487cb0486604c7bac02b52201837af Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 18 May 2026 19:23:32 -0500 Subject: [PATCH] feat(ci): replace single release-please config with dual prerelease/stable setup Split the release-please configuration into two independent tracks: - Prerelease track (push to main): creates RC releases with auto-merge - Stable track (workflow_dispatch): creates stable releases on demand This eliminates the promote-release.yml workaround that re-tagged RC commits as stable releases. Instead, release-please natively manages both version tracks with separate configs, manifests, labels, and changelog paths. --- .../prerelease-config.json | 0 .github/release-config.json | 17 ++++ .github/workflows/promote-release.yml | 97 ------------------- ...ease.yml => release-please-prerelease.yml} | 4 +- .github/workflows/release-please-stable.yml | 29 ++++++ .release-please-manifest-stable.json | 3 + 6 files changed, 51 insertions(+), 99 deletions(-) rename release-please-config.json => .github/prerelease-config.json (100%) create mode 100644 .github/release-config.json delete mode 100644 .github/workflows/promote-release.yml rename .github/workflows/{release-please.yml => release-please-prerelease.yml} (95%) create mode 100644 .github/workflows/release-please-stable.yml create mode 100644 .release-please-manifest-stable.json diff --git a/release-please-config.json b/.github/prerelease-config.json similarity index 100% rename from release-please-config.json rename to .github/prerelease-config.json diff --git a/.github/release-config.json b/.github/release-config.json new file mode 100644 index 000000000..e4f14898c --- /dev/null +++ b/.github/release-config.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "label": "autorelease: stable", + "release-label": "autorelease: stable-tagged", + "packages": { + ".": { + "release-type": "go", + "prerelease": false, + "versioning": "default", + "bump-minor-pre-major": true, + "component": "devsy", + "changelog-path": "CHANGELOG-stable.md", + "include-component-in-tag": false, + "include-v-in-tag": true + } + } +} diff --git a/.github/workflows/promote-release.yml b/.github/workflows/promote-release.yml deleted file mode 100644 index 2d39ac2be..000000000 --- a/.github/workflows/promote-release.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Promote RC to Stable - -on: - workflow_dispatch: - inputs: - rc_tag: - description: "RC tag to promote (e.g., v1.3.0-rc.1)" - required: true - type: string - -permissions: - contents: write - actions: write - -jobs: - promote: - name: Promote RC to Stable Release - runs-on: ubuntu-latest - steps: - - uses: actions/create-github-app-token@v3 - id: app-token - with: - app-id: ${{ secrets.DEVSY_GITHUB_APP_ID }} - private-key: ${{ secrets.DEVSY_GITHUB_APP_PRIVATE_KEY }} - - - uses: actions/checkout@v6 - with: - fetch-tags: true - - - name: validate RC tag - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - RC_TAG: ${{ inputs.rc_tag }} - run: | - if ! echo "$RC_TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then - echo "::error::Invalid RC tag format: $RC_TAG (expected v*.*.*-rc.*)" - exit 1 - fi - - RELEASE=$(gh release view "$RC_TAG" --json tagName,isPrerelease 2>/dev/null || true) - if [ -z "$RELEASE" ]; then - echo "::error::Release $RC_TAG not found" - exit 1 - fi - - IS_PRERELEASE=$(echo "$RELEASE" | jq -r '.isPrerelease') - if [ "$IS_PRERELEASE" != "true" ]; then - echo "::error::Release $RC_TAG is not a prerelease" - exit 1 - fi - - echo "RC release $RC_TAG validated" - - - name: derive stable version - id: version - env: - RC_TAG: ${{ inputs.rc_tag }} - run: | - STABLE_TAG="${RC_TAG%%-rc*}" - echo "stable_tag=$STABLE_TAG" >> "$GITHUB_OUTPUT" - - COMMIT_SHA=$(git rev-list -n 1 "$RC_TAG") - echo "commit_sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT" - - echo "Stable tag: $STABLE_TAG at commit: $COMMIT_SHA" - - - name: fetch RC release notes - id: rc_notes - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - RC_TAG: ${{ inputs.rc_tag }} - run: | - BODY=$(gh release view "$RC_TAG" --json body -q .body) - BODY=$(echo "$BODY" | sed "1s/-rc\.[0-9]*//" ) - { echo "body<> "$GITHUB_OUTPUT" - - - name: create stable release - uses: softprops/action-gh-release@v3 - with: - token: ${{ steps.app-token.outputs.token }} - tag_name: ${{ steps.version.outputs.stable_tag }} - target_commitish: ${{ steps.version.outputs.commit_sha }} - name: ${{ steps.version.outputs.stable_tag }} - body: ${{ steps.rc_notes.outputs.body }} - draft: false - prerelease: false - make_latest: true - - - name: trigger full rebuild - env: - GH_TOKEN: ${{ github.token }} - STABLE_TAG: ${{ steps.version.outputs.stable_tag }} - run: | - gh workflow run release.yml \ - --field tag="$STABLE_TAG" - - echo "Triggered release.yml rebuild for $STABLE_TAG" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please-prerelease.yml similarity index 95% rename from .github/workflows/release-please.yml rename to .github/workflows/release-please-prerelease.yml index 5e83a47e3..46d4a8e15 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please-prerelease.yml @@ -1,4 +1,4 @@ -name: Release Please +name: Release Please (Prerelease) on: push: @@ -26,7 +26,7 @@ jobs: id: release with: token: ${{ steps.app-token.outputs.token }} - config-file: release-please-config.json + config-file: .github/prerelease-config.json manifest-file: .release-please-manifest.json autoMergeRequest: true diff --git a/.github/workflows/release-please-stable.yml b/.github/workflows/release-please-stable.yml new file mode 100644 index 000000000..e662d7a4b --- /dev/null +++ b/.github/workflows/release-please-stable.yml @@ -0,0 +1,29 @@ +name: Release Please (Stable) + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + name: Release Please (Stable) + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: actions/create-github-app-token@v3 + id: app-token + with: + app-id: ${{ secrets.DEVSY_GITHUB_APP_ID }} + private-key: ${{ secrets.DEVSY_GITHUB_APP_PRIVATE_KEY }} + + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ steps.app-token.outputs.token }} + config-file: .github/release-config.json + manifest-file: .release-please-manifest-stable.json diff --git a/.release-please-manifest-stable.json b/.release-please-manifest-stable.json new file mode 100644 index 000000000..96f1cd949 --- /dev/null +++ b/.release-please-manifest-stable.json @@ -0,0 +1,3 @@ +{ + ".": "1.3.0" +}