Skip to content

Commit be4acd7

Browse files
ctruedenclaude
andcommitted
Overhaul CI to use pombast smelt/status instead of melting-pot
build.yml: - Replace old tests/run.sh (melting-pot) with pombast smelt - Drop the melting-pot cache restore/save/delete steps and exit.sh trick - Add astral-sh/setup-uv and webfactory/ssh-agent (master push only) - On master push: publish smelt.json to status.scijava.org gh-pages New status.yml: - Runs daily (and on master push) to regenerate status.scijava.org index.html - Lives in pom-scijava to avoid GitHub's 60-day dormancy kill of scheduled jobs - Installs pombast, runs pombast status --config pombast.toml, publishes index.html release.yml: - Use release-setup.sh (no apt packages -- only needed for smelt builds) - Use simplified build.sh (no melting-pot logic) Script renames and new files: - setup.sh → build-setup.sh (drops libxml2-utils, keeps smelt native deps) - new release-setup.sh (ci-setup-github-actions.sh only) - build.sh stripped to just ci-build.sh (no release detection, no melting-pot) - new smelt.sh (installs pombast, runs smelt, writes smelt.json) - new status.sh (installs pombast, runs status, publishes index.html) - new publish.sh (shared helper: commit a file to status.scijava.org gh-pages) - exit.sh deleted (no longer needed) pombast.toml: - Add nexus-base to [status] section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 96e6a3e commit be4acd7

12 files changed

Lines changed: 94 additions & 107 deletions

File tree

.github/build-setup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh
3+
sh ci-setup-github-actions.sh
4+
5+
# Install native libraries needed to build and test smelt components.
6+
pkgs="libxcb-shape0" # org.janelia:H5J_Loader_Plugin
7+
pkgs="$pkgs libgtk2.0-0" # net.imagej:imagej-opencv
8+
pkgs="$pkgs libblosc1" # org.janelia.saalfeldlab:n5-blosc
9+
sudo apt-get update
10+
sudo apt-get -y install $pkgs

.github/build.sh

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,3 @@
11
#!/bin/sh
2-
3-
# Discern whether this is a release build.
4-
releasing=
5-
if [ -f release.properties ]; then
6-
releasing=1
7-
fi
8-
9-
# Run the SciJava CI build script.
10-
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-build.sh &&
11-
sh ci-build.sh || { echo "Maven build failed. Skipping melting pot tests."; exit 1; }
12-
13-
# Skip melting pot if cutting a release.
14-
if [ "$releasing" ]; then
15-
exit 0
16-
fi
17-
18-
# Helper method to get the last cache modified date as seconds since epoch
19-
last_cache_modified() {
20-
find "$HOME/.cache/scijava/melting-pot" -type f | while read f
21-
do
22-
stat -c '%Y' "$f"
23-
done | sort -nr 2>/dev/null | head -n1
24-
}
25-
26-
# Record the last time of cache modification before running melting-pot
27-
cache_modified_pre=0
28-
cache_modified_post=0
29-
30-
if [ -d "$HOME/.cache/scijava/melting-pot" ]; then
31-
cache_modified_pre=$(last_cache_modified)
32-
fi
33-
34-
# run melting-pot
35-
tests/run.sh
36-
meltResult=$?
37-
38-
# Record the last time of cache modification after running melting-pot
39-
if [ -d "$HOME/.cache/scijava/melting-pot" ]; then
40-
cache_modified_post=$(last_cache_modified)
41-
fi
42-
43-
# Determine if cache needs to be re-generated
44-
echo "cache_modified_pre=$cache_modified_pre"
45-
echo "cache_modified_post=$cache_modified_post"
46-
if [ "$cache_modified_post" -gt "$cache_modified_pre" ]; then
47-
echo "cacheChanged=true"
48-
echo "cacheChanged=true" >> $GITHUB_ENV
49-
else
50-
echo "cacheChanged=false"
51-
echo "cacheChanged=false" >> $GITHUB_ENV
52-
fi
53-
54-
# NB: This script exits 0, but saves the exit code for a later build step.
55-
echo $meltResult > exit-code
2+
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-build.sh
3+
sh ci-build.sh

.github/exit.sh

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

.github/publish.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
# Commit a file to the status.scijava.org gh-pages branch.
3+
# Usage: publish.sh <local-file> [commit-message]
4+
# Requires SSH agent to be running with write access to status.scijava.org.
5+
set -e
6+
file=$1
7+
message=${2:-"Update $(basename "$file")"}
8+
test -f "$file" || { echo "File not found: $file" >&2; exit 1; }
9+
dest=$(basename "$file")
10+
11+
git config --global user.name github-actions
12+
git config --global user.email github-actions@github.com
13+
14+
git clone --depth=1 --branch=gh-pages git@github.com:scijava/status.scijava.org site-publish
15+
cp "$file" "site-publish/$dest"
16+
cd site-publish
17+
if git diff --quiet "$dest"
18+
then
19+
echo "== No changes to $dest =="
20+
else
21+
echo "== Committing $dest =="
22+
git add "$dest"
23+
git commit -m "$message"
24+
git push
25+
fi

.github/release-setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh
3+
sh ci-setup-github-actions.sh

.github/setup.sh

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

.github/smelt.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
uv tool install "git+https://github.com/scijava/pombast.git@66a1e3abff431846a900703f7450e0c21f1456cc"
3+
pombast smelt --config pombast.toml --json smelt.json .

.github/status.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
uv tool install "git+https://github.com/scijava/pombast.git@66a1e3abff431846a900703f7450e0c21f1456cc"
3+
pombast status --config pombast.toml --html index.html .
4+
commitNote="$(TZ=UTC date +'%Y-%m-%d %H:%M:%S UTC')"
5+
.github/publish.sh index.html "Update component table ($commitNote)"

.github/workflows/build.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ on:
88
branches:
99
- master
1010
schedule:
11-
- cron: "4 5 * * 0" # every Sunday at 0405, to keep cache alive
11+
# Run weekly on Sunday to keep the Maven cache alive.
12+
- cron: '4 5 * * 0'
1213

1314
jobs:
1415
build:
1516
runs-on: ubuntu-latest
16-
permissions:
17-
actions: write
1817

1918
steps:
2019
- uses: actions/checkout@v4
20+
2121
- name: Set up Java
2222
uses: actions/setup-java@v4
2323
with:
@@ -26,18 +26,17 @@ jobs:
2626
distribution: 'zulu'
2727
cache: 'maven'
2828

29-
- name: Set up CI environment
30-
run: .github/setup.sh
29+
- uses: astral-sh/setup-uv@v6
3130

32-
- name: Restore the melting-pot cache
33-
id: restore-cache
34-
uses: actions/cache/restore@v3
31+
- uses: webfactory/ssh-agent@v0.9.0
32+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
3533
with:
36-
path: ~/.cache/scijava/melting-pot
37-
key: ${{ runner.os }}-cache
34+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
35+
36+
- name: Set up build environment
37+
run: .github/build-setup.sh
3838

39-
- name: Execute the build
40-
id: execute-build
39+
- name: Maven CI build
4140
run: .github/build.sh
4241
env:
4342
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
@@ -48,22 +47,9 @@ jobs:
4847
CENTRAL_PASS: ${{ secrets.CENTRAL_PASS }}
4948
SIGNING_ASC: ${{ secrets.SIGNING_ASC }}
5049

51-
- name: Delete the melting-pot cache
52-
if: env.cacheChanged == 'true'
53-
id: delete-cache
54-
run: |
55-
gh api --method DELETE -H "Accept: application/vnd.github+json" /repos/scijava/pom-scijava/actions/caches?key=${{ runner.os }}-cache || true
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
59-
- name: Save the melting-pot cache
60-
if: env.cacheChanged == 'true'
61-
id: save-cache
62-
uses: actions/cache/save@v3
63-
with:
64-
path: ~/.cache/scijava/melting-pot
65-
key: ${{ runner.os }}-cache
50+
- name: Smelt components
51+
run: .github/smelt.sh
6652

67-
- name: Return the exit code
68-
id: exit-build
69-
run: .github/exit.sh
53+
- name: Publish smelt results
54+
if: always() && github.ref == 'refs/heads/master' && github.event_name == 'push'
55+
run: .github/publish.sh smelt.json "Update smelt results"

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ jobs:
1919
distribution: 'zulu'
2020
cache: 'maven'
2121

22-
- name: Set up CI environment
23-
run: .github/setup.sh
22+
- name: Set up release environment
23+
run: .github/release-setup.sh
2424

25-
- name: Execute the build
26-
id: execute-build
25+
- name: Execute the release
2726
run: .github/build.sh
2827
env:
2928
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}

0 commit comments

Comments
 (0)