Skip to content

Commit

Permalink
chore: checkout release PR before bumping npm version (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvolin authored Sep 20, 2024
1 parent f310ba8 commit e8546be
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
run: |
node_wasm_version="$(cargo pkgid --manifest-path=node-wasm/Cargo.toml | cut -d@ -f 2)"
pr_branch_name=${{ steps.release-plz.outputs.pr.head_branch }}
# switch to the branch created by release-plz
git fetch
git checkout "$pr_branch_name"
cd node-wasm/js
# Update the version of lumina-node-wasm dependency
node_wasm_version="$(cargo pkgid --manifest-path=node-wasm/Cargo.toml | cut -d@ -f 2)"
cd node-wasm/js
npm pkg set "dependencies[lumina-node-wasm]=$node_wasm_version"
# Update lumina-node version
npm version $node_wasm_version
# push a commit to release-plz's pr
# fetch the branch created by release-plz
git fetch
# prepare graphql query
branch_name=${{ steps.release-plz.outputs.pr.head_branch }}
branch_sha="$(git rev-parse "$branch_name")"
branch_sha="$(git rev-parse "$pr_branch_name")"
package_json="$(base64 --wrap 0 package.json)"
query='{"query": "mutation {
createCommitOnBranch(input: {
branch: {
repositoryNameWithOwner: \"eigerco/lumina\",
branchName: \"'"$branch_name"'\"
branchName: \"'"$pr_branch_name"'\"
},
message: {
headline: \"update lumina-node npm package\"
Expand Down

0 comments on commit e8546be

Please sign in to comment.