New Release Branch (bot run 2384396755-0) #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New Release Branch | |
on: | |
workflow_dispatch: | |
inputs: | |
branch_name: | |
description: Release branch name to create | |
required: true | |
type: string | |
package_version: | |
description: Release package version | |
required: true | |
type: string | |
core_major_minor: | |
description: Release core major.minor version | |
required: true | |
type: string | |
# Inputs provided by the bot | |
distinct_id: | |
description: '(bot) A distinct ID' | |
required: false | |
default: '' | |
source_issue: | |
description: '(bot) The issue that triggered this workflow' | |
required: false | |
default: '' | |
requesting_user: | |
description: '(bot) The user who requested this workflow' | |
required: false | |
default: '' | |
status_comment: | |
description: '(bot) The comment to update with the status of this workflow' | |
required: false | |
default: '' | |
run-name: ${{ github.workflow }}${{ inputs.distinct_id && format(' (bot run {0})', inputs.distinct_id) || '' }} | |
permissions: | |
contents: read | |
# Ensure scripts are run with pipefail. See: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
with: | |
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. | |
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} | |
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | |
with: | |
node-version: 'lts/*' | |
- run: | | |
npm --version | |
# corepack enable npm | |
npm install -g $(jq -r '.packageManager' < package.json) | |
npm --version | |
- run: | | |
git checkout -b ${{ inputs.branch_name }} | |
sed -i -e 's/"version": ".*"/"version": "${{ inputs.package_version }}"/g' package.json | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' src/compiler/corePublic.ts | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ inputs.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts | |
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts | |
npm ci | |
npm install # update package-lock.json to ensure the version bump is included | |
npx hereby LKG | |
npm test | |
git diff | |
git add package.json package-lock.json | |
git add src/compiler/corePublic.ts | |
git add tests/baselines/reference/api/typescript.d.ts | |
git add tests/baselines/reference/api/tsserverlibrary.d.ts | |
git add --force ./lib | |
git config user.email "typescriptbot@microsoft.com" | |
git config user.name "TypeScript Bot" | |
git commit -m 'Bump version to ${{ inputs.package_version }} and LKG' | |
git push --set-upstream origin ${{ inputs.branch_name }} | |
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master | |
if: ${{ !cancelled() && inputs.distinct_id }} | |
with: | |
success_comment: "I've created ${{ inputs.branch_name }} with version ${{ inputs.package_version }} for you." | |
failure_comment: 'I was unable to create the new release branch.' | |
github_token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} | |
distinct_id: ${{ inputs.distinct_id }} | |
source_issue: ${{ inputs.source_issue }} | |
requesting_user: ${{ inputs.requesting_user }} | |
status_comment: ${{ inputs.status_comment }} |