new-release-branch #29
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: | |
repository_dispatch: | |
types: new-release-branch | |
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 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/setup-node@v3 | |
- run: | | |
npm --version | |
# corepack enable npm | |
npm install -g $(jq -r '.packageManager' < package.json) | |
npm --version | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 5 | |
- run: | | |
git checkout -b ${{ github.event.client_payload.branch_name }} | |
sed -i -e 's/"version": ".*"/"version": "${{ github.event.client_payload.package_version }}"/g' package.json | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' src/compiler/corePublic.ts | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts | |
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts | |
sed -i -e 's/const version\(: string\)\{0,1\} = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts | |
npm ci | |
npx hereby LKG | |
npm test | |
git diff | |
git add package.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 "[email protected]" | |
git config user.name "TypeScript Bot" | |
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG' | |
git push --set-upstream origin ${{ github.event.client_payload.branch_name }} |