Skip to content

Commit 6a5b6e0

Browse files
EgorPopelyaevrzadp
andauthored
Adjust sync templates flow to use new release branch (#5182)
As the release branch name changed starting from this release, this PR adds it to the sync templates flow so that checkout step worked properly. --------- Co-authored-by: rzadp <[email protected]>
1 parent 7d0aa89 commit 6a5b6e0

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/misc-sync-templates.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ on:
1818
# A manual dispatch for now - automatic on releases later.
1919
workflow_dispatch:
2020
inputs:
21-
crate_release_version:
22-
description: 'A release version to use, e.g. 1.9.0'
21+
stable_release_branch:
22+
description: 'Stable release branch, e.g. stable2407'
2323
required: true
2424

25-
2625
jobs:
2726
sync-templates:
2827
runs-on: ubuntu-latest
@@ -44,7 +43,7 @@ jobs:
4443
- uses: actions/checkout@v4
4544
with:
4645
path: polkadot-sdk
47-
ref: "release-crates-io-v${{ github.event.inputs.crate_release_version }}"
46+
ref: "${{ github.event.inputs.stable_release_branch }}"
4847
- name: Generate a token for the template repository
4948
id: app_token
5049
uses: actions/[email protected]
@@ -72,8 +71,8 @@ jobs:
7271
7372
# 2. Yanking the template out of the monorepo workspace.
7473

75-
- name: Use psvm to replace git references with released creates.
76-
run: find . -type f -name 'Cargo.toml' -exec psvm -o -v ${{ github.event.inputs.crate_release_version }} -p {} \;
74+
- name: Replace dev-dependencies path references with workspace references
75+
run: find . -type f -name 'Cargo.toml' -exec sed -i'' -E "s/path = \"\.\.\/.*\"/workspace = true/g" {} \;
7776
working-directory: polkadot-sdk/templates/${{ matrix.template }}/
7877
- name: Create a new workspace Cargo.toml
7978
run: |
@@ -123,7 +122,7 @@ jobs:
123122
cp -r polkadot-sdk/templates/${{ matrix.template }}/* "${{ env.template-path }}/"
124123
125124
- name: Run psvm on monorepo workspace dependencies
126-
run: psvm -o -v ${{ github.event.inputs.crate_release_version }} -p ./Cargo.toml
125+
run: psvm -o -v ${{ github.event.inputs.stable_release_branch }} -p ./Cargo.toml
127126
working-directory: polkadot-sdk/
128127
- name: Copy over required workspace dependencies
129128
run: |
@@ -164,12 +163,12 @@ jobs:
164163
token: ${{ steps.app_token.outputs.token }}
165164
add-paths: |
166165
./*
167-
title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.crate_release_version }}"
166+
title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.stable_release_branch }}"
168167
body: "The template has NOT been successfully built and needs to be inspected."
169-
branch: "update-template/${{ github.event.inputs.crate_release_version }}"
168+
branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
170169
- name: Push changes
171170
run: |
172171
git add -A .
173-
git commit --allow-empty -m "Update to ${{ github.event.inputs.crate_release_version }} triggered by ${{ github.event_name }}"
172+
git commit --allow-empty -m "Update to ${{ github.event.inputs.stable_release_branch }} triggered by ${{ github.event_name }}"
174173
git push
175174
working-directory: "${{ env.template-path }}"

0 commit comments

Comments
 (0)