Skip to content

ci: prepare reproducible source archives for automated signing - #318

Open
Xuanwo wants to merge 3 commits into
mainfrom
xuanwo/source-signing
Open

Xuanwo wants to merge 3 commits into
mainfrom
xuanwo/source-signing

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

Prepare Asyncband's source-signing workflow for an ASF Infra-managed GPG_SECRET_KEY request and ASF Security review, following the automated release signing procedure. Related to #303.

A single trusted job packages the committed source with git archive --format=tar.gz -9, writes its SHA-512 checksum with shasum, and optionally signs and verifies the archive with GPG. PRs and default manual runs produce unsigned artifacts. After provisioning, the release manager manually runs Source candidate on apache/asyncband's main branch with sign enabled and downloads the signed-source GitHub Actions artifact. ATR upload is a follow-up integration; this workflow does not stage candidates, start votes, create tags, or publish releases.

The release instructions require independent byte-for-byte reproduction with Git and cmp on trusted hardware against the actual staged archive before publication. Before signing is enabled, ASF Security must approve the workflow, Infra must install GPG_SECRET_KEY, and the public key and SOURCE_SIGNING_FINGERPRINT must be configured. The signing command expects an empty passphrase on the Infra-managed key.

Reproducibility evidence

Verified commit 6a6e8901215c2ea82326ed44104f3277ff832482. The archive downloaded from Source candidate run 34992337603 on Ubuntu 24.04 (Git 2.55.0) matches the archive independently reproduced from a fresh checkout on macOS Apple Silicon (Apple Git 2.54.0). The documented reproduction commands passed against the downloaded CI archive, including cmp.

SHA-512 of apache-asyncband-0.7.2-incubating-src.tar.gz:

2c4159a54ec50fa79ceb91299eff35e99ffcf9373986fa252451360193218e87288001e3fe43596c8d89f471bbc0788842b4b238f45e117aaf66ac2c1ee8ed22

The shell checks rejected tracked edits, output-directory reuse, and a modified downloaded archive. Production signing remains untested until Infra provisions the key. Each future candidate still requires independent reproduction against its actual staged bytes.

Comment thread .github/workflows/source.yml
Comment thread xtask/src/source.rs Outdated
@Xuanwo
Xuanwo marked this pull request as ready for review September 15, 2026 08:05
@Xuanwo
Xuanwo requested a review from tisonkun September 15, 2026 08:43
Comment on lines +79 to +80
cargo x --help
cargo x source --help

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not exist in the shell script? They seem to be information query, rather than the one that would be executed.

Comment on lines 84 to 85
gpg --armor --detach-sign --local-user "${ASF_GPG_FINGERPRINT}" \
"${SOURCE_DIR}.tar.gz"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we should let cargo x source do the signing job as well? Or else we may not need a cargo x source command.

You may please read the output of agent.

Comment on lines +21 to +33
pull_request:
paths:
- .github/workflows/source.yml
- xtask/**
- Cargo.toml
- Cargo.lock
- .agents/skills/release/**
workflow_dispatch:
inputs:
sign:
description: Sign with the Infra-managed key (requires ASF Security approval)
type: boolean
default: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who would trigger the workflow_dispatch event?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we may leverage some ATR actions to just upload the package files there.

Comment on lines +59 to +60
cargo x --help
cargo x source --help

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. --help should not be included in the exuecting script.

Comment thread xtask/src/main.rs Outdated
// Git owns the committed file inventory, modes, symlinks, and timestamps.
let mut archive = find_command("git");
archive
.args(["-c", "tar.umask=0022", "archive", "--format=tar"])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we use git already, having something like git archive --format=tar.gz would package tar.gz without introducing the large flate2 dependency.

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just drop cargo x source and use shell commands.

I found Rust is very weak in this area.

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.

2 participants