Skip to content

Commit 28ac3de

Browse files
ctruedenclaude
andcommitted
Update CI for better separation of concerns
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bc44c94 commit 28ac3de

8 files changed

Lines changed: 91 additions & 27 deletions

File tree

.github/melt.sh

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

.github/publish.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ datestamp="$(TZ=UTC date +'%Y-%m-%d %H:%M:%S UTC')"
1212
message="$1 ($datestamp)"
1313
shift
1414

15-
git config --global user.name github-actions
16-
git config --global user.email github-actions@github.com
15+
git config --global user.name "SciJava CI"
16+
git config --global user.email ci@scijava.org
1717

1818
dest_dir=site-publish
1919

@@ -36,5 +36,13 @@ then
3636
else
3737
echo "== Committing changes =="
3838
git commit -m "$message"
39-
git push
39+
# Retry against concurrent publishers (the build and status workflows both
40+
# push here), rebasing onto whatever landed in between.
41+
n=0
42+
until git push
43+
do
44+
n=$((n + 1))
45+
test "$n" -lt 5 || { echo "push failed after $n attempts" >&2; exit 1; }
46+
git pull --rebase
47+
done
4048
fi

.github/status.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
#!/bin/sh
2-
uv tool install "git+https://github.com/scijava/pombast.git"
2+
# CI orchestrator for the status dashboard: fetch the most recently published
3+
# smelt.json, regenerate the status/badges/team reports from it, and publish
4+
# them to status.scijava.org. The report generation itself lives in
5+
# bin/report.sh so it can be run outside CI too.
6+
set -e
37

48
# Pull the most recently published smelt results so that `pombast status` can
59
# classify each available version bump by its bytecode-floor blast radius
610
# (flat / local / cascading / excluded). Read straight from the gh-pages branch
711
# rather than https://status.scijava.org/, so we pick up a freshly committed
812
# smelt.json immediately instead of waiting on the asynchronous Pages deploy.
913
#
10-
# Best-effort: if smelt.json is not published yet (or the fetch fails), status
11-
# still runs -- just without the bytecode classification overlay.
12-
smelt_arg=""
14+
# Best-effort: if smelt.json is not published yet (or the fetch fails),
15+
# bin/report.sh still generates the reports -- just without the classification.
1316
smelt_url=https://raw.githubusercontent.com/scijava/status.scijava.org/gh-pages/smelt.json
14-
if curl -fsSLO "$smelt_url"; then
15-
smelt_arg="--smelt smelt.json"
16-
else
17+
mkdir -p target/pombast
18+
curl -fsSL -o target/pombast/smelt.json "$smelt_url" ||
1719
echo "== smelt.json unavailable; running status without classification =="
18-
fi
1920

20-
pombast status $smelt_arg .
21-
pombast badges -o badges.json .
22-
pombast team .
23-
.github/publish.sh "Update status reports" index.html badges.json team.html
21+
bin/report.sh
22+
23+
.github/publish.sh "Update status reports" \
24+
target/pombast/index.html \
25+
target/pombast/badges.json \
26+
target/pombast/team.html \
27+
target/pombast/team.json

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
# Run weekly on Sunday to keep the Maven cache alive.
1212
- cron: '4 5 * * 0'
1313

14+
# Queue runs of the same ref; cancel superseded PR builds (they never publish).
15+
concurrency:
16+
group: build-${{ github.ref }}
17+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
18+
1419
jobs:
1520
build:
1621
runs-on: ubuntu-latest
@@ -63,8 +68,8 @@ jobs:
6368
~/.cache/jgo
6469
key: ${{ runner.os }}-pombast-build
6570

66-
- name: Run pombast melt+smelt commands
67-
run: .github/melt.sh
71+
- name: Run pombast checks (melt + smelt)
72+
run: bin/check.sh
6873
shell: bash
6974

7075
- name: Delete old pombast cache
@@ -86,5 +91,5 @@ jobs:
8691

8792
- name: Publish smelt results
8893
if: always() && github.ref == 'refs/heads/master' && github.event_name == 'push'
89-
run: .github/publish.sh "Update smelt results" smelt.json
94+
run: .github/publish.sh "Update smelt results" target/pombast/smelt.json
9095
shell: bash

.github/workflows/status.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ on:
1212
workflows: [build]
1313
types: [completed]
1414

15+
# Serialize status runs (daily cron + each build completion) so two never push
16+
# to the status.scijava.org gh-pages branch at the same time.
17+
concurrency:
18+
group: status-publish
19+
cancel-in-progress: false
20+
1521
jobs:
1622
status:
1723
runs-on: ubuntu-latest

bin/check.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
# Validate a Maven BOM's managed components against each other:
3+
#
4+
# melt -- mega-melt classpath check (duplicate classes, SNAPSHOTs, enforcer)
5+
# smelt -- per-component build + test against the BOM-pinned dependency set
6+
#
7+
# Both phases always run, so a failure in one (e.g. duplicate classes in melt)
8+
# never hides real incompatibilities surfaced by the other. The script exits
9+
# non-zero if either phase found a problem.
10+
#
11+
# Run from a BOM checkout (e.g. a pom-scijava working copy):
12+
#
13+
# bin/check.sh
14+
#
15+
# Outputs land under target/pombast/ (see pombast.toml).
16+
command -v pombast >/dev/null 2>&1 ||
17+
uv tool install "git+https://github.com/scijava/pombast.git"
18+
19+
rc=0
20+
pombast melt || rc=$?
21+
pombast smelt || rc=$?
22+
exit $rc

bin/report.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
# Generate the status, badges, and team reports for a Maven BOM, writing them
3+
# under target/pombast/ (see pombast.toml).
4+
#
5+
# Run from a BOM checkout (e.g. a pom-scijava working copy):
6+
#
7+
# bin/report.sh
8+
#
9+
# The status report overlays binary/source compatibility info from
10+
# target/pombast/smelt.json when present. Run bin/check.sh first, or drop a
11+
# published smelt.json into target/pombast/, to populate it; without it, the
12+
# reports are still generated, just without the bytecode classification.
13+
command -v pombast >/dev/null 2>&1 ||
14+
uv tool install "git+https://github.com/scijava/pombast.git"
15+
16+
smelt=target/pombast/smelt.json
17+
if [ -f "$smelt" ]; then
18+
pombast status --smelt "$smelt"
19+
else
20+
echo "== $smelt not found; generating status without bytecode classification =="
21+
pombast status
22+
fi
23+
pombast badges
24+
pombast team

pombast.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ default-java-version = 8
33
repositories = ["scijava.public=https://maven.scijava.org/content/groups/public"]
44

55
[status]
6-
output = "../status.scijava.org/index.html"
7-
smelt = "../status.scijava.org/smelt.json"
6+
output = "target/pombast/index.html"
87
rules = "rules.xml"
98
header = "pombast/header-status.html"
109
footer = "pombast/footer-status.html"
@@ -26,7 +25,7 @@ cuttable = [
2625
]
2726

2827
[team]
29-
output = "../status.scijava.org/team.html"
28+
output = "target/pombast/team.html"
3029
header = "pombast/header-team.html"
3130
footer = "pombast/footer-team.html"
3231
includes = [
@@ -46,7 +45,7 @@ includes = [
4645
]
4746

4847
[badges]
49-
output = "../status.scijava.org/badges.json"
48+
output = "target/pombast/badges.json"
5049
includes = [
5150
"de.nanoimaging:*",
5251
"fr.inra.ijpb:*",
@@ -115,7 +114,7 @@ excludes = [
115114
]
116115

117116
[smelt]
118-
output = "../status.scijava.org/smelt.json"
117+
output = "target/pombast/smelt.json"
119118
includes = [
120119
"de.nanoimaging:*",
121120
"fr.inra.ijpb:*",

0 commit comments

Comments
 (0)