You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: optionally apply github-build-setup steps to additional jobs.
For some use cases, such as using private Git crate dependencies in a
project's Cargo.toml manifest, Github Actions requires a certain amount
of ceremony to alias the private repo's Git URL to to something that can
be cloned using an access token. For the `build-local-artifacts` job,
this can be accomplished by adding the authentication step in the
`github-build-setup` YML file.
There are additional jobs that necessitate these credentials be set,
mainly the `plan`, `build-global-artifacts`, and `host`. This
appears to be due to the fact they invoke `cargo metadata` (which
attempts to pull dependencies).
Support these use-cases by introducing a `github-build-setup-jobs` collection
which allows users to opt-in to including the `github-build-setup`
steps in various jobs.
Fixes#2065
Copy file name to clipboardExpand all lines: cargo-dist/src/config/v0.rs
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -539,10 +539,14 @@ pub struct DistMetadata {
539
539
#[serde(default, with = "opt_string_or_vec")]
540
540
pubinstall_libraries:Option<Vec<LibraryStyle>>,
541
541
542
-
/// Any additional steps that need to be performed before building local artifacts
542
+
/// Any additional steps that need to be performed before executing certain job steps
543
543
#[serde(default)]
544
544
pubgithub_build_setup:Option<String>,
545
545
546
+
/// The jobs to which the [`DistMetadata::github_build_setup`] steps should be prepended
547
+
#[serde(default)]
548
+
pubgithub_build_setup_jobs:Option<Vec<String>>,
549
+
546
550
/// Configuration specific to Mac .pkg installers
547
551
#[serde(skip_serializing_if = "Option::is_none")]
548
552
#[serde(default)]
@@ -645,6 +649,7 @@ impl DistMetadata {
645
649
package_libraries: _,
646
650
install_libraries: _,
647
651
github_build_setup: _,
652
+
github_build_setup_jobs: _,
648
653
mac_pkg_config: _,
649
654
min_glibc_version: _,
650
655
binaries: _,
@@ -752,6 +757,7 @@ impl DistMetadata {
752
757
package_libraries,
753
758
install_libraries,
754
759
github_build_setup,
760
+
github_build_setup_jobs,
755
761
mac_pkg_config,
756
762
min_glibc_version,
757
763
binaries,
@@ -880,6 +886,9 @@ impl DistMetadata {
880
886
if github_build_setup.is_some(){
881
887
warn!("package.metadata.dist.github-build-setup is set, but this is only accepted in workspace.metadata (value is being ignored): {}", package_manifest_path);
882
888
}
889
+
if github_build_setup_jobs.is_some(){
890
+
warn!("package.metadata.dist.github-build-setup-jobs is set, but this is only accepted in workspace.metadata (value is being ignored): {}", package_manifest_path);
0 commit comments