Skip to content

Commit c8466c6

Browse files
committed
Build: Remove pushing of release artefact to Git commit
Cherry-picked from e9e3ecf (3.0.0-dev): > Build: Remove pushing of release artefact to detached Git commit Cherry-picked from 666890b (3.0.0-dev): > Build: Combine build+prep
1 parent 47e32ea commit c8466c6

File tree

7 files changed

+41
-7829
lines changed

7 files changed

+41
-7829
lines changed

RELEASE.md

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This guide walks you through the QUnit release.
44

55
QUnit aims for its releases to be reproducible. Recent releases are automatically verified on a regular basis ([reproducible builds status](https://github.com/qunitjs/qunit/actions/workflows/reproducible.yaml)). Read more on [Wikipedia](https://en.wikipedia.org/wiki/Reproducible_builds), and [reproducible-builds.org](https://reproducible-builds.org/).
66

7-
87
⚠️ **WARNING** ⚠️
98

109
> Before starting, make sure you have:
@@ -14,12 +13,14 @@ QUnit aims for its releases to be reproducible. Recent releases are automaticall
1413
>
1514
> System prerequisites:
1615
>
17-
> * Node.js 14, or later.
16+
> * Node.js 18, or later.
1817
> * Git 2.11, or later.
1918
2019
Ensure that all changes for this release have been merged into the main branch. For patch releases, try landing any other bug fixes; for minor releases, ensure new features have been documented and tested. Major releases likely have their own checklist.
2120

22-
1. Create a local `release` branch, and ensure it is up-to-date:
21+
## Preparing the release
22+
23+
1. Create a local `release` branch, and ensure it is up-to-date:
2324
Verify that the canonical repository is cloned (not a fork):
2425
```
2526
git remote -v
@@ -36,7 +37,7 @@ Ensure that all changes for this release have been merged into the main branch.
3637
npm ci
3738
```
3839

39-
3. Create the release preparation commit:
40+
3. Prepare for the release commit:
4041
```
4142
node build/prep-release.js @VERSION
4243
```
@@ -45,24 +46,6 @@ Ensure that all changes for this release have been merged into the main branch.
4546
* In `AUTHORS.txt`, if you see duplicate entries, then use the `.mailmap` file to normalize them to a canonical name and e-mail address, and then re-run the above command.
4647
* Edit `History.md` to remove changes not relevant to end-users (e.g. changes relating to tests, build, internal refactoring, doc fixes, etc.).
4748

48-
Commit your changes with the following message (replace `@VERSION` with the release version):
49-
```
50-
Build: Prepare @VERSION release
51-
```
52-
53-
Push the `release` branch to GitHub.
54-
Once CI is passing, push again, this time to the (protected) `main` branch.
55-
56-
## Performing the release
57-
58-
Verify that your local repo is at the release preparation commit:
59-
60-
```
61-
git show
62-
# Build: Prepare x.y.z release
63-
# …
64-
```
65-
6649
4. Build the release:
6750
```
6851
node build/build-release.js @VERSION
@@ -73,13 +56,38 @@ git show
7356
```
7457
node build/review-package.js @LAST_VERSION
7558
76-
# … reviews package.json, qunit.js, and qunit.css
59+
# … review package.json, qunit.js, and qunit.css
60+
```
61+
62+
Commit your changes with the following message (replace `@VERSION` with the release version):
7763
```
64+
Release @VERSION
65+
```
66+
67+
Push a `release` branch to GitHub.
68+
Once CI is passing, push again, this time to the (protected) `stable-2.x` branch.
69+
70+
## Publish the release
71+
72+
Verify that your local repo is on a clean checkout with HEAD at the release commit:
73+
74+
```
75+
git show
76+
# Release x.y.z
77+
# …
78+
```
79+
80+
And that you have release artefacts from the previous step in your working directory (i.e. same version, and not a "dev" version). If you don't have this, go back to step 4 "Build the release".
81+
82+
```
83+
head qunit/qunit.js
84+
# /*!
85+
# * QUnit x.y.z
86+
# …
87+
```
7888

79-
5. Publish to GitHub.<br>⚠️ Do not push to the main branch!
89+
5. Publish tag to GitHub.
8090
```
81-
git add -f package.json qunit/
82-
git commit -m "Release @VERSION"
8391
git tag -s "@VERSION" -m "Release @VERSION"
8492
git push --tags
8593
```
@@ -100,24 +108,6 @@ git show
100108
```
101109
Verify that the release is listed at <https://code.jquery.com/qunit/> and that you can open the JS/CSS files.
102110
103-
## Updating the website
104-
105-
After the release is published, we need to update the website.
106-
107-
Check out the main branch of the [qunitjs/qunit](https://github.com/qunitjs/qunit) repository, and ensure it is clean and up-to-date. Run the following script, which will update release links and demos to use the new version:
108-
109-
```
110-
qunit$ node build/site-set-version.js VERSION
111-
```
112-
113-
Stage the changes it made, and commit with the following message:
114-
115-
```
116-
Docs: Update url and version to VERSION
117-
```
118-
119-
Push the commit to a branch on origin, wait CI checks to complete, then re-push to the main branch. Check the website in a few minutes to verify the change ([deployment log](https://github.com/qunitjs/qunit/deployments/activity_log?environment=github-pages)).
120-
121111
## Final steps
122112
123113
You're almost there! Make sure you update [GitHub releases](https://github.com/qunitjs/qunit/releases) using the changelog from `History.md`.

build/build-release.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ const Repo = {
2929
}
3030
{
3131
const file = 'package.json';
32-
console.log(`Updating ${file}...`);
32+
console.log(`Checking ${file}...`);
3333
const filePath = path.join(__dirname, '..', file);
3434
const json = fs.readFileSync(filePath, 'utf8');
35-
const packageIndentation = json.match(/\n([\t\s]+)/)[1];
3635
const data = JSON.parse(json);
3736

38-
data.version = version;
39-
data.author.url = data.author.url.replace('main', version);
40-
41-
fs.writeFileSync(
42-
filePath,
43-
JSON.stringify(data, null, packageIndentation) + '\n'
44-
);
37+
if (data.version !== version) {
38+
throw new Error('Must run build-release on release commit, found package.version at ' + data.version);
39+
}
4540
}
4641
{
4742
console.log('Running `npm run build`...');

build/prep-release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Repo = {
111111
const packageIndentation = json.match(/\n([\t\s]+)/)[1];
112112
const data = JSON.parse(json);
113113

114-
data.version = `${version}-pre`;
114+
data.version = version;
115115

116116
fs.writeFileSync(
117117
filePath,
@@ -126,7 +126,7 @@ const Repo = {
126126
const packageIndentation = json.match(/\n([\t\s]+)/)[1];
127127
const data = JSON.parse(json);
128128

129-
data.version = data.packages[''].version = `${version}-pre`;
129+
data.version = data.packages[''].version = version;
130130

131131
fs.writeFileSync(
132132
filePath,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://qunitjs.com",
77
"author": {
88
"name": "OpenJS Foundation and other contributors",
9-
"url": "https://github.com/qunitjs/qunit/blob/2.21.1/AUTHORS.txt"
9+
"url": "https://github.com/qunitjs/qunit/blob/main/AUTHORS.txt"
1010
},
1111
"repository": {
1212
"type": "git",

0 commit comments

Comments
 (0)