mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 11:46:08 -05:00
Merge branch 'main' into tsgo-port
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -120,7 +120,9 @@ jobs:
|
||||
- name: Tests
|
||||
id: test
|
||||
# run tests, but lint separately
|
||||
run: npm run test -- --no-lint --bundle=${{ matrix.config.bundle }}
|
||||
env:
|
||||
BUNDLE: ${{ matrix.config.bundle }}
|
||||
run: npm run test -- --no-lint --bundle="$BUNDLE"
|
||||
|
||||
- name: Print baseline diff on failure
|
||||
if: ${{ failure() && steps.test.conclusion == 'failure' }}
|
||||
@@ -152,7 +154,7 @@ jobs:
|
||||
run: npm test -- --no-lint --coverage
|
||||
|
||||
- name: Upload coverage artifact
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: coverage
|
||||
path: coverage
|
||||
@@ -266,10 +268,12 @@ jobs:
|
||||
id: pack
|
||||
|
||||
- name: Smoke test
|
||||
env:
|
||||
PACKAGE: ${{ steps.pack.outputs.package }}
|
||||
run: |
|
||||
cd "$(mktemp -d)"
|
||||
npm init --yes
|
||||
npm install ${{ steps.pack.outputs.package }}
|
||||
npm install "$PACKAGE"
|
||||
|
||||
echo "Testing tsc..."
|
||||
npx tsc --version
|
||||
@@ -406,7 +410,7 @@ jobs:
|
||||
|
||||
- name: Upload baseline diff artifact
|
||||
if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: fix_baselines.patch
|
||||
path: fix_baselines.patch
|
||||
|
||||
7
.github/workflows/close-issues.yml
vendored
7
.github/workflows/close-issues.yml
vendored
@@ -26,14 +26,15 @@ jobs:
|
||||
- name: Close issues
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
DATE=$(date --date='2 days ago' --iso-8601)
|
||||
|
||||
close_issues() {
|
||||
echo "Closing issues marked as '$1'."
|
||||
for issue in $(gh issue list --limit 100 --label "$1" --repo ${{ github.repository }} --state open --search "updated:<$DATE" --json number --jq '.[].number'); do
|
||||
echo "Closing https://github.com/${{ github.repository }}/issues/$issue"
|
||||
gh issue close $issue --repo ${{ github.repository }} --reason "not planned" --comment "This issue has been marked as \"$1\" and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
for issue in $(gh issue list --limit 100 --label "$1" --repo "$REPO" --state open --search "updated:<$DATE" --json number --jq '.[].number'); do
|
||||
echo "Closing https://github.com/$REPO/issues/$issue"
|
||||
gh issue close $issue --repo "$REPO" --reason "not planned" --comment "This issue has been marked as \"$1\" and has seen no recent activity. It has been automatically closed for house-keeping purposes."
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
6
.github/workflows/codeql.yml
vendored
6
.github/workflows/codeql.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
|
||||
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-configuration.yml
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below).
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
|
||||
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
@@ -70,4 +70,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
|
||||
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||
|
||||
6
.github/workflows/lkg.yml
vendored
6
.github/workflows/lkg.yml
vendored
@@ -21,8 +21,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
if [[ ! "${{ inputs.branch_name }}" =~ ^release- ]]; then
|
||||
- env:
|
||||
BRANCH_NAME: ${{ inputs.branch_name }}
|
||||
run: |
|
||||
if [[ ! "$BRANCH_NAME" =~ ^release- ]]; then
|
||||
echo "Branch name must start with 'release-'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
20
.github/workflows/new-release-branch.yaml
vendored
20
.github/workflows/new-release-branch.yaml
vendored
@@ -63,12 +63,16 @@ jobs:
|
||||
# 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 version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
|
||||
- env:
|
||||
BRANCH_NAME: ${{ inputs.branch_name }}
|
||||
PACKAGE_VERSION: ${{ inputs.package_version }}
|
||||
CORE_MAJOR_MINOR: ${{ inputs.core_major_minor }}
|
||||
run: |
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
sed -i -e 's/"version": ".*"/"version": "'"$PACKAGE_VERSION"'"/g' package.json
|
||||
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' src/compiler/corePublic.ts
|
||||
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' tests/baselines/reference/api/typescript.d.ts
|
||||
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "'"$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
|
||||
@@ -80,8 +84,8 @@ jobs:
|
||||
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 }}
|
||||
git commit -m "Bump version to $PACKAGE_VERSION and LKG"
|
||||
git push --set-upstream origin "$BRANCH_NAME"
|
||||
|
||||
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
|
||||
if: ${{ !cancelled() && inputs.distinct_id }}
|
||||
|
||||
15
.github/workflows/pr-modified-files.yml
vendored
15
.github/workflows/pr-modified-files.yml
vendored
@@ -33,13 +33,16 @@ jobs:
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
REPO: ${{ github.repository }}
|
||||
|
||||
steps:
|
||||
- name: Check if PR author is in pr_owners.txt
|
||||
id: pr_owner
|
||||
run: |
|
||||
curl -s https://raw.githubusercontent.com/microsoft/TypeScript/main/.github/pr_owners.txt > pr_owners.txt
|
||||
if grep -Fxq -m1 "${{ github.event.pull_request.user.login }}" pr_owners.txt; then
|
||||
if grep -Fxq -m1 "$PR_AUTHOR" pr_owners.txt; then
|
||||
echo "pr_owner=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "pr_owner=false" >> "$GITHUB_OUTPUT"
|
||||
@@ -57,7 +60,7 @@ jobs:
|
||||
gh api graphql -f query='
|
||||
query($endCursor: String) {
|
||||
repository(owner: "microsoft", name: "TypeScript") {
|
||||
pullRequest(number: ${{ github.event.pull_request.number }}) {
|
||||
pullRequest(number: '"$PR_NUMBER"') {
|
||||
files(first: 100, after: $endCursor) {
|
||||
pageInfo{ hasNextPage, endCursor }
|
||||
nodes {
|
||||
@@ -79,7 +82,7 @@ jobs:
|
||||
#!/bin/bash
|
||||
FILENAME=bot_comments.txt
|
||||
if [ ! -f $FILENAME ]; then
|
||||
gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} \
|
||||
gh pr view $PR_NUMBER --repo $REPO \
|
||||
--json 'comments' --jq '.comments[] | select(.author.login == "typescript-bot") | .body' > $FILENAME
|
||||
fi
|
||||
exec grep -Fq -m1 "$1" $FILENAME
|
||||
@@ -99,7 +102,7 @@ jobs:
|
||||
MESSAGE+=" You can [read more here](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md#contributing-libdts-fixes)."
|
||||
MESSAGE+=" For house-keeping purposes, this pull request will be closed."
|
||||
|
||||
gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --comment "$MESSAGE"
|
||||
gh pr close "$PR_NUMBER" --repo "$REPO" --comment "$MESSAGE"
|
||||
exit 1 # Stop the pipeline; we just closed the PR.
|
||||
fi
|
||||
|
||||
@@ -114,7 +117,7 @@ jobs:
|
||||
if ./already_commented.sh "It looks like you've changed the TSServer protocol in some way."; then
|
||||
echo "Already commented."
|
||||
else
|
||||
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE"
|
||||
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$MESSAGE"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -130,6 +133,6 @@ jobs:
|
||||
if ./already_commented.sh "Looks like you're introducing a change to the public API surface area."; then
|
||||
echo "Already commented."
|
||||
else
|
||||
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$MESSAGE"
|
||||
gh pr comment "$PR_NUMBER" --repo "$REPO" --body "$MESSAGE"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
npm pack ./
|
||||
mv typescript-*.tgz typescript.tgz
|
||||
- name: Upload built tarfile
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: tgz
|
||||
path: typescript.tgz
|
||||
|
||||
4
.github/workflows/scorecard.yml
vendored
4
.github/workflows/scorecard.yml
vendored
@@ -47,7 +47,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: 'Upload artifact'
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@@ -55,6 +55,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: 'Upload to code-scanning'
|
||||
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
|
||||
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
15
.github/workflows/set-version.yaml
vendored
15
.github/workflows/set-version.yaml
vendored
@@ -68,11 +68,14 @@ jobs:
|
||||
# branch_name - the target branch
|
||||
# package_version - the full version string (eg, `3.9.1-rc` or `3.9.2`)
|
||||
# core_major_minor - the major.minor pair associated with the desired package_version (eg, `3.9` for `3.9.3`)
|
||||
- run: |
|
||||
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 version\(: string\)\{0,1\} = .*;/const version = "${{ inputs.package_version }}" as string;/g' src/compiler/corePublic.ts
|
||||
- env:
|
||||
PACKAGE_VERSION: ${{ inputs.package_version }}
|
||||
CORE_MAJOR_MINOR: ${{ inputs.core_major_minor }}
|
||||
run: |
|
||||
sed -i -e 's/"version": ".*"/"version": "'"$PACKAGE_VERSION"'"/g' package.json
|
||||
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' src/compiler/corePublic.ts
|
||||
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "'"$CORE_MAJOR_MINOR"'"/g' tests/baselines/reference/api/typescript.d.ts
|
||||
sed -i -e 's/const version\(: string\)\{0,1\} = .*;/const version = "'"$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
|
||||
@@ -84,7 +87,7 @@ jobs:
|
||||
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 commit -m "Bump version to $PACKAGE_VERSION and LKG"
|
||||
git push
|
||||
|
||||
- uses: microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master
|
||||
|
||||
Reference in New Issue
Block a user