From e12fdd0449c59560294baeb47bcb15593e449fa4 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 30 Jul 2024 10:47:53 +0200 Subject: [PATCH 1/3] add stable release branch to intputs --- .github/workflows/misc-sync-templates.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/misc-sync-templates.yml b/.github/workflows/misc-sync-templates.yml index 35e08fcaa131..5f431d74c735 100644 --- a/.github/workflows/misc-sync-templates.yml +++ b/.github/workflows/misc-sync-templates.yml @@ -21,7 +21,9 @@ on: crate_release_version: description: 'A release version to use, e.g. 1.9.0' required: true - + stable_release_branch: + description: 'Stable release branch, e.g. stable2407' + required: true jobs: sync-templates: @@ -44,7 +46,7 @@ jobs: - uses: actions/checkout@v4 with: path: polkadot-sdk - ref: "release-crates-io-v${{ github.event.inputs.crate_release_version }}" + ref: "${{ github.event.inputs.stable_release_branch }}" - name: Generate a token for the template repository id: app_token uses: actions/create-github-app-token@v1.9.3 From d5009775537b2c97da44c08f1a9edb0dc1b85962 Mon Sep 17 00:00:00 2001 From: rzadp Date: Tue, 30 Jul 2024 20:21:41 +0200 Subject: [PATCH 2/3] Use the branch everywhere, no longer needing crate versions --- .github/workflows/misc-sync-templates.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/misc-sync-templates.yml b/.github/workflows/misc-sync-templates.yml index 5f431d74c735..d4e492373848 100644 --- a/.github/workflows/misc-sync-templates.yml +++ b/.github/workflows/misc-sync-templates.yml @@ -18,9 +18,6 @@ on: # A manual dispatch for now - automatic on releases later. workflow_dispatch: inputs: - crate_release_version: - description: 'A release version to use, e.g. 1.9.0' - required: true stable_release_branch: description: 'Stable release branch, e.g. stable2407' required: true @@ -125,7 +122,7 @@ jobs: 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 + run: psvm -o -v ${{ github.event.inputs.stable_release_branch }} -p ./Cargo.toml working-directory: polkadot-sdk/ - name: Copy over required workspace dependencies run: | @@ -166,12 +163,12 @@ jobs: token: ${{ steps.app_token.outputs.token }} add-paths: | ./* - title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.crate_release_version }}" + title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.stable_release_branch }}" body: "The template has NOT been successfully built and needs to be inspected." - branch: "update-template/${{ github.event.inputs.crate_release_version }}" + branch: "update-template/${{ github.event.inputs.stable_release_branch }}" - name: Push changes run: | git add -A . - git commit --allow-empty -m "Update to ${{ github.event.inputs.crate_release_version }} triggered by ${{ github.event_name }}" + git commit --allow-empty -m "Update to ${{ github.event.inputs.stable_release_branch }} triggered by ${{ github.event_name }}" git push working-directory: "${{ env.template-path }}" From 34198630616ae8df4e6173cecd8fe51f70736b64 Mon Sep 17 00:00:00 2001 From: rzadp Date: Tue, 30 Jul 2024 20:22:34 +0200 Subject: [PATCH 3/3] Different way to replace path-based dev-dependencies --- .github/workflows/misc-sync-templates.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/misc-sync-templates.yml b/.github/workflows/misc-sync-templates.yml index d4e492373848..d22dc8724f37 100644 --- a/.github/workflows/misc-sync-templates.yml +++ b/.github/workflows/misc-sync-templates.yml @@ -71,8 +71,8 @@ jobs: # 2. Yanking the template out of the monorepo workspace. - - name: Use psvm to replace git references with released creates. - run: find . -type f -name 'Cargo.toml' -exec psvm -o -v ${{ github.event.inputs.crate_release_version }} -p {} \; + - name: Replace dev-dependencies path references with workspace references + run: find . -type f -name 'Cargo.toml' -exec sed -i'' -E "s/path = \"\.\.\/.*\"/workspace = true/g" {} \; working-directory: polkadot-sdk/templates/${{ matrix.template }}/ - name: Create a new workspace Cargo.toml run: |