4242 } | tee "$DIAG_DIR/context.txt"
4343 git status --short | tee "$DIAG_DIR/git-status.txt"
4444 git rev-parse HEAD | tee "$DIAG_DIR/git-head.txt"
45- git show --stat --summary --decorate=fuller HEAD | tee "$DIAG_DIR/git-head-summary.txt"
45+ git tag --points-at HEAD | tee "$DIAG_DIR/git-head-tags.txt"
46+ git show --stat --summary --pretty=fuller HEAD | tee "$DIAG_DIR/git-head-summary.txt"
4647 go version | tee "$DIAG_DIR/go-version.txt"
4748 go env | tee "$DIAG_DIR/go-env.txt"
4849 sha256sum go.mod go.sum | tee "$DIAG_DIR/go-files.sha256"
@@ -84,22 +85,26 @@ jobs:
8485 if : always()
8586 run : |
8687 set -euxo pipefail
87- ls -la dist/ | tee "$DIAG_DIR/dist-root.txt"
88- find dist -maxdepth 2 -type f | sort | tee "$DIAG_DIR/dist-files.txt"
89- find dist -maxdepth 2 -type f -exec ls -lh {} + | tee "$DIAG_DIR/dist-ls.txt"
90- find dist -maxdepth 2 -type f -exec file {} + | tee "$DIAG_DIR/dist-file.txt"
91- find dist -maxdepth 2 -type f -exec sha256sum {} + | tee "$DIAG_DIR/dist.sha256"
92- for f in $(find dist -maxdepth 2 -type f -name 'ctk*' 2>/dev/null | sort); do
93- echo "=== $f ===" | tee -a "$DIAG_DIR/dist-binaries.txt"
94- ls -lh "$f" | tee -a "$DIAG_DIR/dist-binaries.txt"
95- file "$f" | tee -a "$DIAG_DIR/dist-binaries.txt"
96- go tool buildid "$f" | tee -a "$DIAG_DIR/dist-binaries.txt" || true
97- go version -m "$f" | tee -a "$DIAG_DIR/dist-binaries.txt" || true
98- (size "$f" || true) | tee -a "$DIAG_DIR/dist-binaries.txt"
99- done
100- du -sh dist | tee "$DIAG_DIR/dist-size.txt"
101- sed -n '1,240p' dist/artifacts.json | tee "$DIAG_DIR/dist-artifacts.json.txt" || true
102- sed -n '1,240p' dist/checksums.txt | tee "$DIAG_DIR/dist-checksums.txt" || true
88+ if [ -d dist ]; then
89+ ls -la dist/ | tee "$DIAG_DIR/dist-root.txt"
90+ find dist -maxdepth 2 -type f | sort | tee "$DIAG_DIR/dist-files.txt"
91+ find dist -maxdepth 2 -type f -exec ls -lh {} + | tee "$DIAG_DIR/dist-ls.txt"
92+ find dist -maxdepth 2 -type f -exec file {} + | tee "$DIAG_DIR/dist-file.txt"
93+ find dist -maxdepth 2 -type f -exec sha256sum {} + | tee "$DIAG_DIR/dist.sha256"
94+ for f in $(find dist -maxdepth 2 -type f -name 'ctk*' 2>/dev/null | sort); do
95+ echo "=== $f ===" | tee -a "$DIAG_DIR/dist-binaries.txt"
96+ ls -lh "$f" | tee -a "$DIAG_DIR/dist-binaries.txt"
97+ file "$f" | tee -a "$DIAG_DIR/dist-binaries.txt"
98+ go tool buildid "$f" | tee -a "$DIAG_DIR/dist-binaries.txt" || true
99+ go version -m "$f" | tee -a "$DIAG_DIR/dist-binaries.txt" || true
100+ (size "$f" || true) | tee -a "$DIAG_DIR/dist-binaries.txt"
101+ done
102+ du -sh dist | tee "$DIAG_DIR/dist-size.txt"
103+ sed -n '1,240p' dist/artifacts.json | tee "$DIAG_DIR/dist-artifacts.json.txt" || true
104+ sed -n '1,240p' dist/checksums.txt | tee "$DIAG_DIR/dist-checksums.txt" || true
105+ else
106+ echo "dist directory missing" | tee "$DIAG_DIR/dist-missing.txt"
107+ fi
103108
104109 - name : Compare linux amd64 output
105110 if : always()
@@ -120,31 +125,46 @@ jobs:
120125 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
121126 run : |
122127 set -euxo pipefail
123- gh release view "${GITHUB_REF_NAME}" --json tagName,name,isDraft,isImmutable,isPrerelease,assets > "$DIAG_DIR/release-assets.json"
124- cat "$DIAG_DIR/release-assets.json"
125- jq -r '
126- [
127- .tagName,
128- .name,
129- (.isDraft|tostring),
130- (.isPrerelease|tostring),
131- (.isImmutable|tostring)
132- ] | @tsv
133- ' "$DIAG_DIR/release-assets.json" | tee "$DIAG_DIR/release-summary.tsv"
134- jq -r '
135- .assets[]
136- | [
128+ if gh release view "${GITHUB_REF_NAME}" --json tagName,name,isDraft,isImmutable,isPrerelease,assets > "$DIAG_DIR/release-assets.json"; then
129+ cat "$DIAG_DIR/release-assets.json"
130+ jq -r '
131+ [
132+ .tagName,
137133 .name,
138- (.size|tostring),
139- .contentType,
140- .state,
141- .updatedAt,
142- (.downloadCount|tostring),
143- .url
134+ (.isDraft|tostring),
135+ (.isPrerelease|tostring),
136+ (.isImmutable|tostring)
144137 ] | @tsv
145- ' "$DIAG_DIR/release-assets.json" | tee "$DIAG_DIR/release-assets.tsv"
138+ ' "$DIAG_DIR/release-assets.json" | tee "$DIAG_DIR/release-summary.tsv"
139+ jq -r '
140+ .assets[]
141+ | [
142+ .name,
143+ (.size|tostring),
144+ .contentType,
145+ .state,
146+ .updatedAt,
147+ (.downloadCount|tostring),
148+ .url
149+ ] | @tsv
150+ ' "$DIAG_DIR/release-assets.json" | tee "$DIAG_DIR/release-assets.tsv"
151+ else
152+ echo "release assets unavailable" | tee "$DIAG_DIR/release-assets-missing.txt"
153+ fi
146154
147155 - name : Upload diagnostics
156+ if : always()
157+ run : |
158+ set -euxo pipefail
159+ if [ -d "$DIAG_DIR" ]; then
160+ find "$DIAG_DIR" -maxdepth 1 -type f | sort | tee "$DIAG_DIR/diag-files.txt"
161+ find "$DIAG_DIR" -maxdepth 1 -type f -exec ls -lh {} + | tee "$DIAG_DIR/diag-files-ls.txt"
162+ find "$DIAG_DIR" -maxdepth 1 -type f | wc -l | tee "$DIAG_DIR/diag-file-count.txt"
163+ du -sh "$DIAG_DIR" | tee "$DIAG_DIR/diag-dir-size.txt"
164+ else
165+ echo "diagnostics directory missing"
166+ fi
167+ - name : Upload diagnostics artifact
148168 if : always()
149169 uses : actions/upload-artifact@v4
150170 with :
0 commit comments