@@ -2,7 +2,7 @@ name: Commit Artifacts for Meta WWW and fbsource
2
2
3
3
on :
4
4
push :
5
- branches : [main, meta-www, meta-fbsource]
5
+ branches : [main, meta-www, meta-fbsource, rh/test-ci-new ]
6
6
7
7
jobs :
8
8
download_artifacts :
@@ -72,53 +72,55 @@ jobs:
72
72
});
73
73
}
74
74
75
- let artifactsUrl = null;
76
- // This is a temporary, dirty hack to avoid needing a GitHub auth token in the circleci
77
- // workflow to notify this GitHub action. Sorry!
78
- let iter = 0;
79
- spinloop: while (iter < 15) {
80
- const res = await github.rest.repos.listCommitStatusesForRef({
81
- owner: context.repo.owner,
82
- repo: context.repo.repo,
83
- ref: context.sha
84
- });
85
- for (const status of res.data) {
86
- if (/process_artifacts_combined/.test(status.context)) {
87
- switch (status.state) {
88
- case 'pending': {
89
- console.log(`${status.context} is still pending`);
90
- break;
91
- }
92
- case 'failure':
93
- case 'error': {
94
- throw new Error(`${status.context} has failed or errored`);
95
- }
96
- case 'success': {
97
- // The status does not include a build ID, but we can extract it
98
- // from the URL. I couldn't find a better way to do this.
99
- const ciBuildId = /\/facebook\/react\/([0-9]+)/.exec(
100
- status.target_url,
101
- )[1];
102
- if (Number.parseInt(ciBuildId, 10) + '' === ciBuildId) {
103
- artifactsUrl =
104
- `https://circleci.com/api/v1.1/project/github/facebook/react/${ciBuildId}/artifacts`;
105
- console.log(`Found artifactsUrl: ${artifactsUrl}`);
106
- break spinloop;
107
- } else {
108
- throw new Error(`${ciBuildId} isn't a number`);
75
+ let artifactsUrl = `https://circleci.com/api/v1.1/project/github/facebook/react/905149/artifacts`;
76
+ if (!artifactsUrl) {
77
+ // This is a temporary, dirty hack to avoid needing a GitHub auth token in the circleci
78
+ // workflow to notify this GitHub action. Sorry!
79
+ let iter = 0;
80
+ spinloop: while (iter < 15) {
81
+ const res = await github.rest.repos.listCommitStatusesForRef({
82
+ owner: context.repo.owner,
83
+ repo: context.repo.repo,
84
+ ref: context.sha
85
+ });
86
+ for (const status of res.data) {
87
+ if (/process_artifacts_combined/.test(status.context)) {
88
+ switch (status.state) {
89
+ case 'pending': {
90
+ console.log(`${status.context} is still pending`);
91
+ break;
92
+ }
93
+ case 'failure':
94
+ case 'error': {
95
+ throw new Error(`${status.context} has failed or errored`);
96
+ }
97
+ case 'success': {
98
+ // The status does not include a build ID, but we can extract it
99
+ // from the URL. I couldn't find a better way to do this.
100
+ const ciBuildId = /\/facebook\/react\/([0-9]+)/.exec(
101
+ status.target_url,
102
+ )[1];
103
+ if (Number.parseInt(ciBuildId, 10) + '' === ciBuildId) {
104
+ artifactsUrl =
105
+ `https://circleci.com/api/v1.1/project/github/facebook/react/${ciBuildId}/artifacts`;
106
+ console.log(`Found artifactsUrl: ${artifactsUrl}`);
107
+ break spinloop;
108
+ } else {
109
+ throw new Error(`${ciBuildId} isn't a number`);
110
+ }
111
+ break;
112
+ }
113
+ default: {
114
+ throw new Error(`Unhandled status state: ${status.state}`);
115
+ break;
109
116
}
110
- break;
111
- }
112
- default: {
113
- throw new Error(`Unhandled status state: ${status.state}`);
114
- break;
115
117
}
116
118
}
117
119
}
120
+ iter++;
121
+ console.log("Sleeping for 60s...");
122
+ await sleep(60_000);
118
123
}
119
- iter++;
120
- console.log("Sleeping for 60s...");
121
- await sleep(60_000);
122
124
}
123
125
if (artifactsUrl != null) {
124
126
const {CIRCLECI_TOKEN} = process.env;
@@ -222,7 +224,7 @@ jobs:
222
224
223
225
commit_www_artifacts :
224
226
needs : download_artifacts
225
- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' }}
227
+ if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' || github.ref == 'refs/heads/rh/test-ci-new' }}
226
228
runs-on : ubuntu-latest
227
229
steps :
228
230
- uses : actions/checkout@v4
@@ -305,7 +307,7 @@ jobs:
305
307
306
308
commit_fbsource_artifacts :
307
309
needs : download_artifacts
308
- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
310
+ if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' || github.ref == 'refs/heads/rh/test-ci-new' }}
309
311
runs-on : ubuntu-latest
310
312
steps :
311
313
- uses : actions/checkout@v4
@@ -389,7 +391,7 @@ jobs:
389
391
}
390
392
return data.replace(NEWTOKEN, `SignedSource<<${hash(data, 'utf8')}>>`);
391
393
},
392
- };
394
+ };
393
395
394
396
const directory = './compiled-rn';
395
397
console.log('Signing files in directory:', directory);
@@ -499,7 +501,7 @@ jobs:
499
501
}
500
502
return data.replace(NEWTOKEN, `SignedSource<<${hash(data, 'utf8')}>>`);
501
503
},
502
- };
504
+ };
503
505
504
506
const directory = './compiled-rn';
505
507
console.log('Signing files in directory:', directory);
0 commit comments