Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ env:
EMULEBB_LINUX_PREPARED_IMAGE: ghcr.io/emulebb/emulebb-build-ci/ubuntu-rust@sha256:182090666a847a8c49e4e782f172ab845e295646eb2f246e75ff3ad989519237
EMULEBB_BUILD_TESTS_REF: 135930dcbf350cc37477baf528f9d29ff4a573e9
EMULEBB_TOOLING_REF: ac8609756b097d1294308abeef962fe1592e4e38
EMULEBB_RELEASE_VALIDATOR_REF: 79bdc2d240fcb3b11a9e3e937df16dec2121eee6
EMULEBB_APK_BUILD_REF: 79bdc2d240fcb3b11a9e3e937df16dec2121eee6
EMULEBB_RELEASE_VALIDATOR_REF: f9fd190ed6236c6ebb3a71aac8ff0e73e7a06b84
EMULEBB_APK_BUILD_REF: f9fd190ed6236c6ebb3a71aac8ff0e73e7a06b84
EMULEBB_APK_BUILD_TESTS_REF: 5a082f4542a74aad3d36ed9b3e17640028ed47f9
EMULEBB_ANDROID_SIGNER_SHA256: 9edc742d7230a714a0149c20eb2afb235b8ad5237166090f10e7ac69e2bb359f
MINIUPNP_REF: 4e7a10948004ca2085ac8103e14fc77edb898b4c
Expand Down Expand Up @@ -1091,6 +1091,14 @@ jobs:
ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}
path: emulebb-build
persist-credentials: false
- &release-producer-checkout
name: Checkout the pinned producer for release evidence
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: emulebb/emulebb-build
ref: ${{ env.EMULEBB_BUILD_REF }}
path: emulebb-image-build
persist-credentials: false
- name: Checkout pinned image evidence reader
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -1178,7 +1186,7 @@ jobs:
merge-multiple: true
path: ${{ runner.temp }}/emulebb-rust-out/image-evidence/alpine
- name: Bind both native CPU proofs to each exact OCI archive
working-directory: emulebb-build
working-directory: emulebb-image-build
shell: bash
env:
EMULEBB_WORKSPACE_OUTPUT_ROOT: ${{ runner.temp }}/emulebb-rust-out
Expand Down Expand Up @@ -1234,7 +1242,7 @@ jobs:
--release-dir "$RELEASE_DIR"
--output "$RELEASE_DIR/emulebb-rust-v$RELEASE_VERSION-candidate-manifest.json"
--archives-dir "$EMULEBB_WORKSPACE_OUTPUT_ROOT/artifacts"
--build-repo emulebb-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests
--build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests
--github-output "$GITHUB_OUTPUT"
- name: Retain the exact public release candidate
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down Expand Up @@ -1281,6 +1289,7 @@ jobs:
ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}
path: emulebb-build
persist-credentials: false
- *release-producer-checkout
- name: Checkout pinned OCI graph reader
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -1333,7 +1342,7 @@ jobs:
run: >-
python -B emulebb-rust/tools/release_publish.py publish-images
--release-dir "$RELEASE_DIR" --archives-dir "$EMULEBB_WORKSPACE_OUTPUT_ROOT/artifacts"
--build-repo emulebb-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests
--build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests --harness-repo emulebb-build-tests
--assembled-candidate-sha256 "$ASSEMBLED_CANDIDATE_SHA" --github-output "$GITHUB_OUTPUT"
- name: Attest the published Ubuntu digest
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
Expand Down Expand Up @@ -1381,6 +1390,7 @@ jobs:
ref: ${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}
path: emulebb-build
persist-credentials: false
- *release-producer-checkout
- name: Checkout independently pinned APK evidence reader
if: ${{ inputs.channel == 'nightly' }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -1407,7 +1417,7 @@ jobs:
run: |
set -euo pipefail
python -B emulebb-rust/tools/release_publish.py release-assets \
--release-dir "$RELEASE_DIR" --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests \
--release-dir "$RELEASE_DIR" --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests \
--verified-candidate-sha256 "$VERIFIED_CANDIDATE_SHA" --phase before-upload
- name: Attest the exact native release candidate
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
Expand All @@ -1433,7 +1443,7 @@ jobs:
run: |
set -euo pipefail
python -B emulebb-rust/tools/release_publish.py release-assets \
--release-dir "$RELEASE_DIR" --build-repo emulebb-build --apk-harness-repo emulebb-apk-tests \
--release-dir "$RELEASE_DIR" --build-repo emulebb-build --producer-build-repo emulebb-image-build --apk-harness-repo emulebb-apk-tests \
--verified-candidate-sha256 "$VERIFIED_CANDIDATE_SHA" --phase after-upload --release-id "$RELEASE_ID"
gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" -F draft=false

Expand Down
2 changes: 2 additions & 0 deletions tools/release_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def candidate_context(args: argparse.Namespace, owner):
"runAttempt": args.run_attempt, "workflowSha": args.workflow_sha},
platform_profile=args.platform_profile,
release_validator_build_sha=args.release_validator_build_ref,
producer_build_root=getattr(args, "producer_build_repo", None),
**apk,
).checked()

Expand Down Expand Up @@ -706,6 +707,7 @@ def build_parser() -> argparse.ArgumentParser:
candidate.add_argument("--" + flag, default=default, required=not default,
help=f"Expected identity; defaults to the caller's {environment}.")
candidate.add_argument("--build-repo", required=True, type=Path)
candidate.add_argument("--producer-build-repo", type=Path)
for flag, environment in {"apk-build-ref": "EMULEBB_APK_BUILD_REF", "apk-harness-ref": "EMULEBB_APK_BUILD_TESTS_REF",
"apk-signer-sha256": "EMULEBB_ANDROID_SIGNER_SHA256"}.items():
candidate.add_argument("--" + flag, default=os.environ.get(environment))
Expand Down
21 changes: 21 additions & 0 deletions tools/tests/test_release_linux_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ def test_native_smoke_proves_identity_and_owns_profile_contention_scratch(self):
self.assertIn("${{ matrix.os == 'windows' && matrix.arch == 'x64' && '--render-webui' || '' }}", smoke["run"])
self.assertNotIn("continue-on-error", smoke)

def test_image_evidence_assembly_uses_the_producer_checkout(self):
steps = self.workflow["jobs"]["assemble-candidate"]["steps"]
assemble = next(step for step in steps if "assemble-emulebb-rust-image-evidence-ci" in step.get("run", ""))
producer = next(step for step in steps if step.get("with", {}).get("path") == assemble["working-directory"])
validator = next(step for step in steps if step.get("with", {}).get("path") == "emulebb-build")
self.assertLess(steps.index(producer), steps.index(assemble))
self.assertEqual(producer["with"]["repository"], "emulebb/emulebb-build")
self.assertEqual(producer["with"]["ref"], "${{ env.EMULEBB_BUILD_REF }}")
self.assertEqual(validator["with"]["ref"], "${{ env.EMULEBB_RELEASE_VALIDATOR_REF }}")

def test_candidate_readers_verify_tool_data_from_the_pinned_producer(self):
for name in ("assemble-candidate", "publish-image", "publish-native"):
steps = self.workflow["jobs"][name]["steps"]
producer = next(step for step in steps if step.get("with", {}).get("path") == "emulebb-image-build")
self.assertEqual(producer["with"]["ref"], "${{ env.EMULEBB_BUILD_REF }}")
readers = [step for step in steps if "--build-repo " in step.get("run", "")]
self.assertTrue(readers)
for reader in readers:
self.assertLess(steps.index(producer), steps.index(reader))
self.assertIn("--producer-build-repo emulebb-image-build", reader["run"])

def test_musl_and_image_consumers_select_mirrors_without_changing_runtime_base(self):
for job, command in (("musl-package", "package-emulebb-rust-linux-ci"),
("image-candidate", "package-emulebb-rust-image-ci")):
Expand Down
Loading