From d78a1dd712bb7d5c0a2a9f776455ad243e244584 Mon Sep 17 00:00:00 2001 From: George Oastler Date: Tue, 2 Jul 2024 18:00:23 +0100 Subject: [PATCH] fix bump workflow to bump all package.json files and Cargo.tomls --- .github/workflows/bump_version.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index b84670234c..2e790ad813 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -99,11 +99,19 @@ jobs: GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }} run: | # make a new branch for the version changes - git switch -c bump-version-${{ github.event.inputs.version }} - - # make the version changes - npm run version ${{ github.event.inputs.version }} - + git switch -c release/${{ github.event.inputs.version }} + + set -eu + # find all package.json files, recursively + pkgJsons=$(find . -name package.json -prune -not -path '*/node_modules/*' -not -path '*/.next/*') + # replace the version in all package.json files + xargs -I % sh -c "cat % | jq '.version = \"${{ github.event.inputs.version }}\"' > %" <<< "$pkgJsons" + + # find all Cargo.toml files + cargoTomls=$(find . -name Cargo.toml -prune -not -path '*/protocol/cargo-cache/*') + # replace the first version line in all Cargo.toml files + xargs -I % sh -c "sed -i '0,/version =/s/version =.*/version = \"${{ github.event.inputs.version }}\"/' %" <<< "$cargoTomls" + # rebuild typechain npm run build:typechain