Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Build, publish, and smoke-test @fs/react-scripts. Replaces .travis.yml.
#
# Every run publishes a CI prerelease of @fs/react-scripts to Artifactory, then
# scaffolds a real app against that exact prerelease and builds/tests it. That
# scaffolded app is the only real test in this pipeline -- the root `npm test`
# and `npm run test:integration` scripts are both stubbed to an echo.
#
# Pushes to the three release branches additionally publish the committed
# version of @fs/react-scripts.

name: CI

# The repo default is a read/write GITHUB_TOKEN. Nothing here touches the
# GitHub API -- checkout only reads, and both publishes authenticate to
# Artifactory with NODE_AUTH_TOKEN -- so drop the token to read-only rather
# than leave a write-scoped credential in the environment while `npm install`
# runs lifecycle scripts from the whole dependency tree.
permissions:
contents: read

on:
push:
branches: [frontierMaster, v7.x, next]
pull_request:
branches-ignore: [master]
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-publish:
name: build-and-publish
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4

# Replaces the whole .travis.yml `before_install` block, which hand-wrote
# .npmrc in three places.
#
# No `scope:` on purpose. With a scope, setup-node writes `@fs:registry=`
# and only @fs packages resolve through Artifactory; without one it writes
# a bare `registry=` line, so ALL traffic goes through the jfrog virtual
# registry as it did on Travis. That keeps jfrog curation in play -- see
# the E403 diagnostic in publishPrReleaseAndCreateFreshCraTemplate.js.
#
# setup-node exports NPM_CONFIG_USERCONFIG and NODE_AUTH_TOKEN job-wide,
# so auth survives every later step and every `cd`.
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: https://familysearch.jfrog.io/artifactory/api/npm/fs-npm-prod-virtual/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

# Plain `npm install`, matching Travis. `npm ci` would fail in
# packages/react-scripts, which has no lockfile of its own. The `cd` is
# what Travis did -- `--prefix` has different semantics inside an npm
# workspaces root, so don't "simplify" it.
- name: Install
run: |
set -euo pipefail
npm install
cd packages/react-scripts
npm install

- name: Publish CI prerelease and scaffold a fresh app
run: node publishPrReleaseAndCreateFreshCraTemplate.js

# The scaffolded app lives at $HOME/tmp/fresh-cra-template, hardcoded in
# the script above. `working-directory:` cannot expand $HOME, so cd here.
- name: Smoke test the scaffolded app
run: |
set -euo pipefail
cd "$HOME/tmp/fresh-cra-template"
CI=true npm test
npm run build

# Replaces the three identical `deploy: provider: script` entries.
- name: Publish release
if: github.event_name == 'push'
working-directory: packages/react-scripts
run: npm run fs-publish
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
32 changes: 0 additions & 32 deletions .github/workflows/integration.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG-FRONTIER.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 8.16.3

- Migrate CI from Travis to GitHub Actions (`.github/workflows/ci.yml`); delete `.travis.yml`
- CI prereleases are now labeled `X.Y.Z-prerelease.<github-run-number>` instead of `X.Y.Z-TravisPrerelease.<travis-build-number>`. `GITHUB_RUN_NUMBER` restarts at 1, but semver compares alphanumeric prerelease identifiers in ASCII order and `'T'` (84) < `'p'` (112), so `8.17.0-prerelease.1` still sorts above `8.17.0-TravisPrerelease.2311` and the `next` dist-tag does not move backwards
- `frontierInit.js` now reads `GITHUB_REPOSITORY` / `GITHUB_RUN_NUMBER` instead of `TRAVIS_REPO_SLUG` / `TRAVIS_BUILD_NUMBER`. `getTravisPrereleaseVersion` is renamed to `getCiPrereleaseVersion`, with the old name kept as a deprecated alias for one release since this module is a public export
- Artifactory auth now comes from `actions/setup-node`'s `registry-url` rather than three hand-written `.npmrc` files. `scope` is deliberately omitted so a bare `registry=` line is written and *all* packages keep resolving through the jfrog virtual registry, preserving curation enforcement
- `init.js` no longer git-inits or git-commits the scaffolded app when running in this repo's own CI. The runner has no git identity, so the commit failed and `init.js` then deleted the `.git` directory it had just created — noise in the log for no result. Gated on the new `isFrontierCi()` helper, so behavior is unchanged for anyone actually running `create-react-app`
- Also removes upstream Facebook CI config that had been dead since the fork: `azure-pipelines.yml`, `azure-pipelines-test-job.yml`, `.github/workflows/integration.yml`, and the Azure build badge in `README.md` (all keyed to a `main` branch this fork does not have)

## 8.16.2

- Bump `resolve-url-loader` from `^4.0.0` to `^5.0.0` to drop the transitive `postcss@7.0.39`, which Artifactory's security policy now blocks (403 Forbidden), breaking `npm install` on every consuming app's build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Please read through
- README-FRONTIER.md
- CHANGELOG-FRONTIER.md

# Create React App [![Build Status](https://dev.azure.com/facebook/create-react-app/_apis/build/status/facebook.create-react-app?branchName=main)](https://dev.azure.com/facebook/create-react-app/_build/latest?definitionId=1&branchName=main) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)
# Create React App [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://github.com/facebook/create-react-app/blob/main/CONTRIBUTING.md)

<img alt="Logo" align="right" src="https://create-react-app.dev/img/logo.svg" width="20%" />

Expand Down
41 changes: 0 additions & 41 deletions azure-pipelines-test-job.yml

This file was deleted.

77 changes: 0 additions & 77 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion freshCraTemplateUpdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sed -i.bak 's/#//' blueprint.yml

# @fs/react-scripts dep version points to the local file (cause of `npx create-react-app file:localReactScriptsPath`),
# so we need to replace that with the actual version
NEW_CRA_VERSION=$(json -f ${TRAVIS_BUILD_DIR}/packages/react-scripts/package.json version)
NEW_CRA_VERSION=$(json -f ${GITHUB_WORKSPACE}/packages/react-scripts/package.json version)
echo "NEW_CRA_VERSION: $NEW_CRA_VERSION"
json -I -f package.json -e "this.dependencies[\"@fs/react-scripts\"]=\"$NEW_CRA_VERSION\""

Expand Down
4 changes: 2 additions & 2 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/react-scripts",
"version": "8.16.2",
"version": "8.16.3",
"upstreamVersion": "5.0.1",
"description": "Configuration and scripts for Create React App.",
"repository": {
Expand All @@ -10,7 +10,7 @@
},
"license": "MIT",
"engines": {
"node": ">=20.0.0"
"node": ">=24.0.0"
},
"bugs": {
"url": "https://github.com/fs-webdev/create-react-app/issues"
Expand Down
10 changes: 7 additions & 3 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const spawn = require('react-dev-utils/crossSpawn');
const { defaultBrowsers } = require('react-dev-utils/browsersHelper');
const os = require('os');
const verifyTypeScriptSetup = require('./utils/verifyTypeScriptSetup');
const { setupFrontier } = require('./utils/frontierInit');
const { setupFrontier, isFrontierCi } = require('./utils/frontierInit');

function isInGitRepository() {
try {
Expand Down Expand Up @@ -288,10 +288,14 @@ module.exports = function (
);
}

// Initialize git repo
// Initialize git repo.
// Skipped in this repo's own CI. The app scaffolded there is a throwaway
// smoke test, and the runner has no git identity, so tryGitCommit() below
// would fail and init.js would then delete the .git directory it had just
// created -- a lot of noise in the log for no result.
let initializedGit = false;

if (tryGitInit()) {
if (!isFrontierCi() && tryGitInit()) {
initializedGit = true;
console.log();
console.log('Initialized a git repository.');
Expand Down
Loading
Loading