Skip to content

Commit

Permalink
build: update the input for preview rename to preview (#13002)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenytang-ms authored Jan 2, 2025
1 parent 9ee9281 commit db74b8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/prerelease-feature-control.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
filePath=packages/vscode-extension/src/releaseBasedFeatureSettings.ts
echo "Update feature settings in $filePath if alpha or beta release"
echo "Update feature settings in $filePath if alpha or preview release"
sed -i -e "s@const shouldEnableTeamsCopilotChatUI = false@const shouldEnableTeamsCopilotChatUI = true@g" $filePath
echo "Prerelease feature setting update done."
6 changes: 3 additions & 3 deletions .github/scripts/vsc-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ echo '-----------------' $VERSION
MINOR_VER=$(echo $VERSION | awk -F. '{print $2}')
DATE_WITH_TIME=`date "+%Y%m%d%H"`
# prerelease version should set minor version to odd number, and set patch version as timestamp.
if [ "$PREID" == "beta" ]; then
if [ "$PREID" == "preview" ]; then
if [ $((MINOR_VER%2)) -eq 0 ]; then
echo "Need to bump up version with even minor version for beta"
echo "Need to bump up version with even minor version for preview"
VERSION=$(echo ${VERSION%-*} | awk -v val=$DATE_WITH_TIME -F. '/[0-9]+\./{$2++;$3=val;print}' OFS=.)
else
echo "Need to set patch version as timestamp for beta"
echo "Need to set patch version as timestamp for preview"
VERSION=$(echo ${VERSION%-*} | awk -v val=$DATE_WITH_TIME -F. '/[0-9]+\./{$3=val;print}' OFS=.)
fi
echo '=====================' $VERSION
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on:
workflow_dispatch:
inputs:
preid:
description: "preid name(alpha, beta, rc, stable)"
description: "preid name(alpha, preview, rc, stable)"
required: true
default: "rc"
default: "preview"
series:
description: "release sprint series name"
required: false
default: ""
skip-version-rc:
description: "release RC version just with lerna publish, skip run lerna version(yes or no)"
required: false
default: "no"
pkgs:
type: string
required: false
Expand Down Expand Up @@ -97,13 +93,13 @@ jobs:
run: |
npx lerna version prerelease --preid=alpha.$(git rev-parse --short HEAD) --exact --no-push --allow-branch dev --yes
- name: release beta packages to npmjs.org
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'beta' }}
- name: release preview packages to npmjs.org
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'preview' }}
run: |
npx lerna version prerelease --preid=beta.$(date "+%Y%m%d%H") --exact --no-push --allow-branch ${GITHUB_REF#refs/*/} --yes
- name: version rc npm packages to npmjs.org
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'rc' && github.event.inputs.skip-version-rc == 'no'}}
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'rc' }}
run: |
npx lerna version prerelease --conventional-prerelease --preid=rc --no-changelog --allow-branch ${GITHUB_REF#refs/*/} --yes
Expand Down Expand Up @@ -176,7 +172,7 @@ jobs:
git commit -m "build: replace sideloading placeholders"
- name: enable prerelease only features
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.preid == 'alpha' || github.event.inputs.preid == 'beta')) }}
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && (github.event.inputs.preid == 'alpha' || github.event.inputs.preid == 'preview')) }}
run: |
bash .github/scripts/prerelease-feature-control.sh
git add ./packages/vscode-extension/src/releaseBasedFeatureSettings.ts
Expand Down Expand Up @@ -237,8 +233,8 @@ jobs:
run: |
npx lerna publish from-package --dist-tag=alpha --yes --allow-branch dev
- name: publish beta release to npm org
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'beta' }}
- name: publish preview release to npm org
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.preid == 'preview' }}
run: |
npx lerna publish from-package --dist-tag=beta --yes
Expand Down Expand Up @@ -277,7 +273,7 @@ jobs:
sleep 20
npm run build
cd ./packages/vscode-extension
if [ "$PREID" == "beta" ]; then
if [ "$PREID" == "preview" ]; then
pnpm dlx vsce package --no-dependencies --pre-release
else
pnpm dlx vsce package --no-dependencies
Expand Down

0 comments on commit db74b8e

Please sign in to comment.