From 6904d8e089bd5b4e461e3af82276c4da8c124d72 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Mon, 20 Oct 2025 13:44:23 -0400 Subject: [PATCH 1/4] feat(release): combine minor and patch workflows to a single action --- .github/workflows/release-base.yml | 27 +++-- .github/workflows/release-canary.yml | 55 ----------- .github/workflows/release-patch.yml | 35 ------- .github/workflows/release-preminor.yml | 11 --- .github/workflows/release-scheduled.yml | 11 --- .../{release-minor.yml => release-start.yml} | 24 +++-- .github/workflows/release-v1.yml | 89 ----------------- .github/workflows/release.yml | 99 ------------------- 8 files changed, 32 insertions(+), 319 deletions(-) delete mode 100644 .github/workflows/release-canary.yml delete mode 100644 .github/workflows/release-patch.yml delete mode 100644 .github/workflows/release-preminor.yml delete mode 100644 .github/workflows/release-scheduled.yml rename .github/workflows/{release-minor.yml => release-start.yml} (57%) delete mode 100644 .github/workflows/release-v1.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-base.yml b/.github/workflows/release-base.yml index 65b5235a730..125fe8036ae 100644 --- a/.github/workflows/release-base.yml +++ b/.github/workflows/release-base.yml @@ -10,9 +10,9 @@ on: workflow_call: inputs: type: - required: true type: string - default: first minor rc + semver-type: + type: string dry-run: required: true description: 'Run dry run?' @@ -116,27 +116,36 @@ jobs: fi - name: Publish full minor release (ie. v1.x.0) - if: github.event.inputs.type == 'full minor release' + if: | + github.event.inputs.type == 'full minor release' && + github.event.inputs.semver-type == 'minor' run: | yarn lerna publish minor --conventional-graduate $(echo "${{ env.PUBLISH }}") - name: Publish first minor RC (ie. v1.x.0-rc.0) - if: github.event.inputs.type == 'first minor rc' + if: | + github.event.inputs.type == 'first minor rc' && + github.event.inputs.semver-type == 'minor' run: | yarn lerna publish preminor --conventional-prerelease --preid rc --pre-dist-tag next $(echo "${{ env.PUBLISH }}") - name: Publish full patch release (ie. v1.0.x) - if: github.event.inputs.type == 'full patch release' + if: | + github.event.inputs.type == 'full patch release' && + github.event.inputs.semver-type == 'patch' run: | yarn lerna publish patch --conventional-graduate $(echo "${{ env.PUBLISH }}") - name: Publish first patch RC (ie. v1.0.x-rc.0) - if: github.event.inputs.type == 'first patch rc' + if: | + github.event.inputs.type == 'first patch rc' && + github.event.inputs.semver-type == 'patch' run: | yarn lerna publish prepatch --conventional-prerelease --preid rc --pre-dist-tag next $(echo "${{ env.PUBLISH }}") - name: Publish subsequent RC (ie. v1.0.0-rc.x) - if: github.event.inputs.type == 'subsequent rc' + if: | + github.event.inputs.type == 'subsequent rc' run: | yarn lerna publish --conventional-prerelease --preid rc --pre-dist-tag next $(echo "${{ env.PUBLISH }}") @@ -151,9 +160,7 @@ jobs: # After successfully publishing a full release, trigger the production storybook environment deployment workflow. # Pass in the release branch name to the storybook deployment job so it build off the release branch - name: Dispatch production storybook deployment workflow - if: - ${{ (github.event.inputs.type == 'full minor release') || - (github.event.inputs.type == 'full patch release') }} + if: github.event.inputs.type == 'full release' uses: peter-evans/repository-dispatch@v4 with: event-type: deploy-latest-storybook diff --git a/.github/workflows/release-canary.yml b/.github/workflows/release-canary.yml deleted file mode 100644 index 5795b042aa1..00000000000 --- a/.github/workflows/release-canary.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Publish canary release to NPM -name: Release - canary - -# This workflow is triggered every time a change is pushed to the -# `main` branch -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - release-canary: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - timeout-minutes: 60 - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: '0' - # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - - run: | - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git config user.name $GITHUB_ACTOR - - - name: Setup Node.js - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 - with: - node-version: '22.x' - registry-url: https://registry.npmjs.org - cache: 'yarn' - - - name: Install dependencies - run: yarn install - - - name: Continuous integration check (includes build) - run: yarn ci-check - - - name: Set NPM token - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.CARBON_BOT_NPM_TOKEN }}" >> .npmrc - - # Publish release with canary tag to NPM using Lerna - - name: Publish canary release of packages - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }} - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - NPM_CONFIG_PROVENANCE: true - run: | - yarn lerna publish --canary --preid canary --dist-tag canary --yes \ No newline at end of file diff --git a/.github/workflows/release-patch.yml b/.github/workflows/release-patch.yml deleted file mode 100644 index 553b530b4ff..00000000000 --- a/.github/workflows/release-patch.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Publish patch releases, both rc (release candidates) and full releases -name: Release - patch -run-name: - ${{ inputs.type }} - dry-run:${{ inputs.dry-run }} - -on: - workflow_dispatch: - inputs: - type: - required: true - description: 'Specify the type of release' - type: choice - default: first minor rc - # Full patch release (ie. v2.0.0 -> v2.0.1) - # First patch RC (ie. v2.0.0 -> v2.0.1-rc.0) - # Subsequent RC (ie v2.0.1-rc.0 -> v2.0.1-rc.1) - options: - - full patch release - - first patch rc - - subsequent rc - dry-run: - # Check dry run to test run lerna and confirm package version bumps - required: true - description: 'Run dry run?' - type: boolean - default: true - -jobs: - Release: - # trigger the input data to the `release-base` workflow and trigger it - uses: ./.github/workflows/release-base.yml - with: - type: ${{ inputs.type }} - dry-run: ${{ inputs.dry-run }} - secrets: inherit diff --git a/.github/workflows/release-preminor.yml b/.github/workflows/release-preminor.yml deleted file mode 100644 index 67249eaa590..00000000000 --- a/.github/workflows/release-preminor.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: v2 prerelease # Builds and releases @carbon/v11 supported version of @carbon/ibm-products - -on: - workflow_dispatch: - -jobs: - Release: - uses: ./.github/workflows/release.yml - with: - release-type: '--canary preminor' - secrets: inherit diff --git a/.github/workflows/release-scheduled.yml b/.github/workflows/release-scheduled.yml deleted file mode 100644 index b16ea7d0fa2..00000000000 --- a/.github/workflows/release-scheduled.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: v2 release # Builds and releases @carbon/v11 supported version of @carbon/ibm-products - -on: - workflow_dispatch: - # schedule: - # - cron: '30 4 * * TUE' # Release every Tuesday at 4:30am EST - -jobs: - Release: - uses: ./.github/workflows/release.yml - secrets: inherit diff --git a/.github/workflows/release-minor.yml b/.github/workflows/release-start.yml similarity index 57% rename from .github/workflows/release-minor.yml rename to .github/workflows/release-start.yml index 5bf1a55e9d5..751c2c7e402 100644 --- a/.github/workflows/release-minor.yml +++ b/.github/workflows/release-start.yml @@ -1,22 +1,28 @@ -# Publish minor releases, both rc (release candidates) and full releases -name: Release - minor +# Publish minor or patch releases, both rc (release candidates) and full stable releases +name: Release start - minor / patch run-name: ${{ inputs.type }} - dry-run:${{ inputs.dry-run }} on: workflow_dispatch: inputs: - type: + semver-type: required: true - description: 'Specify the type of release' + description: 'Specify the type of semver release' + type: choice + default: minor + options: + - minor + - patch + type: + description: 'Specify the type of release (stable, preview, etc.)' type: choice - default: first minor rc - # Full minor release (ie. v2.0.0 -> v2.1.0) - # First minor RC (ie. v2.0.0 -> v2.1.0-rc.0) + # Full release (ie. v2.0.0 -> v2.1.0) + # First RC (ie. v2.0.0 -> v2.1.0-rc.0) # Subsequent RC (ie v2.1.0-rc.0 -> v2.1.0-rc.1) options: - - full minor release - - first minor rc + - full release + - first rc - subsequent rc dry-run: # Check dry run to test run lerna and confirm package version bumps diff --git a/.github/workflows/release-v1.yml b/.github/workflows/release-v1.yml deleted file mode 100644 index e91c1166532..00000000000 --- a/.github/workflows/release-v1.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: v1 release # Builds and releases @carbon/v10 supported version of @carbon/ibm-products - -on: - workflow_dispatch: - -jobs: - Release_v1: - runs-on: ubuntu-latest - # Recommended by npm for publishing with provenance https://docs.npmjs.com/generating-provenance-statements - permissions: - id-token: write - contents: write - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 0 # https://github.com/actions/checkout/issues/217 - token: ${{ secrets.GH_TOKEN_LERNA }} # https://github.com/lerna/lerna/issues/1957 - ref: 'v1' - - # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - - run: | - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git config user.name $GITHUB_ACTOR - - - name: Setup Node.js - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 - with: - node-version: '20.x' - registry-url: https://registry.npmjs.org - cache: yarn - - - name: Install - run: yarn - - - name: Continuous integration check (includes build) - run: yarn ci-check - - # Dry run - `yarn lerna version --no-git-tag-version --no-push` - - name: Publish - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }} - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - run: - yarn lerna publish --dist-tag v1-latest --conventional-commits - --create-release github --yes - - - name: Correct security dist-tag - env: - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - run: - bash .github/scripts/release-disttag-update.sh packages/security - @carbon/ibm-security - - - name: Correct CDAI dist-tag - env: - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - run: - bash .github/scripts/release-disttag-update.sh packages/cdai - @carbon/ibm-cloud-cognitive-cdai - - - name: Rename to ibm-cloud-cognitive for legacy publish - run: - yarn json -I -f packages/ibm-products/package.json -e - 'this.name="@carbon/ibm-cloud-cognitive"' - - - name: Update telemetry.yml project ID for legacy publish - run: - sed -i -e - s/495342db-5046-4ecf-85ea-9ffceb6f8cdf/9255f6e1-1b25-4ef4-8913-062ef88935c9/ - packages/ibm-products/telemetry.yml - - # Run yarn again after renaming package, required after move to yarn berry - - name: Install after rename - run: yarn - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false - - - name: Commit for legacy package - run: | - git add . - git commit -m "chore: rename package for simultaneous publish" - - - name: Publish with old name - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }} - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - run: yarn lerna publish from-package --dist-tag v1-latest --yes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 4e93f3ab3c6..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: v2 release inner # Builds and releases @carbon/v11 supported version of @carbon/ibm-products - -on: - workflow_call: - inputs: - release-type: - default: '' - type: string - -jobs: - Release: - runs-on: ubuntu-latest - # Recommended by npm for publishing with provenance https://docs.npmjs.com/generating-provenance-statements - permissions: - id-token: write - contents: write - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 0 # https://github.com/actions/checkout/issues/217 - token: ${{ secrets.GH_TOKEN_LERNA }} # https://github.com/lerna/lerna/issues/1957 - ref: 'main' - - # https://github.com/actions/checkout#push-a-commit-using-the-built-in-token - - run: | - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - git config user.name $GITHUB_ACTOR - - - name: Setup Node.js - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 - with: - node-version: '20.x' - registry-url: https://registry.npmjs.org - cache: yarn - - - name: Install - run: yarn - - - name: - Run @ibm/telemetry-js-config-generator to regenerate telemetry config - file - working-directory: ./packages/ibm-products - run: | - yarn telemetry-config - - # This can be removed once @ibm/telemetry-js-config-generator has params to set the js scope - - name: Add js scope to telemetry config - working-directory: ./packages/ibm-products - run: | - echo " js: - functions: {} - tokens: null" >> telemetry.yml - if [ -z "$(git status --porcelain)" ]; then - echo "Mirror is clean, exiting..." - else - git add telemetry.yml - git commit -m "chore(telemetry): update telemetry config" - git push origin - fi - - # For generating playwright json report for avt tests - - name: Install browsers - run: yarn playwright install --with-deps - - - name: Run storybook - id: storybook - run: | - npx serve -l 3000 packages/ibm-products/storybook-static & - pid=$! - echo "pid=$pid" >> $GITHUB_OUTPUT - - uses: ./actions/wait-for-it - with: - URL: 'http://localhost:3000' - timeout-minutes: 3 - - name: Run AVT - if: github.repository == 'carbon-design-system/ibm-products' - run: yarn avt - - name: Stop storybook - run: kill ${{ steps.storybook.outputs.pid }} - - name: Upload test results - if: always() - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: playwright-avt-report - path: .playwright - - - name: Continuous integration check (includes build) - run: yarn ci-check - - # Dry run - `yarn lerna publish --dist-tag next --no-verify-access --create-release github --yes --no-push --no-git-tag-version` - - name: Publish - env: - GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }} - NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }} - run: - yarn lerna publish ${{ inputs.release-type }} --no-verify-access - --create-release github --yes From 228b45382cf31eee0106279217e6a5d5451c2a19 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Mon, 20 Oct 2025 13:47:21 -0400 Subject: [PATCH 2/4] refactor(release): use updated release type values --- .github/workflows/release-base.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-base.yml b/.github/workflows/release-base.yml index 125fe8036ae..cb5ec04dedd 100644 --- a/.github/workflows/release-base.yml +++ b/.github/workflows/release-base.yml @@ -117,28 +117,28 @@ jobs: - name: Publish full minor release (ie. v1.x.0) if: | - github.event.inputs.type == 'full minor release' && + github.event.inputs.type == 'full release' && github.event.inputs.semver-type == 'minor' run: | yarn lerna publish minor --conventional-graduate $(echo "${{ env.PUBLISH }}") - name: Publish first minor RC (ie. v1.x.0-rc.0) if: | - github.event.inputs.type == 'first minor rc' && + github.event.inputs.type == 'first rc' && github.event.inputs.semver-type == 'minor' run: | yarn lerna publish preminor --conventional-prerelease --preid rc --pre-dist-tag next $(echo "${{ env.PUBLISH }}") - name: Publish full patch release (ie. v1.0.x) if: | - github.event.inputs.type == 'full patch release' && + github.event.inputs.type == 'full release' && github.event.inputs.semver-type == 'patch' run: | yarn lerna publish patch --conventional-graduate $(echo "${{ env.PUBLISH }}") - name: Publish first patch RC (ie. v1.0.x-rc.0) if: | - github.event.inputs.type == 'first patch rc' && + github.event.inputs.type == 'first rc' && github.event.inputs.semver-type == 'patch' run: | yarn lerna publish prepatch --conventional-prerelease --preid rc --pre-dist-tag next $(echo "${{ env.PUBLISH }}") From f49ba591bbdcfe6e952d3bf986b17a98b757fae3 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Tue, 21 Oct 2025 11:17:10 -0400 Subject: [PATCH 3/4] fix(release): pass semver-type from start to base workflow --- .github/workflows/release-base.yml | 12 ++++++++---- .github/workflows/release-start.yml | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-base.yml b/.github/workflows/release-base.yml index cb5ec04dedd..669946e7452 100644 --- a/.github/workflows/release-base.yml +++ b/.github/workflows/release-base.yml @@ -9,15 +9,19 @@ concurrency: on: workflow_call: inputs: - type: - type: string semver-type: type: string - dry-run: + default: minor required: true - description: 'Run dry run?' + type: + type: string + default: first rc + required: true + dry-run: type: boolean default: true + required: true + description: 'Run dry run?' jobs: release: diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml index 751c2c7e402..6ac4512032a 100644 --- a/.github/workflows/release-start.yml +++ b/.github/workflows/release-start.yml @@ -7,8 +7,8 @@ on: workflow_dispatch: inputs: semver-type: - required: true description: 'Specify the type of semver release' + required: true type: choice default: minor options: @@ -16,7 +16,9 @@ on: - patch type: description: 'Specify the type of release (stable, preview, etc.)' + required: true type: choice + default: first rc # Full release (ie. v2.0.0 -> v2.1.0) # First RC (ie. v2.0.0 -> v2.1.0-rc.0) # Subsequent RC (ie v2.1.0-rc.0 -> v2.1.0-rc.1) @@ -36,6 +38,7 @@ jobs: # trigger the input data to the `release-base` workflow and trigger it uses: ./.github/workflows/release-base.yml with: + semver-type: ${{ inputs.type }} type: ${{ inputs.type }} dry-run: ${{ inputs.dry-run }} secrets: inherit From 6bca135f2158481e2b7d6e92fba81380a0f7cb32 Mon Sep 17 00:00:00 2001 From: Matt Gallo Date: Wed, 22 Oct 2025 13:18:40 -0400 Subject: [PATCH 4/4] fix(release): typo, pass correct input --- .github/workflows/release-start.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml index 6ac4512032a..13f85eeb358 100644 --- a/.github/workflows/release-start.yml +++ b/.github/workflows/release-start.yml @@ -38,7 +38,7 @@ jobs: # trigger the input data to the `release-base` workflow and trigger it uses: ./.github/workflows/release-base.yml with: - semver-type: ${{ inputs.type }} + semver-type: ${{ inputs.semver-type }} type: ${{ inputs.type }} dry-run: ${{ inputs.dry-run }} secrets: inherit