Skip to content

Commit 289dcc7

Browse files
Replace nightly with canary releases
1 parent f0ff4ed commit 289dcc7

File tree

5 files changed

+2416
-2735
lines changed

5 files changed

+2416
-2735
lines changed

.github/workflows/canary-release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This workflow builds and releases all packages on the main branch with a canary
2+
# dist tag. These packages contain changes that are not yet available in a publicly
3+
# released version of Parcel.
4+
name: canary-release
5+
6+
on:
7+
push:
8+
branches:
9+
- v2
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-release:
14+
name: Build and release canary
15+
uses: ./.github/workflows/release.yml
16+
secrets: inherit
17+
with:
18+
release-command: |
19+
yarn canary:release --summary-file
20+
node scripts/tag-release.mjs --tag nightly

.github/workflows/nightly-release.yml

-218
This file was deleted.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"test:integration-ci": "yarn workspace @parcel/integration-tests test-ci",
3232
"test": "yarn test:unit && yarn test:integration",
3333
"dev:release": "lerna publish -y --canary --preid dev --dist-tag=dev --exact --force-publish=* --no-git-tag-version --no-push",
34-
"nightly:release": "lerna publish -y --canary --preid nightly --dist-tag=nightly --exact --force-publish=* --no-git-tag-version --no-push",
34+
"canary:release": "lerna publish -y --canary --preid canary --dist-tag=canary --exact --force-publish=* --no-git-tag-version --no-push",
3535
"tag:prerelease": "lerna version --exact --force-publish=* --no-git-tag-version --no-push && yarn adjust-versions --exact",
3636
"tag:release": "lerna version --exact --force-publish=* --no-git-tag-version --no-push && yarn adjust-versions",
3737
"adjust-versions": "node scripts/update-config-dependencies.js && node scripts/update-engines-peerdeps.js",
@@ -53,7 +53,7 @@
5353
"gulp": "^4.0.2",
5454
"gulp-babel": "^8.0.0",
5555
"husky": "^6.0.0",
56-
"lerna": "^3.22.1",
56+
"lerna": "^6.6.2",
5757
"lint-staged": "^10.2.11",
5858
"mocha": "^8.3.0",
5959
"mocha-junit-reporter": "^2.0.0",

scripts/tag-release.mjs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* eslint-disable no-console */
2+
3+
import {execSync} from 'node:child_process';
4+
import {readFile} from 'node:fs/promises';
5+
import {URL} from 'node:url';
6+
7+
import program from 'commander';
8+
9+
async function main(tag) {
10+
let publishSummary = JSON.parse(
11+
await readFile(
12+
new URL('../lerna-publish-summary.json', import.meta.url).pathname,
13+
'utf8',
14+
),
15+
);
16+
17+
for (let {packageName, version} of publishSummary) {
18+
execSync(`npm dist-tag add ${packageName}@${version} ${tag}`, {
19+
encoding: 'utf8',
20+
});
21+
}
22+
}
23+
24+
let {tag} = program
25+
// TODO Use requiredOption once commander is upgraded in the root
26+
.option(
27+
'--tag <tag>',
28+
'The npm tag to add to every package published in the latest release',
29+
)
30+
.parse(process.argv);
31+
32+
if (!tag) {
33+
throw new Error('Required option `tag` not specified');
34+
}
35+
36+
main(tag).then(() => {
37+
console.log(`Successfully added @${tag} to released packages`);
38+
});

0 commit comments

Comments
 (0)