Skip to content

feat: mirror build logs to zitzhen/ZGS-build-log with per-run releases - #7

Merged
Iamliuxiaozhen merged 1 commit into
mainfrom
feat/log-repo-mirror
Dec 1, 2026
Merged

Iamliuxiaozhen merged 1 commit into
mainfrom
feat/log-repo-mirror

Conversation

@Iamliuxiaozhen

Copy link
Copy Markdown
Member

Build logs are already archived under /log/-/ on the apt repository. This mirrors the same logs into a dedicated repository so they can be browsed and downloaded as git history and as releases:

https://github.com/zitzhen/ZGS-build-log/2026-12-01-46640252167/

The new publish-log-repo job maintains that repository:

  • stage-log-repo.sh writes the run's logs into -/ using the same layout as the apt repository.
  • render-log-readme.sh regenerates the README from the run directories present, so it stays a valid index and adding a run never drops an older one. Entries link to the run directory and to its release.
  • publish-log-release.sh creates a release tagged - with the run's log files attached, published directly rather than as a draft. Re-running is idempotent: an existing release is updated and its assets replaced instead of duplicating them.

Commits are authored as zgs-software[bot]
<363535165+zgs-software[bot]@users.noreply.github.com> and pushed straight to main, as requested.

Authentication uses a GitHub App (app id 6008281, installation 187856393) rather than a long-lived personal token. github-app-token.sh reads the private key from the APP_KEY secret, signs a JWT with iat/exp inside GitHub's accepted window, and exchanges it for an installation token. The token is masked in the log and never persisted: the checkout uses persist-credentials: false, the clone URL is reset to a token-free URL, and the push receives the token as an argument so it cannot end up in .git/config. The job runs in parallel with the R2 publication, so a failure here never blocks an apt release.

Tests in script-checks.yml cover the staging layout, the README index listing past runs as well as the current one, rejection of path traversal and malformed run directories, and the fail-closed guards in the token and release scripts. Also verified locally by running the job's own run: blocks under bash, simulating two consecutive publishes against a scratch remote, and confirming the second run leaves the first run's logs and index entry intact.

Build logs are already archived under /log/<date>-<run-id>/ on the apt
repository. This mirrors the same logs into a dedicated repository so they can
be browsed and downloaded as git history and as releases:

  https://github.com/zitzhen/ZGS-build-log/2026-12-01-46640252167/

The new publish-log-repo job maintains that repository:

- stage-log-repo.sh writes the run's logs into <date>-<run-id>/ using the same
  layout as the apt repository.
- render-log-readme.sh regenerates the README from the run directories present,
  so it stays a valid index and adding a run never drops an older one. Entries
  link to the run directory and to its release.
- publish-log-release.sh creates a release tagged <date>-<run-id> with the run's
  log files attached, published directly rather than as a draft. Re-running is
  idempotent: an existing release is updated and its assets replaced instead of
  duplicating them.

Commits are authored as zgs-software[bot]
<363535165+zgs-software[bot]@users.noreply.github.com> and pushed straight to
main, as requested.

Authentication uses a GitHub App (app id 6008281, installation 187856393) rather
than a long-lived personal token. github-app-token.sh reads the private key from
the APP_KEY secret, signs a JWT with iat/exp inside GitHub's accepted window, and
exchanges it for an installation token. The token is masked in the log and never
persisted: the checkout uses persist-credentials: false, the clone URL is reset to
a token-free URL, and the push receives the token as an argument so it cannot end
up in .git/config. The job runs in parallel with the R2 publication, so a failure
here never blocks an apt release.

Tests in script-checks.yml cover the staging layout, the README index listing
past runs as well as the current one, rejection of path traversal and malformed
run directories, and the fail-closed guards in the token and release scripts.
Also verified locally by running the job's own run: blocks under bash, simulating
two consecutive publishes against a scratch remote, and confirming the second run
leaves the first run's logs and index entry intact.

Signed-off-by: Oliver Lin <oliver@liuxiaozhen.dev>
@Iamliuxiaozhen
Iamliuxiaozhen merged commit 340c248 into main Dec 1, 2026
4 checks passed
@Iamliuxiaozhen
Iamliuxiaozhen deleted the feat/log-repo-mirror branch December 1, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant