From 4730bc24b8af10102b75e0c61e364a5503879b6c Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 22 Sep 2020 10:33:23 -0700 Subject: [PATCH] Backport package-lock infra changes to 3.9 From #40146 From #40703 Fixes #40692 Also --- .github/workflows/new-release-branch.yaml | 4 +-- .../workflows/release-branch-artifact.yaml | 4 +-- .github/workflows/set-version.yaml | 4 +-- .github/workflows/sync-branch.yaml | 4 +-- .github/workflows/update-lkg.yml | 28 +++++++++++++++++++ Dockerfile | 2 +- README.md | 2 +- 7 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/update-lkg.yml diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml index 1e145a0932f79..8cb80522ae283 100644 --- a/.github/workflows/new-release-branch.yaml +++ b/.github/workflows/new-release-branch.yaml @@ -23,7 +23,7 @@ jobs: 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 = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts - npm install + npm ci gulp LKG npm test git diff @@ -32,7 +32,7 @@ jobs: git add tests/baselines/reference/api/typescript.d.ts git add tests/baselines/reference/api/tsserverlibrary.d.ts git add ./lib - git config user.email "ts_bot@rcavanaugh.com" + git config user.email "typescriptbot@microsoft.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 }} diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index ed50cfeb6464c..7683b7623acee 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -21,8 +21,7 @@ jobs: npm uninstall tslint --no-save - name: npm install and test run: | - npm install - npm update + npm ci npm test env: CI: true @@ -41,4 +40,3 @@ jobs: with: name: tgz path: typescript.tgz - \ No newline at end of file diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml index a31d849cb4131..f337d5b58f472 100644 --- a/.github/workflows/set-version.yaml +++ b/.github/workflows/set-version.yaml @@ -29,7 +29,7 @@ jobs: 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 = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts - npm install + npm ci gulp LKG npm test git diff @@ -38,7 +38,7 @@ jobs: git add tests/baselines/reference/api/typescript.d.ts git add tests/baselines/reference/api/tsserverlibrary.d.ts git add ./lib - git config user.email "ts_bot@rcavanaugh.com" + git config user.email "typescriptbot@microsoft.com" git config user.name "TypeScript Bot" git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG' git push diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml index 642a353aa3c69..7c1e6b3667696 100644 --- a/.github/workflows/sync-branch.yaml +++ b/.github/workflows/sync-branch.yaml @@ -20,10 +20,10 @@ jobs: # required client_payload members: # branch_name - the target branch - run: | - git config user.email "ts_bot@rcavanaugh.com" + git config user.email "typescriptbot@microsoft.com" git config user.name "TypeScript Bot" git fetch origin master git merge master --no-ff - npm install + npm ci npm test git push diff --git a/.github/workflows/update-lkg.yml b/.github/workflows/update-lkg.yml new file mode 100644 index 0000000000000..cf81cc97db9fb --- /dev/null +++ b/.github/workflows/update-lkg.yml @@ -0,0 +1,28 @@ +name: Update LKG + +on: + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use node version 12 + uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + + - name: Configure Git and Update LKG + run: | + git config user.email "typescriptbot@microsoft.com" + git config user.name "TypeScript Bot" + npm ci + gulp LKG + npm test + git diff + git add ./lib + git commit -m "Update LKG" + git push diff --git a/Dockerfile b/Dockerfile index 8898a69af6d38..5606df961119b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,6 @@ FROM node:current COPY . /typescript WORKDIR /typescript -RUN npm install +RUN npm ci RUN npm i -g gulp-cli RUN gulp configure-insiders && gulp LKG && gulp clean && npm pack . \ No newline at end of file diff --git a/README.md b/README.md index a422999ce19c2..942ec13a27950 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Install [Gulp](https://gulpjs.com/) tools and dev dependencies: ```bash npm install -g gulp -npm install +npm ci ``` Use one of the following to build and test: