From 0b7c148f33ec642c5831b2e6390f7e188001583f Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 20:31:42 +0530 Subject: [PATCH 1/8] chore: update changeset-snapshot-publish script to accept a parameter for versioning --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 20a5d15a9c9..bd0e460bd81 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "build:ts:watch": "wireit", "build:types": "wireit", "build:watch": "wireit", - "changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot", + "changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot ${1} && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot", "changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn install && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish", "update-version": "node ./tasks/update-version.js", "chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables", From 03992b928a92c582f6b3adfe820e1621ee406e1b Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 20:51:29 +0530 Subject: [PATCH 2/8] chore: enhance beta release workflow to dynamically determine next beta version number --- .github/workflows/beta-release.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 6ea8ed5c8b4..787bd27d6fc 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -21,11 +21,36 @@ jobs: git config --global user.email "support+actions@github.com" git config --global user.name "github-actions-bot" + - name: Get current package version and latest beta number + id: version-info + run: | + CURRENT_VERSION=$(node -p "require('./package.json').version") + echo "Current version: $CURRENT_VERSION" + + # Fetch the latest beta version + LATEST_BETA=$(npm view @adobe/spectrum-web-components --tag beta version || echo "none") + echo "Latest beta: $LATEST_BETA" + + if [[ $LATEST_BETA == *beta* ]]; then + # Extract beta number + BETA_NUMBER=$(echo $LATEST_BETA | grep -oP 'beta\.\K\d+') + # Increment the beta number + NEXT_BETA_NUMBER=$((BETA_NUMBER + 1)) + else + # Start with beta.0 if no beta version exists + NEXT_BETA_NUMBER=0 + fi + + echo "Next beta number: $NEXT_BETA_NUMBER" + echo "next_beta_number=$NEXT_BETA_NUMBER" >> $GITHUB_OUTPUT + echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT + - name: Update package versions for beta release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEXT_BETA_NUMBER: ${{ steps.version-info.outputs.next_beta_number }} run: | - yarn changeset pre enter beta + yarn changeset pre enter beta.$NEXT_BETA_NUMBER # Apply the changeset with specific beta tag yarn changeset version yarn lint:versions --fix @@ -44,5 +69,5 @@ jobs: git add . git commit -am "chore: publish beta version" yarn prepublishOnly - yarn changeset publish --no-git-tag + yarn changeset publish --no-git-tag --tag beta git reset --hard HEAD^ From 15d5359cba1cc78a4e79f613165fa66ebee2de17 Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 20:54:44 +0530 Subject: [PATCH 3/8] chore: update beta release workflow to reference specific package version for button component --- .github/workflows/beta-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 787bd27d6fc..2ebe3e4535c 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -24,11 +24,11 @@ jobs: - name: Get current package version and latest beta number id: version-info run: | - CURRENT_VERSION=$(node -p "require('./package.json').version") + CURRENT_VERSION=$(node -p "require('./packages/button/package.json').version") echo "Current version: $CURRENT_VERSION" # Fetch the latest beta version - LATEST_BETA=$(npm view @adobe/spectrum-web-components --tag beta version || echo "none") + LATEST_BETA=$(npm view @spectrum-web-components/button --tag beta version || echo "none") echo "Latest beta: $LATEST_BETA" if [[ $LATEST_BETA == *beta* ]]; then From fbac9b2455f31c68694cd775aad65238f1125e7f Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 22:22:41 +0530 Subject: [PATCH 4/8] chore: update beta release workflow to reference the bundle package version instead of button --- .github/workflows/beta-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 2ebe3e4535c..01a826d10bc 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -24,11 +24,11 @@ jobs: - name: Get current package version and latest beta number id: version-info run: | - CURRENT_VERSION=$(node -p "require('./packages/button/package.json').version") + CURRENT_VERSION=$(node -p "require('./tools/bundle/package.json').version") echo "Current version: $CURRENT_VERSION" # Fetch the latest beta version - LATEST_BETA=$(npm view @spectrum-web-components/button --tag beta version || echo "none") + LATEST_BETA=$(npm view @spectrum-web-components/bundle --tag beta version || echo "none") echo "Latest beta: $LATEST_BETA" if [[ $LATEST_BETA == *beta* ]]; then From 92511b423817d74835207ca9c1fb6722900e8cb7 Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 22:32:33 +0530 Subject: [PATCH 5/8] chore: simplify beta release workflow by removing redundant current version logging --- .github/workflows/beta-release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 01a826d10bc..b69fd77e4f2 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -24,9 +24,6 @@ jobs: - name: Get current package version and latest beta number id: version-info run: | - CURRENT_VERSION=$(node -p "require('./tools/bundle/package.json').version") - echo "Current version: $CURRENT_VERSION" - # Fetch the latest beta version LATEST_BETA=$(npm view @spectrum-web-components/bundle --tag beta version || echo "none") echo "Latest beta: $LATEST_BETA" @@ -43,7 +40,6 @@ jobs: echo "Next beta number: $NEXT_BETA_NUMBER" echo "next_beta_number=$NEXT_BETA_NUMBER" >> $GITHUB_OUTPUT - echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - name: Update package versions for beta release env: From 6dba8712ed15c9a54b680c188a590bba7236d167 Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 22:33:45 +0530 Subject: [PATCH 6/8] chore: add support for additional branch in beta release workflow --- .github/workflows/beta-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index b69fd77e4f2..378eb94b369 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - pvashish/update-snapshot-script jobs: release: From a8736cdeb8bcdf23589fafe0299afcd664934459 Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 22:42:31 +0530 Subject: [PATCH 7/8] chore: add changeset pre exit step to beta release workflow --- .github/workflows/beta-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 378eb94b369..48a8c36d6a0 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -65,6 +65,7 @@ jobs: run: | git add . git commit -am "chore: publish beta version" + yarn changeset pre exit yarn prepublishOnly yarn changeset publish --no-git-tag --tag beta git reset --hard HEAD^ From 65a95348d0fe8f02f8c3f4274b8ad716717551b2 Mon Sep 17 00:00:00 2001 From: blunteshwar Date: Fri, 11 Apr 2025 22:59:09 +0530 Subject: [PATCH 8/8] chore: remove obsolete branch reference from beta release workflow --- .github/workflows/beta-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml index 48a8c36d6a0..966b05e463f 100644 --- a/.github/workflows/beta-release.yml +++ b/.github/workflows/beta-release.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - pvashish/update-snapshot-script jobs: release: