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
setup: add auto configuration for publishing workflows
Make repository_setup.sh automatically discover whether we have a multi
crate cargo workspace, or just a single crate repository, and then
generate a publish github action for each of them that triggers when a
tag named '$crate_name-v*' (or just 'v*' for single-crate repos) is
published.
Signed-off-by: Patrick Roy <[email protected]>
# Use printf when writing this value, so that whitespaces/newlines are respected
122
+
workflow=$(sed "s/'v\*'/'$crate_name-v*'/"$RUST_VMM_CI/publish.yml | sed "s/cd ./cd $member_path/")
123
+
124
+
if [ -f$workflow_file ] && cmp --silent $workflow_file<(printf "$workflow");then
125
+
echo"Publish workflow for $crate_name already setup, skipping"
126
+
continue
127
+
fi
128
+
129
+
if confirm "Found workspace member '$crate_name' at '$member_path'. Setup auto-publish?";then
130
+
if [ -f$workflow_file ] &&! confirm "$workflow_file already exists. Overwrite?";then
131
+
continue
132
+
fi
133
+
134
+
printf"$workflow">$workflow_file
135
+
echo"If not already done, go to https://crates.io/crates/$crate_name/settings and add $(basename $workflow_file) as a trusted publisher!"
136
+
fi
137
+
done
138
+
else
139
+
question="Single crate repository detected, setup running 'cargo publish' at repository root when tags matching 'v*' are published? (if a .github/workflows/publish.yml file already exists, it will be overwritten)"
0 commit comments