Skip to content

Commit fab0eb6

Browse files
committed
Simplify the release process (no more build script or release branches)
1 parent 54be0dc commit fab0eb6

File tree

9 files changed

+340
-146
lines changed

9 files changed

+340
-146
lines changed

.github/workflows/checkin.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/pr_checks.yml

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
name: PR Checks
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
tags: '*'
8+
concurrency:
9+
# Skip intermediate builds: all builds except for builds on the `master` branch
10+
# Cancel intermediate builds: only pull request builds
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
12+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
13+
permissions:
14+
contents: read
15+
jobs:
16+
finalize-pr-checks:
17+
if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
needs: [checked-in-files, build, test, make-targets, stalecheck-npm-install]
21+
steps:
22+
- run: |
23+
echo checked-in-files: ${{ needs.checked-in-files.result }}
24+
echo build: ${{ needs.build.result }}
25+
echo test: ${{ needs.test.result }}
26+
echo make-targets: ${{ needs.make-targets.result }}
27+
echo stalecheck-npm-install: ${{ needs.stalecheck-npm-install.result }}
28+
# The last line must NOT end with ||
29+
# All other lines MUST end with ||
30+
- run: exit 1
31+
if: |
32+
(needs.checked-in-files.result != 'success') ||
33+
(needs.build.result != 'success') ||
34+
(needs.test.result != 'success') ||
35+
(needs.make-targets.result != 'success') ||
36+
(needs.stalecheck-npm-install.result != 'success')
37+
checked-in-files:
38+
timeout-minutes: 30
39+
runs-on: ubuntu-latest
40+
strategy:
41+
fail-fast: false
42+
steps:
43+
### Check out the repo:
44+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
45+
with:
46+
persist-credentials: false
47+
### Cleanall:
48+
- run: make cleanall
49+
### Install NodeJS
50+
# Unix (non-Windows):
51+
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
52+
if: runner.os != 'Windows'
53+
- run: make unix-asdf-install
54+
if: runner.os != 'Windows'
55+
# Windows:
56+
# Windows does not support asdf, so we have to use `actions/setup-node`
57+
# to install asdf:
58+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
59+
if: runner.os == 'Windows'
60+
with:
61+
node-version-file: '.tool-versions'
62+
### Install the NodeJS packages that we depend on:
63+
- run: make install-packages
64+
### Print some debugging info:
65+
- name: Print the NodeJS version (for debugging)
66+
run: |
67+
which -a node
68+
node --version
69+
which -a npm
70+
npm --version
71+
### Build:
72+
- run: make pack
73+
### Clean (not cleanall!):
74+
- run: make clean
75+
### Make sure there are no uncommited changes
76+
- uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037
77+
with:
78+
version: '1'
79+
- run: git --no-pager status
80+
- run: git --no-pager diff
81+
- run: julia ./ci/check_uncommitted_changes.jl
82+
build:
83+
timeout-minutes: 30
84+
runs-on: ${{ matrix.os }}
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os:
89+
- ubuntu-latest
90+
steps:
91+
### Check out the repo:
92+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
93+
with:
94+
persist-credentials: false
95+
### Cleanall:
96+
- run: make cleanall
97+
### Install NodeJS
98+
# Unix (non-Windows):
99+
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
100+
if: runner.os != 'Windows'
101+
- run: make unix-asdf-install
102+
if: runner.os != 'Windows'
103+
# Windows:
104+
# Windows does not support asdf, so we have to use `actions/setup-node`
105+
# to install asdf:
106+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
107+
if: runner.os == 'Windows'
108+
with:
109+
node-version-file: '.tool-versions'
110+
### Install the NodeJS packages that we depend on:
111+
- run: make install-packages
112+
### Print some debugging info:
113+
- name: Print the NodeJS version (for debugging)
114+
run: |
115+
which -a node
116+
node --version
117+
which -a npm
118+
npm --version
119+
### Build:
120+
- run: make build
121+
- run: make pack
122+
### Make sure some other `make` targets don't bitrot:
123+
- name: Run some other `make` targets to ensure that they don't bitrot
124+
run: |
125+
make clean
126+
make cleanall
127+
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot
128+
run: |
129+
make clean
130+
make cleanall
131+
test:
132+
timeout-minutes: 30
133+
runs-on: ${{ matrix.os }}
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
os:
138+
- ubuntu-latest
139+
steps:
140+
### Check out the repo:
141+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
142+
with:
143+
persist-credentials: false
144+
### Cleanall:
145+
- run: make cleanall
146+
### Install NodeJS
147+
# Unix (non-Windows):
148+
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
149+
if: runner.os != 'Windows'
150+
- run: make unix-asdf-install
151+
if: runner.os != 'Windows'
152+
# Windows:
153+
# Windows does not support asdf, so we have to use `actions/setup-node`
154+
# to install asdf:
155+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
156+
if: runner.os == 'Windows'
157+
with:
158+
node-version-file: '.tool-versions'
159+
### Install the NodeJS packages that we depend on:
160+
- run: make install-packages
161+
### Print some debugging info:
162+
- name: Print the NodeJS version (for debugging)
163+
run: |
164+
which -a node
165+
node --version
166+
which -a npm
167+
npm --version
168+
### Build:
169+
- run: make build
170+
- run: make test
171+
make-targets: # This is a job to make sure that none of the `make` targets bitrot
172+
timeout-minutes: 30
173+
runs-on: ${{ matrix.os }}
174+
strategy:
175+
fail-fast: false
176+
matrix:
177+
os:
178+
- ubuntu-latest
179+
steps:
180+
### Check out the repo:
181+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
182+
with:
183+
persist-credentials: false
184+
### Cleanall:
185+
- run: make cleanall
186+
### Install NodeJS
187+
# Unix (non-Windows):
188+
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
189+
if: runner.os != 'Windows'
190+
- run: make unix-asdf-install
191+
if: runner.os != 'Windows'
192+
### Install the NodeJS packages that we depend on:
193+
- run: make install-packages
194+
### Make sure some other `make` targets don't bitrot:
195+
- name: Run some other `make` targets to ensure that they don't bitrot
196+
run: |
197+
make unix-asdf-install
198+
make install-packages
199+
make build
200+
make pack
201+
make everything-from-scratch
202+
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot
203+
run: |
204+
make clean
205+
make cleanall
206+
stalecheck-npm-install:
207+
# In this job, we are basically trying to check if `package-lock.json` is in
208+
# sync with `package-lock.json`.
209+
#
210+
# So, for example, if someone manually edits the `package.json` file, we want
211+
# to make sure that the `package-lock.json` file is not out of sync with the
212+
# `package.json` file.
213+
timeout-minutes: 30
214+
runs-on: ubuntu-latest
215+
strategy:
216+
fail-fast: false
217+
steps:
218+
### Check out the repo:
219+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
220+
with:
221+
persist-credentials: false
222+
### Install NodeJS
223+
# Unix (non-Windows):
224+
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
225+
if: runner.os != 'Windows'
226+
- run: make unix-asdf-install
227+
if: runner.os != 'Windows'
228+
### Run the master commands for this job:
229+
- run: make clean
230+
- run: npm ci
231+
# - run: npm install --package-lock-only
232+
- run: npm install
233+
### Make sure there are no uncommited changes
234+
- uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037
235+
with:
236+
version: '1'
237+
- run: git --no-pager status
238+
- run: git --no-pager diff
239+
- run: julia ./ci/check_uncommitted_changes.jl

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules/
22
__tests__/runner/*
3-
dist/

Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.NOTPARALLEL:
2+
3+
# This is the default target:
4+
.PHONY: pack
5+
pack: build
6+
npm run pack
7+
8+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9+
10+
.PHONY: everything-from-scratch
11+
everything-from-scratch: cleanall install-packages build pack clean
12+
13+
# build does `npm run build`, but does not run `npm run pack`
14+
.PHONY: build
15+
build:
16+
npm run build
17+
18+
.PHONY: test
19+
test:
20+
npm run test
21+
22+
.PHONY: install-packages
23+
install-packages:
24+
rm -rf node_modules/
25+
# Note: we use `npm ci` instead of `npm install`, because we want to make sure
26+
# that we respect the versions in the `package-lock.json` lockfile.
27+
npm ci
28+
29+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
30+
31+
.PHONY: clean
32+
clean:
33+
rm -rf node_modules/
34+
35+
.PHONY: cleanall
36+
cleanall: clean
37+
rm -rf lib/
38+
rm -rf dist/
39+
40+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41+
42+
# asdf does not support Windows.
43+
# On Windows, users need to install the correct version of NodeJS themselves.
44+
.PHONY: unix-asdf-install
45+
unix-asdf-install:
46+
asdf plugin add nodejs # update this list when we add more tools to `.tool-versions`
47+
asdf install
48+
49+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ci/check_uncommitted_changes.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const cmd = `git --no-pager diff --exit-code --stat`
2+
3+
const proc = run(pipeline(cmd; stdin, stdout, stderr); wait = false)
4+
5+
wait(proc)
6+
7+
@info "" success(proc) proc.exitcode
8+
9+
if !success(proc)
10+
recommended_cmd = "make everything-from-scratch"
11+
msg = "##[error] found changed files after build. " *
12+
"Please run `$(recommended_cmd)` and " *
13+
"then check in all changes."
14+
println(stderr, msg)
15+
exit(1)
16+
end

devdocs/local_setup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ First, `cd` to your clone of the repo. Now you can run the following commands:
4242
npm ci
4343

4444
npm run build
45+
46+
npm run pack
4547
```
4648

4749
When you are ready, you can commit your changes and push them to your PR.

0 commit comments

Comments
 (0)