From 74adb7388fcdf789ab3968d5cb340e2be2a1c41e Mon Sep 17 00:00:00 2001 From: rzadp Date: Thu, 14 Mar 2024 20:59:20 +0100 Subject: [PATCH] replace edition --- .github/workflows/publish-templates.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish-templates.yml b/.github/workflows/publish-templates.yml index 7f541bede9d75..e89c1c15ed068 100644 --- a/.github/workflows/publish-templates.yml +++ b/.github/workflows/publish-templates.yml @@ -40,13 +40,19 @@ jobs: - name: Replace the workspace references in the template run: | set -euo pipefail + # Use released creates, instead of git references. find . -type f -name 'Cargo.toml' -exec psvm -o -v ${{ env.polkadot-release-version }} -p {} \; + + # Set the Rust edition. + rust_edition=$(cat ../../Cargo.toml | grep "edition =") + find . -type f -name 'Cargo.toml' -exec sed -i -E "s/edition\.workspace = true\$/$rust_edition/g" {} \; # Get rid of "authors.workspace = true" and similar entries. find . -type f -name 'Cargo.toml' -exec sed -i -E "s/^.*\.workspace = true\$//g" {} \; find . -type f -name 'Cargo.toml' -exec sed -i -E "s/^workspace = true\$//g" {} \; # Replace workspace dependencies with actual versions. + # e.g. serde_json = { workspace = true, default-features = true } replace_workspace_deps () { # To preserve TAB identation. IFS=''