Skip to content

Commit

Permalink
Update the template synchronization script (#5022)
Browse files Browse the repository at this point in the history
There are slight changes required, after
#4716.

In order to follow the convention in the templates, we need to specify
the internal template dependencies (runtime and a pallet) in the main
`Cargo.toml`.

Additionally, there are now dependencies with `path` in the main
`Cargo.toml`, so we add a step with `psvm` to change those references to
crate versions.
  • Loading branch information
rzadp authored Jul 18, 2024
1 parent 25d9b59 commit b6607cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ jobs:
"runtime",
]
resolver = "2"
[workspace.dependencies]
EOF
echo "$(toml get -r ./runtime/Cargo.toml 'package.name') = { path = \"./runtime\", default-features = false }" >> Cargo.toml
echo "$(toml get -r ./pallets/template/Cargo.toml 'package.name') = { path = \"./pallets/template\", default-features = false }" >> Cargo.toml
shell: bash
working-directory: polkadot-sdk/templates/${{ matrix.template }}/
- name: Update workspace configuration
Expand All @@ -116,9 +121,12 @@ jobs:
- name: Copy over the new changes
run: |
cp -r polkadot-sdk/templates/${{ matrix.template }}/* "${{ env.template-path }}/"
- name: Run psvm on monorepo workspace dependencies
run: psvm -o -v ${{ github.event.inputs.crate_release_version }} -p ./Cargo.toml
working-directory: polkadot-sdk/
- name: Copy over required workspace dependencies
run: |
echo -e "\n[workspace.dependencies]" >> Cargo.toml
set +e
# If a workspace dependency is required..
while cargo tree --depth 1 --prefix none --no-dedupe 2>&1 | grep 'was not found in `workspace.dependencies`'; do
Expand Down

0 comments on commit b6607cb

Please sign in to comment.