Skip to content

Commit f704d80

Browse files
committed
Test release with private packages
1 parent 85acb8a commit f704d80

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

.github/workflows/runtime_prereleases_manual.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
publish_prerelease_canary:
5353
if: ${{ !inputs.experimental_only }}
5454
name: Publish to Canary channel
55-
uses: facebook/react/.github/workflows/runtime_prereleases.yml@main
55+
uses: eps1lon/react/.github/workflows/runtime_prereleases.yml@sebbie/test-new-release
5656
permissions:
5757
# We use github.token to download the build artifact from a previous runtime_build_and_test.yml run
5858
actions: read
@@ -79,7 +79,7 @@ jobs:
7979

8080
publish_prerelease_experimental:
8181
name: Publish to Experimental channel
82-
uses: facebook/react/.github/workflows/runtime_prereleases.yml@main
82+
uses: eps1lon/react/.github/workflows/runtime_prereleases.yml@sebbie/test-new-release
8383
permissions:
8484
# We use github.token to download the build artifact from a previous runtime_build_and_test.yml run
8585
actions: read

packages/react-dom/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"name": "react-dom",
2+
"name": "@eps1lon/react-dom",
3+
"publishConfig": {
4+
"access": "public"
5+
},
36
"version": "19.3.0",
47
"description": "React package for working with the DOM.",
58
"main": "index.js",

packages/react/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"name": "react",
2+
"name": "@eps1lon/react",
3+
"publishConfig": {
4+
"access": "public"
5+
},
36
"description": "React is a JavaScript library for building user interfaces.",
47
"keywords": [
58
"react"

packages/scheduler/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"name": "scheduler",
2+
"name": "@eps1lon/scheduler",
3+
"publishConfig": {
4+
"access": "public"
5+
},
36
"version": "0.28.0",
47
"description": "Cooperative scheduler for the browser environment.",
58
"repository": {

scripts/release/prepare-release-from-ci.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const run = async () => {
2222
await downloadBuildArtifacts({
2323
commit: params.commit,
2424
releaseChannel: params.releaseChannel ?? process.env.RELEASE_CHANNEL,
25+
noVerify: true,
2526
});
2627

2728
if (!params.skipTests) {

scripts/release/prepare-release-from-npm-commands/check-out-packages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const run = async (packages, versionsMap, {cwd, prerelease}) => {
3737
// which we had to remove as a separate step before re-publishing.
3838
// It's easier for us to just download and extract the tarball.
3939
const url = await execRead(
40-
`npm view ${packageName}@${version} dist.tarball`
40+
`npm view @eps1lon/${packageName}@${version} dist.tarball`
4141
);
4242
const filePath = join(nodeModulesPath, `${packageName}.tgz`);
4343
const packagePath = join(nodeModulesPath, `${packageName}`);

scripts/release/publish-commands/check-npm-permissions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const run = async ({cwd, packages, version}) => {
1010
const failedProjects = [];
1111

1212
const checkProject = async project => {
13-
const owners = (await execRead(`npm owner ls ${project}`))
13+
const owners = (await execRead(`npm owner ls @eps1lon/${project}`))
1414
.split('\n')
1515
.filter(owner => owner)
1616
.map(owner => owner.split(' ')[0]);

scripts/release/shared-commands/download-build-artifacts.js

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ if (process.env.GH_TOKEN == null) {
1414
process.exit(1);
1515
}
1616

17-
const OWNER = 'facebook';
18-
const REPO = 'react';
17+
const repository = 'eps1lon/react';
1918
const WORKFLOW_ID = 'runtime_build_and_test.yml';
2019
const GITHUB_HEADERS = `
2120
-H "Accept: application/vnd.github+json" \
@@ -48,16 +47,15 @@ function getWorkflowId() {
4847
}
4948

5049
async function getWorkflowRun(commit) {
51-
const res = await exec(
52-
`curl -L ${GITHUB_HEADERS} https://api.github.com/repos/${OWNER}/${REPO}/actions/workflows/${getWorkflowId()}/runs?head_sha=${commit}`
53-
);
50+
const url = `https://api.github.com/repos/${repository}/actions/workflows/${getWorkflowId()}/runs?head_sha=${commit}`;
51+
const res = await exec(`curl -L ${GITHUB_HEADERS} ${url}`);
5452

5553
const json = JSON.parse(res.stdout);
5654
const workflowRun = json.workflow_runs.find(run => run.head_sha === commit);
5755

5856
if (workflowRun == null || workflowRun.id == null) {
5957
console.log(
60-
theme`{error The workflow run for the specified commit (${commit}) could not be found.}`
58+
theme`{error The workflow run for the specified commit (${commit}) could not be found in ${url}}`
6159
);
6260
process.exit(1);
6361
}
@@ -67,7 +65,7 @@ async function getWorkflowRun(commit) {
6765

6866
async function getArtifact(workflowRunId, artifactName) {
6967
const res = await exec(
70-
`curl -L ${GITHUB_HEADERS} https://api.github.com/repos/${OWNER}/${REPO}/actions/runs/${workflowRunId}/artifacts?per_page=100&name=${artifactName}`
68+
`curl -L ${GITHUB_HEADERS} https://api.github.com/repos/${repository}/actions/runs/${workflowRunId}/artifacts?per_page=100&name=${artifactName}`
7169
);
7270

7371
const json = JSON.parse(res.stdout);
@@ -77,7 +75,7 @@ async function getArtifact(workflowRunId, artifactName) {
7775

7876
if (artifact == null) {
7977
console.log(
80-
theme`{error The specified workflow run (${workflowRunId}) does not contain any build artifacts.}`
78+
theme`{error The specified workflow run (${workflowRunId}) does not contain any artifact named ${artifactName}.}`
8179
);
8280
process.exit(1);
8381
}
@@ -103,7 +101,7 @@ async function processArtifact(artifact, opts) {
103101
// Use https://cli.github.com/manual/gh_attestation_verify to verify artifact
104102
if (executableIsAvailable('gh')) {
105103
await exec(
106-
`gh attestation verify artifacts_combined.zip --repo=${OWNER}/${REPO}`,
104+
`gh attestation verify artifacts_combined.zip --repo=${repository}`,
107105
{
108106
cwd: tmpDir,
109107
}
@@ -175,20 +173,12 @@ async function downloadArtifactsFromGitHub(opts) {
175173
break;
176174
}
177175
case 'completed': {
178-
if (workflowRun.conclusion === 'success') {
179-
const artifact = await getArtifact(
180-
workflowRun.id,
181-
'artifacts_combined'
182-
);
183-
await processArtifact(artifact, opts);
184-
return;
185-
} else {
186-
console.log(
187-
theme`{error Could not download build as its conclusion was: ${workflowRun.conclusion}}`
188-
);
189-
process.exit(1);
190-
}
191-
break;
176+
const artifact = await getArtifact(
177+
workflowRun.id,
178+
'artifacts_combined'
179+
);
180+
await processArtifact(artifact, opts);
181+
return;
192182
}
193183
default: {
194184
console.log(

0 commit comments

Comments
 (0)