mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
Delete upstream workflows
This fork does not ship upstream's releases, and its hosted-runner jobs never start here. Claude-Session: https://claude.ai/code/session_01HuMDfgFssPUptYUzgZ6Cp8
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
name: AgentScan
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
|
||||
jobs:
|
||||
agentscan:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Cache AgentScan analysis
|
||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
|
||||
with:
|
||||
path: .agentscan-cache
|
||||
key: agentscan-cache-${{ github.actor }}
|
||||
restore-keys: agentscan-cache-
|
||||
- name: AgentScan
|
||||
uses: MatteoGabriele/agentscan-action@2b7e598bd821bc0f4651e985688951930c2f60d0
|
||||
with:
|
||||
cache-path: ".agentscan-cache"
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
skip-comment-on-organic: true
|
||||
skip-members: "nicolo-ribaudo,JLHwung,liuxingbaoyu,babel-bot,fisker"
|
||||
@@ -1,739 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
prepare-yarn-cache:
|
||||
name: Prepare Cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: 'Check or update Yarn cache (fix w/ "yarn install")'
|
||||
env:
|
||||
YARN_ENABLE_HARDENED_MODE: true # enable hardened mode as CI may run on untrusted repos
|
||||
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
|
||||
YARN_NODE_LINKER: pnp # use pnp linker for better linking performance: it's meant to update yarn cache only
|
||||
run: |
|
||||
yarn install --mode=skip-build
|
||||
|
||||
yarn-validate:
|
||||
name: Validate Yarn dependencies and constraints
|
||||
needs: prepare-yarn-cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: 'Check for unmet constraints (fix w/ "yarn constraints --fix")'
|
||||
run: |
|
||||
yarn constraints
|
||||
- name: 'Check for duplicate dependencies (fix w/ "yarn dedupe")'
|
||||
run: |
|
||||
yarn dedupe --check
|
||||
- name: Check for dependency cycles
|
||||
# todo: investigate why we need to install dependencies here to not get
|
||||
# the following error:
|
||||
# Internal Error: chalk@condition:BABEL_8_BREAKING ?[...]: This package
|
||||
# doesn't seem to be present in your lockfile; run "yarn install" to
|
||||
# update the lockfile
|
||||
run: |
|
||||
yarn
|
||||
yarn release-tool check-cycles
|
||||
|
||||
build:
|
||||
name: Build Babel Artifacts
|
||||
needs: prepare-yarn-cache
|
||||
runs-on: ubuntu-latest
|
||||
# Yarn PnP does not support native ESM yet (https://github.com/yarnpkg/berry/issues/638)
|
||||
# env:
|
||||
# YARN_NODE_LINKER: pnp # use pnp linker for better linking performance and stricter checks
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Build babel artifacts
|
||||
run: |
|
||||
make -j build-standalone-ci
|
||||
env:
|
||||
BABEL_ENV: test-legacy
|
||||
BABEL_9_BREAKING: false
|
||||
STRIP_BABEL_VERSION_FLAG: true
|
||||
- name: Build Makefile.js
|
||||
run: |
|
||||
node ./scripts/pack-script.ts
|
||||
- name: Generate readmes
|
||||
run: |
|
||||
make generate-readme
|
||||
- name: Generate .npmignore
|
||||
run: |
|
||||
node scripts/generators/npm-ignore.ts
|
||||
- name: Cleanup fixtures
|
||||
run: |
|
||||
node scripts/cleanup-fixtures.ts
|
||||
- name: Ensure cwd does not contain uncommitted changes
|
||||
run: |
|
||||
node ./scripts/assert-dir-git-clean.ts "\`make build\` and \`node scripts/cleanup-fixtures.ts\`"
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: babel-artifact
|
||||
path: |
|
||||
codemods/*/lib/**/*
|
||||
eslint/*/lib/**/*
|
||||
packages/*/lib/**/*
|
||||
packages/babel-standalone/*.js
|
||||
packages/babel-runtime/**/*.js
|
||||
packages/babel-runtime-corejs3/**/*.js
|
||||
!**/node_modules/**
|
||||
retention-days: 5
|
||||
|
||||
build-windows:
|
||||
name: Build Babel Artifacts on Windows
|
||||
runs-on: windows-latest
|
||||
# Yarn PnP does not support native ESM yet (https://github.com/yarnpkg/berry/issues/638)
|
||||
# env:
|
||||
# YARN_NODE_LINKER: pnp # use pnp linker for better linking performance and stricter checks
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Build babel artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
make -j build-standalone-ci
|
||||
env:
|
||||
BABEL_ENV: test-legacy
|
||||
BABEL_9_BREAKING: false
|
||||
STRIP_BABEL_VERSION_FLAG: true
|
||||
- name: Ensure cwd does not contain uncommitted changes
|
||||
run: |
|
||||
node ./scripts/assert-dir-git-clean.ts build
|
||||
|
||||
prepublish-windows:
|
||||
name: Prepublish on Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- name: Prepublish
|
||||
run: make prepublish
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Lint
|
||||
run: make -j lint-ci check-compat-data
|
||||
- name: Ensure cwd does not contain uncommitted changes
|
||||
run: |
|
||||
node ./scripts/assert-dir-git-clean.ts "lint-ci check-compat-data"
|
||||
|
||||
test-coverage:
|
||||
name: Test on Node.js Latest (with coverage)
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: |
|
||||
yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Run tests
|
||||
run: |
|
||||
yarn c8 jest --ci
|
||||
yarn test:esm
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
BABEL_COVERAGE: true
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
name: babel-7
|
||||
|
||||
test:
|
||||
name: Test on Node.js ${{matrix.node-version}}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [25, 24, 22]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest # Run yarn on latest node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: |
|
||||
yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Use Node.js ${{ matrix.node-version }} # Checkout node version for test executor
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Ensure that @babel/node's list of node flags is up to date
|
||||
run: |
|
||||
node ./packages/babel-node/scripts/list-node-flags.js
|
||||
- name: Test on node.js ${{ matrix.node-version }}
|
||||
# Todo(Babel 8): Jest execution path is hardcoded because Yarn 2 does not support node 6
|
||||
run: |
|
||||
node ./node_modules/.bin/jest --ci
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
TEST_FUZZ: true
|
||||
|
||||
test-windows-mac:
|
||||
name: Test on
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Test
|
||||
run: yarn jest --ci
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
|
||||
build-babel9:
|
||||
name: Build Babel 9 Artifacts
|
||||
needs: prepare-yarn-cache
|
||||
runs-on: ubuntu-latest
|
||||
# Yarn PnP does not support native ESM yet (https://github.com/yarnpkg/berry/issues/638)
|
||||
# env:
|
||||
# YARN_NODE_LINKER: pnp # use pnp linker for better linking performance and stricter checks
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Build babel artifacts
|
||||
run: |
|
||||
make -j build-standalone-ci
|
||||
env:
|
||||
BABEL_ENV: test-legacy
|
||||
BABEL_9_BREAKING: true
|
||||
STRIP_BABEL_VERSION_FLAG: true
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: babel9-artifact
|
||||
path: |
|
||||
codemods/*/lib/**/*
|
||||
eslint/*/lib/**/*
|
||||
packages/*/lib/**/*
|
||||
packages/babel-standalone/*.js
|
||||
packages/babel-runtime/**/*.js
|
||||
packages/babel-runtime-corejs3/**/*.js
|
||||
!**/node_modules/**
|
||||
retention-days: 5
|
||||
|
||||
lint-babel9:
|
||||
name: Lint (Babel 9)
|
||||
needs: build-babel9
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel9-artifact
|
||||
- name: Lint
|
||||
run: make -j lint-ci check-compat-data
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
BABEL_9_BREAKING: true
|
||||
|
||||
test-babel9-coverage:
|
||||
name: Test Babel 9 changes (with coverage)
|
||||
needs: build-babel9
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: |
|
||||
yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel9-artifact
|
||||
- name: Run tests
|
||||
run: |
|
||||
yarn c8 jest --ci
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
BABEL_COVERAGE: true
|
||||
BABEL_9_BREAKING: true
|
||||
- name: Upload coverage report
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
name: babel-9
|
||||
|
||||
test-babel9-windows-mac:
|
||||
name: Test Babel 9 changes
|
||||
needs: build-babel9
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel9-artifact
|
||||
- name: Test
|
||||
run: yarn jest --ci
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
BABEL_9_BREAKING: true
|
||||
|
||||
external-parser-tests:
|
||||
name: Third-party Parser Tests
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Download tests
|
||||
run: make -j bootstrap-flow bootstrap-typescript bootstrap-test262
|
||||
- name: Run Test262 Tests
|
||||
run: make test-test262
|
||||
- name: Run Flow Tests
|
||||
run: make test-flow
|
||||
- name: Run TypeScript Tests
|
||||
run: make test-typescript
|
||||
|
||||
runtime-interop-prepare:
|
||||
name: Prepare runtime integration tests
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
# See https://github.com/babel/babel/pull/12906
|
||||
- name: Support self-references on old Node.js
|
||||
run: |
|
||||
echo '{
|
||||
"type": "commonjs",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "workspace:^",
|
||||
"@babel/runtime-corejs3": "workspace:^"
|
||||
}
|
||||
}' > packages/package.json
|
||||
node -e "
|
||||
const pkg = require('./package.json');
|
||||
pkg.workspaces.push('packages');
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2))
|
||||
"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
env:
|
||||
# The "Support self-references on old Node.js" step mutates the
|
||||
# package.json file, causing a yarn.lock update.
|
||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Generate absoluteRuntime tests
|
||||
run: yarn test:runtime:generate-absolute-runtime
|
||||
- name: Test bundlers
|
||||
run: yarn test:runtime:bundlers
|
||||
- name: Test Node.js latest
|
||||
run: node test/runtime-integration/node.cjs
|
||||
|
||||
runtime-interop:
|
||||
name: Test @babel/runtime integrations on Node.js
|
||||
needs: [build, runtime-interop-prepare]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version:
|
||||
[
|
||||
10,
|
||||
"12.0",
|
||||
12.12,
|
||||
12.13,
|
||||
12.15,
|
||||
12.16,
|
||||
13.2,
|
||||
13.6,
|
||||
13.7,
|
||||
14.2,
|
||||
16.5,
|
||||
16.6,
|
||||
22.11,
|
||||
22.12,
|
||||
"23.10",
|
||||
]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
# See https://github.com/babel/babel/pull/12906
|
||||
- name: Support self-references on old Node.js
|
||||
run: |
|
||||
echo '{
|
||||
"type": "commonjs",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@babel/runtime": "workspace:^",
|
||||
"@babel/runtime-corejs3": "workspace:^"
|
||||
}
|
||||
}' > packages/package.json
|
||||
node -e "
|
||||
const pkg = require('./package.json');
|
||||
pkg.workspaces.push('packages');
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2))
|
||||
"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
env:
|
||||
# The "Support self-references on old Node.js" step mutates the
|
||||
# package.json file, causing a yarn.lock update.
|
||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Generate absoluteRuntime tests
|
||||
run: yarn test:runtime:generate-absolute-runtime
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Test Node.js ${{ matrix.node-version }}
|
||||
run: node test/runtime-integration/node.cjs
|
||||
|
||||
eslint-version-test:
|
||||
name: Test @babel/eslint-* with ESLint
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
eslint-version: [9.0.0]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Downgrade ESLint to ${{ matrix.eslint-version }}
|
||||
run: yarn up eslint@${{ matrix.eslint-version }}
|
||||
- name: Run babel/eslint tests
|
||||
run: node ./node_modules/.bin/jest eslint
|
||||
|
||||
test262-prepare:
|
||||
name: test262 - Prepare for running in parallel
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'babel/babel'
|
||||
steps:
|
||||
- name: Checkout Babel
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
- name: Checkout test runner
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: babel/babel-test262-runner
|
||||
path: babel-test262-runner
|
||||
ref: main
|
||||
- name: Download test262
|
||||
run: make bootstrap-test262
|
||||
- name: Prepare test262 chunks
|
||||
run: |
|
||||
cd babel-test262-runner
|
||||
npm ci
|
||||
node lib/prepare-chunks 8 > ~/test262-chunks.json
|
||||
env:
|
||||
TEST262_PATH: ../build/test262
|
||||
- name: Upload chunks artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: test262-chunks
|
||||
path: ~/test262-chunks.json
|
||||
retention-days: 30
|
||||
|
||||
test262:
|
||||
name: test262
|
||||
strategy:
|
||||
matrix:
|
||||
chunk: [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, test262-prepare]
|
||||
steps:
|
||||
- name: Checkout Babel
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: babel-artifact
|
||||
- name: Checkout test runner
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: babel/babel-test262-runner
|
||||
path: babel-test262-runner
|
||||
ref: main
|
||||
- name: Install test runner
|
||||
run: |
|
||||
cd babel-test262-runner
|
||||
npm ci
|
||||
node lib/download-node
|
||||
- name: Download test262
|
||||
run: make bootstrap-test262
|
||||
- name: Download chunks file
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: test262-chunks
|
||||
- name: Run test262
|
||||
run: |
|
||||
cd babel-test262-runner
|
||||
node lib/run-tests I_AM_SURE | tee ~/test262-${{ matrix.chunk }}.tap
|
||||
# Specify bash to enable pipefail, so that "| tee" does not suppress the failure exit code.
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
|
||||
shell: bash
|
||||
env:
|
||||
BABEL_PATH: ".."
|
||||
TEST262_PATH: ../build/test262
|
||||
THREADS: 4
|
||||
CHUNKS_FILE: ../test262-chunks.json
|
||||
CHUNK: ${{ matrix.chunk }}
|
||||
- name: Create artifact with report results
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: test262-result-${{ matrix.chunk }}
|
||||
path: ~/test262-${{ matrix.chunk }}.tap
|
||||
retention-days: 30
|
||||
|
||||
test262-finish:
|
||||
name: test262 - Analyze results
|
||||
runs-on: ubuntu-latest
|
||||
needs: test262
|
||||
steps:
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-0 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-1 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-2 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-3 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-4 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-5 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-6 }
|
||||
- uses: actions/download-artifact@v8
|
||||
with: { name: test262-result-7 }
|
||||
- name: Merge chunk results
|
||||
run: |
|
||||
cat test262-0.tap test262-1.tap test262-2.tap test262-3.tap \
|
||||
test262-4.tap test262-5.tap test262-6.tap test262-7.tap \
|
||||
| npx tap-merge > test262.tap
|
||||
- name: Create artifact with report results
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: test262-result
|
||||
path: test262.tap
|
||||
- name: Checkout test runner
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: babel/babel-test262-runner
|
||||
path: babel-test262-runner
|
||||
ref: main
|
||||
- name: Download previous results
|
||||
run: |
|
||||
cd babel-test262-runner
|
||||
npm ci
|
||||
node lib/download-main-artifact/index.mjs ~/test262-main.tap
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Compare previous main branch & current results
|
||||
run: |
|
||||
cd babel-test262-runner
|
||||
node lib/compare-results ~/test262-main.tap ../test262.tap | tee ~/diff.tap
|
||||
# Specify bash to enable pipefail, so that "| tee" does not suppress the failure exit code.
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
|
||||
shell: bash
|
||||
|
||||
ensure-npm-packages-exist:
|
||||
name: Ensure npm packages exist
|
||||
needs: yarn-validate
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- name: Ensure npm packages exist
|
||||
run: |
|
||||
node ./scripts/ensure-packages-exist.ts --check-only
|
||||
publint:
|
||||
name: Publint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "*"
|
||||
cache: "yarn"
|
||||
- name: Build
|
||||
run: make prepublish
|
||||
- name: Publint
|
||||
run: node ./scripts/publint.ts
|
||||
@@ -1,100 +0,0 @@
|
||||
name: E2E tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
e2e-publish:
|
||||
name: Publish to local Verdaccio registry
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
cache: "yarn"
|
||||
- name: Publish
|
||||
run: ./scripts/integration-tests/publish-local.sh
|
||||
- name: Pack published packages
|
||||
working-directory: /tmp
|
||||
run: tar -cvf verdaccio-workspace.tar verdaccio-workspace
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: verdaccio-workspace
|
||||
path: /tmp/verdaccio-workspace.tar
|
||||
retention-days: 1
|
||||
|
||||
e2e-tests:
|
||||
name: Test
|
||||
needs: e2e-publish
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
project:
|
||||
- babel
|
||||
- create-react-app
|
||||
# - vue-cli
|
||||
# - react-native
|
||||
- angular-cli
|
||||
# - nextjs-10
|
||||
- prettier
|
||||
# - jest
|
||||
# - ember # TODO: https://github.com/ember-cli/babel-remove-types/pull/9
|
||||
steps:
|
||||
- name: Get yarn1 cache directory path
|
||||
id: yarn1-cache-dir-path
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
# Pin node to 22 for create-react-app project.
|
||||
# The create-react-app e2e breaking test throws
|
||||
# http fetch GET https://localhost:4873/zwitch/-/zwitch-1.0.5.tgz attempt 3 failed with ERR_SSL_WRONG_VERSION_NUMBER
|
||||
# when installing on Node.js 24. It might be an npm issue.
|
||||
- name: Use Node.js ${{ matrix.project == 'create-react-app' && '22' || 'latest' }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ matrix.project == 'create-react-app' && '22' || 'latest' }}
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||
- name: Use yarn1 cache
|
||||
uses: actions/cache@v5
|
||||
id: yarn1-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn1-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn1-e2e-${{ matrix.project }}-
|
||||
- name: Use yarn cache
|
||||
uses: actions/cache@v5
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-e2e-${{ matrix.project }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn-e2e-${{ matrix.project }}-
|
||||
- name: Clean babel cache
|
||||
run: |
|
||||
rm -rf ${{ steps.yarn1-cache-dir-path.outputs.dir }}/*babel*
|
||||
rm -rf ${{ steps.yarn-cache-dir-path.outputs.dir }}/*babel*
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: verdaccio-workspace
|
||||
path: /tmp
|
||||
- name: Unpack published packages
|
||||
run: tar -C /tmp -xf /tmp/verdaccio-workspace.tar
|
||||
- name: Test
|
||||
run: ./scripts/integration-tests/e2e-${{ matrix.project }}.sh
|
||||
@@ -1,113 +0,0 @@
|
||||
name: Issue Triage
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, labeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
welcome:
|
||||
name: Welcome comment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if Babel member
|
||||
id: is_babel_member
|
||||
if: github.event.action == 'opened'
|
||||
uses: babel/actions/is-org-member@v2
|
||||
with:
|
||||
org: babel
|
||||
username: ${{ github.event.issue.user.login }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Create Welcome Comment
|
||||
uses: babel/actions/create-comment@v2
|
||||
if: |
|
||||
github.event.action == 'opened' &&
|
||||
steps.is_babel_member.outputs.result == 0
|
||||
with:
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
issue: ${{ github.event.issue.number }}
|
||||
comment: >
|
||||
Hey @${{ github.event.issue.user.login }}!
|
||||
We really appreciate you taking the time to report an issue. The
|
||||
collaborators on this project attempt to help as many people as
|
||||
possible, but we're a limited number of volunteers, so it's
|
||||
possible this won't be addressed swiftly.
|
||||
|
||||
|
||||
If you need any help, or just have general Babel or JavaScript questions, we have a
|
||||
vibrant [Slack community](https://babeljs.slack.com) that typically always has someone
|
||||
willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite.
|
||||
|
||||
needs_info:
|
||||
name: Needs Info
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create Needs Info Comment
|
||||
uses: babel/actions/create-comment@v2
|
||||
if: |
|
||||
github.event.action == 'labeled' &&
|
||||
github.event.label.name == 'Needs Info'
|
||||
with:
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
issue: ${{ github.event.issue.number }}
|
||||
comment: >
|
||||
Hi @${{ github.event.issue.user.login }}!
|
||||
This issue is missing some important information we'll need
|
||||
to be able to reproduce this issue.
|
||||
|
||||
|
||||
Please understand that we receive a high volume of issues,
|
||||
and there are only a limited number of volunteers that help
|
||||
maintain this project. The easier it is for us to decipher an
|
||||
issue with the info provided, the more likely it is that we'll
|
||||
be able to help.
|
||||
|
||||
|
||||
Please make sure you have the following information documented in
|
||||
this ticket:
|
||||
|
||||
1. Your Babel configuration (typically from `.babelrc` or `babel.config.js`)
|
||||
|
||||
2. The current (incorrect) behavior you're seeing
|
||||
|
||||
3. The behavior you expect
|
||||
|
||||
4. A [short, self-contained example](http://sscce.org/)
|
||||
|
||||
|
||||
Please provide either a link to the problem via the
|
||||
[`repl`](https://babeljs.io/repl/), or if the `repl` is
|
||||
insufficient, a new and minimal repository with instructions on
|
||||
how to build/replicate the issue.
|
||||
|
||||
npm_cache:
|
||||
name: Npm Cache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Npm Cache Comment
|
||||
uses: babel/actions/create-comment@v2
|
||||
if: |
|
||||
github.event.action == 'labeled' &&
|
||||
github.event.label.name == 'i: npm cache'
|
||||
with:
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
issue: ${{ github.event.issue.number }}
|
||||
comment: >
|
||||
Hi @${{ github.event.issue.user.login }}!
|
||||
|
||||
This seems to be an issue caused by a package that you are not able to download.
|
||||
You can verify that the package is available using the npm website:
|
||||
for example, https://www.npmjs.com/package/@babel/types?activeTab=versions is the URL for `@babel/types`
|
||||
(replace `@babel/types` in the URL with the package you want to check). If you see zero downloads don't worry:
|
||||
npm can take up to a few days to display the downloads count, but this does not mean that the package is not available.
|
||||
|
||||
Here are some things you can try:
|
||||
|
||||
1. Please check if there is a stale proxy or cache between you and npm
|
||||
(this is the most likely cause and it is common in corporate networks).
|
||||
|
||||
2. Visit https://status.npmjs.org/ to see if the current npm is working properly.
|
||||
|
||||
3. See https://gist.github.com/hzoo/df94af2d2ec48696e683b772c775aa67
|
||||
@@ -1,22 +0,0 @@
|
||||
name: Lock Threads
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 4 * * *'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
permissions:
|
||||
issues: write # for dessant/lock-threads to lock issues
|
||||
pull-requests: write # for dessant/lock-threads to lock PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v4
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: "91"
|
||||
add-issue-labels: "outdated"
|
||||
pr-inactive-days: "91"
|
||||
add-pr-labels: "outdated"
|
||||
@@ -1,26 +0,0 @@
|
||||
name: Package Manager
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
# Ensure packageManager field contains the correct yarn version and integrity hash.
|
||||
- package.json
|
||||
- .yarn/releases/*
|
||||
- .yarnrc.yml
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
yarn_integrity:
|
||||
name: Ensure yarn integrity
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
- run: |
|
||||
node ./scripts/ensure-yarn-version-integrity.ts
|
||||
@@ -1,28 +0,0 @@
|
||||
name: Release for testing
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish to pkg.pr.new
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
cache: "yarn"
|
||||
- name: Build
|
||||
run: make prepublish
|
||||
- name: Publish
|
||||
run: yarn pkg-pr-new publish --only-templates --yarn './codemods/*' './eslint/*' './packages/*'
|
||||
@@ -1,294 +0,0 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
# Often minor versions require human intervention, so it's safer if we
|
||||
# force ourselves to always create them locally.
|
||||
description: ⚠️ This workflow can only automatically release patch versions, or Babel 8 pre-releases
|
||||
required: true
|
||||
default: patch
|
||||
type: choice
|
||||
options:
|
||||
- prerelease
|
||||
- patch
|
||||
- "8.0.0"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
log-updates:
|
||||
name: Log packages to publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the new tag
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: This release will publish the following packages
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
yarn release-tool version --dry ${{ github.event.inputs.version }}
|
||||
else
|
||||
git diff --name-only HEAD^..HEAD
|
||||
fi;
|
||||
|
||||
ensure-npm-packages-exist:
|
||||
name: Ensure npm packages exist
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
cache: "yarn"
|
||||
- name: Install
|
||||
run: yarn install
|
||||
- name: Ensure npm packages exist
|
||||
run: |
|
||||
node ./scripts/ensure-packages-exist.ts --check-only
|
||||
|
||||
git-version:
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
name: Create git tag and commit
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- ensure-npm-packages-exist
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
outputs:
|
||||
branch: ${{ steps.branch-name.outputs.branch }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set @babel-bot as committer
|
||||
run: |
|
||||
git config user.name "Babel Bot"
|
||||
git config user.email "[email protected]"
|
||||
|
||||
- name: Create new version
|
||||
run: |
|
||||
make new-version-checklist
|
||||
yarn release-tool version -f @babel/standalone --yes ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Compute temporary branch name
|
||||
id: branch-name
|
||||
run: |
|
||||
branch="release/temp/$(git describe --abbrev=0)"
|
||||
echo $branch
|
||||
echo "branch=$branch" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Push to GitHub
|
||||
run: |
|
||||
git push "https://babel-bot:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"${{ steps.branch-name.outputs.branch }}" --follow-tags
|
||||
|
||||
npm-release:
|
||||
name: Build, Test and Publish
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- git-version
|
||||
- ensure-npm-packages-exist
|
||||
environment: npm
|
||||
permissions:
|
||||
id-token: write
|
||||
# The default condition is success(), but this is false when one of the previous jobs is skipped
|
||||
if: |
|
||||
always() &&
|
||||
(needs.git-version.result == 'success' || needs.git-version.result == 'skipped') &&
|
||||
needs.ensure-npm-packages-exist.result == 'success'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: latest
|
||||
check-latest: true
|
||||
package-manager-cache: false # Never use the cache in release builds to avoid cache poisoning.
|
||||
- name: Checkout the temporary branch
|
||||
if: needs.git-version.result == 'success'
|
||||
run: git checkout ${{ needs.git-version.outputs.branch }}
|
||||
|
||||
- name: Set @babel-bot as committer
|
||||
run: |
|
||||
git config user.name "Babel Bot"
|
||||
git config user.email "[email protected]"
|
||||
|
||||
- name: Build and Test
|
||||
run: make prepublish
|
||||
env:
|
||||
# Hack: use FORCE_COLOR so that supports-color@5 returns true for GitHub CI
|
||||
# Remove once `chalk` is bumped to 4.0.
|
||||
FORCE_COLOR: true
|
||||
|
||||
- name: Publish to npm
|
||||
run: yarn release-tool publish --yes --provenance
|
||||
|
||||
# Uncomment when Babel 8 becomes stable and the website migrated to Babel 8
|
||||
# - name: Generate babel-types docs
|
||||
# continue-on-error: true
|
||||
# run: |
|
||||
# mkdir build
|
||||
# node ./packages/babel-types/scripts/generators/docs.ts > ./build/types.md
|
||||
#
|
||||
# - name: Upload babel-types docs
|
||||
# continue-on-error: true
|
||||
# uses: actions/upload-artifact@v7
|
||||
# with:
|
||||
# name: babel-types-docs
|
||||
# path: build/types.md
|
||||
# retention-days: 3
|
||||
|
||||
github-release:
|
||||
name: Create GitHub release draft
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- git-version
|
||||
- ensure-npm-packages-exist
|
||||
outputs:
|
||||
is-main: ${{ steps.is-main.outputs.result == 1 }}
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||
version: ${{ steps.tags.outputs.new }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check if releasing from main
|
||||
id: is-main
|
||||
uses: babel/actions/ref-matches-branch@v2
|
||||
with:
|
||||
name: main
|
||||
|
||||
- name: Checkout the temporary branch
|
||||
if: needs.git-version.result == 'success'
|
||||
run: git checkout ${{ needs.git-version.outputs.branch }}
|
||||
|
||||
- name: Get tag info
|
||||
id: tags
|
||||
uses: babel/actions/get-release-tags@v2
|
||||
with:
|
||||
prefix: v8
|
||||
|
||||
- name: Generate the changelog
|
||||
id: changelog
|
||||
uses: babel/actions/generate-lerna-changelog@v2
|
||||
with:
|
||||
from: ${{ steps.tags.outputs.old }}
|
||||
to: ${{ steps.tags.outputs.new }}
|
||||
filter: v8
|
||||
env:
|
||||
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create a draft GitHub release
|
||||
uses: babel/actions/publish-github-release@v2
|
||||
with:
|
||||
tag: ${{ steps.tags.outputs.new }}
|
||||
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
|
||||
github-push:
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
name: Push release commit to "main"
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- npm-release
|
||||
- github-release
|
||||
- git-version
|
||||
# The default condition is success(), but this is false when one of the previous jobs is skipped
|
||||
if: |
|
||||
always() &&
|
||||
needs.npm-release.result == 'success' &&
|
||||
needs.github-release.result == 'success' &&
|
||||
needs.github-release.outputs.is-main
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Checkout the temporary branch
|
||||
if: needs.git-version.result == 'success'
|
||||
run: git checkout ${{ needs.git-version.outputs.branch }}
|
||||
|
||||
- name: Update CHANGELOG.md
|
||||
uses: babel/actions/update-changelog@v2
|
||||
with:
|
||||
changelog: ${{ needs.github-release.outputs.changelog }}
|
||||
filename: CHANGELOG.md
|
||||
|
||||
- name: Commit CHANGELOG.md
|
||||
run: |
|
||||
git add CHANGELOG.md
|
||||
git -c user.name="Babel Bot" -c user.email="[email protected]" \
|
||||
commit -m "Add ${{ needs.github-release.outputs.version }} to CHANGELOG.md [skip ci]" --no-verify --quiet
|
||||
|
||||
- name: Push to GitHub
|
||||
run: |
|
||||
git push "https://babel-bot:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main --follow-tags
|
||||
|
||||
- name: Delete temporary branch from GitHub
|
||||
if: needs.git-version.result == 'success'
|
||||
run: git push "https://babel-bot:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" :${{ needs.git-version.outputs.branch }}
|
||||
|
||||
# Uncomment when Babel 8 becomes stable
|
||||
# types-docs-updates:
|
||||
# name: Update Babel types docs
|
||||
# runs-on: ubuntu-latest
|
||||
# needs:
|
||||
# - github-release
|
||||
# - github-push
|
||||
# if: |
|
||||
# always() &&
|
||||
# needs.github-push.result == 'success' &&
|
||||
# needs.github-release.result == 'success' &&
|
||||
# needs.github-release.outputs.is-main
|
||||
# steps:
|
||||
# - uses: actions/checkout@v6
|
||||
# with:
|
||||
# repository: babel/website
|
||||
# fetch-depth: 0 # Otherwise we cannot push
|
||||
# persist-credentials: false # So that we can push with BOT_TOKEN, otherwise it doesn't trigger CI
|
||||
# - name: Download babel-types docs
|
||||
# uses: actions/download-artifact@v8
|
||||
# with:
|
||||
# name: babel-types-docs
|
||||
# # Downloaded as ./docs/types.md
|
||||
# path: docs
|
||||
# - name: Commit Babel website changes
|
||||
# id: prepare-website-changes
|
||||
# run: |
|
||||
# if [[ -z "$(git status --porcelain=v1 2>/dev/null)" ]]
|
||||
# then
|
||||
# echo "No babel-types docs changes."
|
||||
# exit 0
|
||||
# else
|
||||
# echo "hasChanges=true" >> $GITHUB_OUTPUT
|
||||
# fi
|
||||
# git checkout -b update-types-docs
|
||||
# git config user.name "Babel Bot"
|
||||
# git config user.email "[email protected]"
|
||||
# git commit -am "docs: update babel types"
|
||||
# git push --force "https://babel-bot:${{ secrets.BOT_TOKEN }}@github.com/babel/website.git" update-types-docs
|
||||
# - name: Create Pull Request
|
||||
# uses: babel/actions/create-pull-request@v2
|
||||
# if: steps.prepare-website-changes.outputs.hasChanges == 'true'
|
||||
# with:
|
||||
# token: ${{ secrets.BOT_TOKEN }}
|
||||
# repository: babel/website
|
||||
# branch: update-types-docs
|
||||
# base: main
|
||||
# title: Update Babel types docs
|
||||
# description: Updated `@babel/types` docs for [Babel ${{ needs.github-release.outputs.version }}](https://github.com/babel/babel/releases/tag/${{ needs.github-release.outputs.version }}).
|
||||
# labels: |
|
||||
# docs
|
||||
# repo automation :robot:
|
||||
@@ -1,23 +0,0 @@
|
||||
name: Open issue to remind doing something
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 15 07 *
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
npm_deprecate:
|
||||
name: Create issue for deprecating npm packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Issue Bot Action
|
||||
uses: imjohnbo/[email protected]
|
||||
with:
|
||||
assignees: nicolo-ribaudo
|
||||
title: "Deprecate renamed npm packages"
|
||||
body: |-
|
||||
Please run these commands:
|
||||
```
|
||||
npm deprecate @babel/plugin-proposal-explicit-resource-management "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-explicit-resource-management instead."
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
name: REPL
|
||||
|
||||
on: [pull_request_target]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
repl-comment:
|
||||
name: Create or update REPL comment
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/github-script@v8
|
||||
with:
|
||||
github-token: ${{ secrets.BOT_TOKEN }}
|
||||
script: |
|
||||
const { default: repl } = await import('${{ github.workspace }}/scripts/actions/repl.ts');
|
||||
await repl(github, context);
|
||||
@@ -1,81 +0,0 @@
|
||||
name: Update compat data
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
schedule:
|
||||
- cron: "0 0 * * 5"
|
||||
|
||||
jobs:
|
||||
createPullRequest:
|
||||
name: Update compat-table
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
repository: kangax/compat-table
|
||||
path: packages/babel-compat-data/build/compat-table
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "*"
|
||||
- name: Get latest kangax/compat-table commit
|
||||
id: lastCommit
|
||||
run: echo "sha1=$(./scripts/update-compat-table/get-last-commit.sh)" >> $GITHUB_OUTPUT
|
||||
- name: Update compat-table commit
|
||||
run: echo ${{ steps.lastCommit.outputs.sha1 }} | ./scripts/update-compat-table/bump-compat-table-commit.sh
|
||||
- name: Check if it has been updated
|
||||
run: |
|
||||
[[ -z $(git status -s) ]] &&
|
||||
echo "updated=false" >> $GITHUB_OUTPUT ||
|
||||
echo "updated=true" >> $GITHUB_OUTPUT
|
||||
id: updated
|
||||
- name: Bootstrap
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
run: make bootstrap
|
||||
- name: Run update script
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
run: make build-compat-data
|
||||
- name: Commit compat-data changes
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
run: |
|
||||
git config user.name "Babel Bot"
|
||||
git config user.email "[email protected]"
|
||||
git checkout -b update-compat-data
|
||||
git commit -am "chore: update compat data to ${{ steps.lastCommit.outputs.sha1 }}"
|
||||
- name: Update tests and commit test fixtures
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
yarn jest -u
|
||||
git commit -am "chore: update test fixtures"
|
||||
env:
|
||||
OVERWRITE: true
|
||||
- name: Update tests (Babel 8) and commit test fixtures
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
continue-on-error: true
|
||||
run: |
|
||||
yarn jest -u
|
||||
git commit -am "chore: update test fixtures for Babel 8"
|
||||
env:
|
||||
OVERWRITE: true
|
||||
BABEL_8_BREAKING: true
|
||||
- name: Push changes
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
run: |
|
||||
git push --force origin update-compat-data
|
||||
- name: Create Pull Request
|
||||
if: steps.updated.outputs.updated == 'true'
|
||||
uses: babel/actions/create-pull-request@v2
|
||||
with:
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
branch: update-compat-data
|
||||
title: Update compat data
|
||||
description: Update compat data to [${{ steps.lastCommit.outputs.sha1 }}](https://github.com/kangax/compat-table/commit/${{ steps.lastCommit.outputs.sha1 }}).
|
||||
labels: |
|
||||
area: compat-table
|
||||
repo automation :robot:
|
||||
@@ -1,59 +0,0 @@
|
||||
name: Update Test262 parser tests
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
schedule:
|
||||
- cron: "0 0 * * 5"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
createPullRequest:
|
||||
name: Update parser test262 tests
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
repository: tc39/test262
|
||||
path: build/test262
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "*"
|
||||
cache: "yarn"
|
||||
- name: Get latest test262 version
|
||||
id: test262
|
||||
run: echo "sha1=$(sh ./scripts/parser-tests/get-test262-version.sh)" >> $GITHUB_OUTPUT
|
||||
- name: Update test262 commit
|
||||
run: |
|
||||
echo ${{ steps.test262.outputs.sha1 }} | ./scripts/parser-tests/bump-test262-version.sh
|
||||
- name: Build babel parser
|
||||
run: |
|
||||
yarn install --immutable --mode=skip-build
|
||||
yarn gulp build-rollup
|
||||
- name: Update test262 allow list
|
||||
run: |
|
||||
make test-test262-update-allowlist
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config user.name "Babel Bot"
|
||||
git config user.email "[email protected]"
|
||||
git checkout -b update-test262-parser
|
||||
git commit -am "chore: update test262 to ${{ steps.test262.outputs.sha1 }}"
|
||||
git push --force origin update-test262-parser
|
||||
- name: Create Pull Request
|
||||
uses: babel/actions/create-pull-request@v2
|
||||
with:
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
branch: update-test262-parser
|
||||
title: Update test262
|
||||
description: Update test262 to [${{ steps.test262.outputs.sha1 }}](https://github.com/tc39/test262/commit/${{ steps.test262.outputs.sha1 }}).
|
||||
labels: |
|
||||
area: test262
|
||||
repo automation :robot:
|
||||
@@ -1,75 +0,0 @@
|
||||
name: Update Windows Fixtures
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pull_request:
|
||||
description: Pull Request number
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-windows-fixtures:
|
||||
permissions:
|
||||
contents: read # to fetch code
|
||||
pull-requests: read # to get PR metadata
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Get Pull Request branch
|
||||
uses: actions/github-script@v6
|
||||
id: pr-meta
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: pullRequest } = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: ${{ github.event.inputs.pull_request }},
|
||||
});
|
||||
|
||||
const {
|
||||
ref: branch,
|
||||
repo: { full_name: repository }
|
||||
} = pullRequest.head;
|
||||
|
||||
const fs = require("fs");
|
||||
const { GITHUB_OUTPUT } = process.env;
|
||||
fs.appendFileSync(GITHUB_OUTPUT, `branch=${branch}\n`);
|
||||
fs.appendFileSync(GITHUB_OUTPUT, `repository=${repository}\n`);
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: ${{ steps.pr-meta.outputs.repository }}
|
||||
ref: ${{ steps.pr-meta.outputs.branch }}
|
||||
fetch-depth: 0 # Otherwise we cannot push
|
||||
persist-credentials: false # So that we can push with BOT_TOKEN, otherwise it doesn't trigger CI
|
||||
|
||||
- name: Use Node.js latest
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "*"
|
||||
cache: "yarn"
|
||||
|
||||
- name: Install and build
|
||||
# make bootstrap modifies some files (babel-runtime-*/package.json), so we reset them
|
||||
run: |
|
||||
make -j bootstrap
|
||||
git reset --hard HEAD
|
||||
|
||||
- name: Regenerate fixtures
|
||||
run: |
|
||||
yarn jest -u --ci || true
|
||||
env:
|
||||
BABEL_ENV: test
|
||||
OVERWRITE: true
|
||||
|
||||
- name: Commit updates
|
||||
run: |
|
||||
git config user.name "Babel Bot"
|
||||
git config user.email "[email protected]"
|
||||
git add .
|
||||
git commit -m "Update fixtures (Windows)" --no-verify --quiet
|
||||
git push "https://babel-bot:${{ secrets.BOT_TOKEN }}@github.com/${{ steps.pr-meta.outputs.repository }}.git" ${{ steps.pr-meta.outputs.branch }}
|
||||
Reference in New Issue
Block a user