From cffaddc9f3d71a85d2997f960ca86d2c612013c8 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 19 Feb 2020 13:10:47 -0800 Subject: [PATCH] Add new release branch workflow --- .github/workflows/new-release-branch.yaml | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/new-release-branch.yaml diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml new file mode 100644 index 00000000000..fd78868da11 --- /dev/null +++ b/.github/workflows/new-release-branch.yaml @@ -0,0 +1,43 @@ +name: New Release Branch + +on: repository_dispatch + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 5 + - uses: actions/checkout@v2 + - run: | + git checkout -b ${{ github.event.client_payload.branch_name }} + - name: update package.json version and corePublic.ts version + run: | + 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/typescript.d.ts + sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/tsserverlibrary.d.ts + sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts + - name: Use node version 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: gulp LKG + run: | + npm install + gulp LKG + npm test + - uses: actions/checkout@v2 + - run: | + git diff + git add package.json + git add src/compiler/corePublic.ts + git add tests/baselines/reference/typescript.d.ts + git add tests/baselines/reference/tsserverlibrary.d.ts + git add ./lib + git config user.email "ts_bot@rcavanaugh.com" + 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 }}