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
1 change: 0 additions & 1 deletion scripts/release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"prompt-promise": "^1.0.3",
"puppeteer": "^1.11.0",
"pushstate-server": "^3.0.1",
"request-promise-json": "^1.0.4",
"semver": "^5.4.1"
}
}
8 changes: 7 additions & 1 deletion scripts/release/shared-commands/download-build-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ const run = async ({build, cwd, releaseChannel}) => {
}

// Download and extract artifact
const {CIRCLE_CI_API_TOKEN} = process.env;
if (CIRCLE_CI_API_TOKEN == null) {
throw new Error(
`Expected a CircleCI token to download artifacts, got ${CIRCLE_CI_API_TOKEN}`
);
}
await exec(`rm -rf ./build`, {cwd});
await exec(
`curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`,
`curl -L $(fwdproxy-config curl) ${buildArtifacts.url} -H "Circle-Token: ${CIRCLE_CI_API_TOKEN}" | tar -xvz`,
{
cwd,
}
Expand Down
16 changes: 13 additions & 3 deletions scripts/release/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {createPatch} = require('diff');
const {hashElement} = require('folder-hash');
const {existsSync, readFileSync, writeFileSync} = require('fs');
const {readJson, writeJson} = require('fs-extra');
const http = require('request-promise-json');
const fetch = require('node-fetch');
const logUpdate = require('log-update');
const {join} = require('path');
const createLogger = require('progress-estimator');
Expand Down Expand Up @@ -59,9 +59,19 @@ const extractCommitFromVersionNumber = version => {
};

const getArtifactsList = async buildID => {
const {CIRCLE_CI_API_TOKEN} = process.env;
if (CIRCLE_CI_API_TOKEN == null) {
throw new Error(
`Expected a CircleCI token to download artifacts, got ${CIRCLE_CI_API_TOKEN}`
);
}
const jobArtifactsURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${buildID}/artifacts`;
const jobArtifacts = await http.get(jobArtifactsURL, true);
return jobArtifacts;
const jobArtifacts = await fetch(jobArtifactsURL, {
headers: {
'Circle-Token': CIRCLE_CI_API_TOKEN,
},
});
return jobArtifacts.json();
};

const getBuildInfo = async () => {
Expand Down
Loading