Skip to content

Commit 3600df8

Browse files
ctruedenclaude
andcommitted
CI: publish pombast team reports, improve caching
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f590b0e commit 3600df8

4 files changed

Lines changed: 72 additions & 21 deletions

File tree

.github/publish.sh

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
11
#!/bin/sh
22
# Commit a file to the status.scijava.org gh-pages branch.
3-
# Usage: publish.sh <local-file> [commit-message]
43
# Requires SSH agent to be running with write access to status.scijava.org.
54
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")
5+
6+
test $# -gt 1 || {
7+
echo "Usage: publish.sh \"Commit message\" file1 [file2 ...]"
8+
exit 2
9+
}
10+
11+
datestamp="$(TZ=UTC date +'%Y-%m-%d %H:%M:%S UTC')"
12+
message="$1 ($datestamp)"
13+
shift
1014

1115
git config --global user.name github-actions
1216
git config --global user.email github-actions@github.com
1317

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+
dest_dir=site-publish
19+
20+
git clone --depth=1 --branch=gh-pages git@github.com:scijava/status.scijava.org "$dest_dir"
21+
22+
while [ $# -gt 0 ]
23+
do
24+
file=$1
25+
shift
26+
test -f "$file" || { echo "File not found: $file" >&2; exit 1; }
27+
dest=$(basename "$file")
28+
cp "$file" "$dest_dir/$dest"
29+
(cd "$dest_dir" && git add "$dest")
30+
done
31+
32+
cd "$dest_dir"
33+
if git diff --quiet .
1834
then
19-
echo "== No changes to $dest =="
35+
echo "== No changes =="
2036
else
21-
echo "== Committing $dest =="
22-
git add "$dest"
37+
echo "== Committing changes =="
2338
git commit -m "$message"
2439
git push
2540
fi

.github/status.sh

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

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ jobs:
7979

8080
- name: Publish smelt results
8181
if: always() && github.ref == 'refs/heads/master' && github.event_name == 'push'
82-
run: .github/publish.sh smelt.json "Update smelt results"
82+
run: .github/publish.sh "Update smelt results" smelt.json
8383
shell: bash

.github/workflows/status.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
status:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
actions: write # needed to delete and re-save caches
1416

1517
steps:
1618
- uses: actions/checkout@v4
@@ -24,16 +26,50 @@ jobs:
2426
- name: Restore pombast cache
2527
uses: actions/cache/restore@v4
2628
with:
27-
path: ~/.cache/pombast/pom-timestamps
28-
restore-keys: ${{ runner.os }}-pombast-status-
29+
path: ~/.cache/pombast
30+
key: ${{ runner.os }}-pombast-status
31+
restore-keys: ${{ runner.os }}-pombast-cache
2932

30-
- name: Generate and publish status page
33+
- name: Restore monoqueue cache
34+
uses: actions/cache/restore@v4
35+
with:
36+
path: ~/.cache/monoqueue
37+
key: ${{ runner.os }}-monoqueue-status
38+
39+
- name: Generate and publish status and team pages
3140
run: .github/status.sh
3241
shell: bash
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Delete old pombast status cache
46+
if: always()
47+
run: |
48+
gh api --method DELETE \
49+
-H "Accept: application/vnd.github+json" \
50+
"/repos/scijava/pom-scijava/actions/caches?key=${{ runner.os }}-pombast-status" || true
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3353

3454
- name: Save pombast cache
3555
if: always()
3656
uses: actions/cache/save@v4
3757
with:
38-
path: ~/.cache/pombast/pom-timestamps
39-
key: ${{ runner.os }}-pombast-status-${{ github.run_id }}
58+
path: ~/.cache/pombast
59+
key: ${{ runner.os }}-pombast-status
60+
61+
- name: Delete old monoqueue cache
62+
if: always()
63+
run: |
64+
gh api --method DELETE \
65+
-H "Accept: application/vnd.github+json" \
66+
"/repos/scijava/pom-scijava/actions/caches?key=${{ runner.os }}-monoqueue-status" || true
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Save monoqueue cache
71+
if: always()
72+
uses: actions/cache/save@v4
73+
with:
74+
path: ~/.cache/monoqueue
75+
key: ${{ runner.os }}-monoqueue-status

0 commit comments

Comments
 (0)