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
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CI Workflows

- `reusable-consumer.yml`: nine checks plus the `dx-ci (aggregate)` gate.
- `reusable-release.yml`: on a tag push, or on any ref when `publish` is false, dry-runs on each `platforms` entry, then applies `dx deploy` for each `deployment` tagged `release` (or the `deployables` input), with `contents`, `id-token`, `attestations` and `packages` write. The release job runs only when `publish` is true (the default) and the ref is a tag, so a branch run never publishes. A failure stops the rest and the job summary lists what was published. `dx init` writes a `release.yml` caller.
- `reusable-release.yml`: on a tag push, or on any ref when `publish` is false, dry-runs on each `platforms` entry, then applies `dx deploy` for each `deployment` tagged `release` (or the `deployables` input), the `registry_deploys` of a `github_deploy` first, with `contents`, `id-token`, `attestations` and `packages` write. The release job runs only when `publish` is true (the default) and the ref is a tag, so a branch run never publishes. A failure stops the rest and the job summary lists what was published. `dx init` writes a `release.yml` caller.
- `reusable-docs.yml`: `docs-check` plus `docs-publish` (GitHub Pages).
- `docs.yml`: on a push to `main` that changes a page in the user book (`docs/`, `tools/docs/`, the root and example READMEs), or by dispatch, runs `reusable-docs.yml` and publishes the book to https://devhusdk.github.io/rules_dx/. Its `docs` job and the `ci.yml` `docs` job share the `docs-pages-<ref>` concurrency group, so two Pages deploys never overlap.
- `pr-check.yml`: on pull requests and dispatch, an `analysis` job on `ubuntu-latest` for `producers_bin --pr-check` (`tools/ci/producers/src/pr_check.rs`), one step per set (`workflow`, `preflight`, `starter`, `hermetic`, `docs`, `cli`, `kotlin-bench`) so the run shows each set's duration. `preflight` also runs the `ci.yml` crate lockfile check (#8915). In parallel, `affected-plan` lists the tests `dx test --affected` reaches and splits them into shards of at most 150, and the `affected` matrix runs one shard per job, so neither the sets nor a change that reaches most of the repository push a job past its time budget. Run one locally from the workspace root with `bazel build //tools/ci/producers:producers_bin && bazel-bin/tools/ci/producers/producers_bin --pr-check <set>`. The owner decides whether it moves to `pull_request` or `merge_group` (#7172).
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ jobs:
echo "dx-release: no deployment is tagged release; tag one or pass deployables." >&2
exit 1
fi
registry_deploys="$(bazel query --output=label "labels(registry_deploys, deps(set($(tr '\n' ' ' < "$RUNNER_TEMP/deployables.txt")), 1))")"
{
grep -Fxf <(printf '%s\n' "$registry_deploys") "$RUNNER_TEMP/deployables.txt" || true
grep -Fvxf <(printf '%s\n' "$registry_deploys") "$RUNNER_TEMP/deployables.txt" || true
} > "$RUNNER_TEMP/deployables.ordered.txt"
mv "$RUNNER_TEMP/deployables.ordered.txt" "$RUNNER_TEMP/deployables.txt"
echo "Deployables for ${GITHUB_REF_NAME}:"
cat "$RUNNER_TEMP/deployables.txt"
echo "labels=$(tr '\n' ' ' < "$RUNNER_TEMP/deployables.txt")" >> "$GITHUB_OUTPUT"
Expand Down
7 changes: 6 additions & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,12 @@ github_deploy(
in the same release. The release body gets an `## Attestations` section
with one `gh attestation verify <file> -R <owner>/<repo>` line for each
`.crate` and each `maven_deploy` file.
- `attach`: `True` also uploads the `maven_deploy` files as release assets.
- `attach`: `True` also uploads the `maven_deploy` files as release assets,
and the `<name>-<version>.crate` of each `crates_deploy`. A live run
downloads that `.crate` from crates.io, checks its sha256 against the
sparse index `cksum`, and checks that it holds only the pinned sources
(`Cargo.toml.orig` equal to the pinned `Cargo.toml`). Run the
`crates_deploy` before the `github_deploy`; `reusable-release.yml` does.
Defaults to `True`.
- `sbom`: also uploaded as a release asset.
- `build_mode`: `debug`, `dev` or `release`. Defaults to `release`.
Expand Down
3 changes: 2 additions & 1 deletion deploy/private/github.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _github_config_impl(ctx):
rlocs = [rlocation_path(ctx, f) for f in info.files]
registry_files.extend(info.files)
attestations.append({
"attach": ctx.attr.attach and info.registry == "crates",
"crate_name": info.crate_name,
"registry": info.registry,
"rlocs": rlocs,
Expand Down Expand Up @@ -119,7 +120,7 @@ _github_config = rule(
doc = "crates_deploy and maven_deploy targets whose artifacts get a gh attestation verify line in the release body.",
providers = [DxRegistryArtifactsInfo],
),
"attach": attr.bool(doc = "Also upload the maven_deploy files of registry_deploys as release assets."),
"attach": attr.bool(doc = "Also upload the maven_deploy files of registry_deploys, and the crates_deploy .crate that crates.io serves, as release assets."),
"deploy_name": attr.string(mandatory = True, doc = "Deploy target name."),
"release_tag": attr.string(doc = "Release tag. Empty when tag_from_head is set."),
"tag_from_head": attr.bool(doc = "Use the tag that points at HEAD."),
Expand Down
1 change: 1 addition & 0 deletions deploy/private/github_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _attested_config_test_impl(ctx):
attestations = config.get("attestations", [])
asserts.equals(env, ["crates", "maven"], [a["registry"] for a in attestations])
asserts.equals(env, "crates_demo", attestations[0]["crate_name"] if attestations else "")
asserts.true(env, attestations[0].get("attach", False) if attestations else False, "attach must fetch the published .crate")
maven_rlocs = attestations[1]["rlocs"] if len(attestations) > 1 else []
asserts.equals(env, 4, len(maven_rlocs), "want the jar, pom, sources and javadoc")
for rloc in maven_rlocs:
Expand Down
3 changes: 2 additions & 1 deletion deploy/private/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ mod tests {
fn a_github_config_carries_its_attestations() {
let manifest = format!("_main/{}", dx_ecosystems::Ecosystem::Cargo.manifest_name());
let config = parse(&github_config(&format!(
r#""asset_rlocs":[],"attestations":[{{"registry":"crates","rlocs":["{manifest}"],"crate_name":"demo","version":"1.0.0"}}]"#,
r#""asset_rlocs":[],"attestations":[{{"registry":"crates","rlocs":["{manifest}"],"crate_name":"demo","version":"1.0.0","attach":true}}]"#,
)));
let Ok(DeployConfig::Github(github)) = config else {
panic!("{config:?}");
Expand All @@ -827,6 +827,7 @@ mod tests {
rlocs: vec![manifest],
crate_name: "demo".to_owned(),
version: "1.0.0".to_owned(),
attach: true,
}]
);
}
Expand Down
Loading
Loading