Skip to content

Commit

Permalink
bump the router_bridge minor version when fed minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
clenfest committed Jul 26, 2024
1 parent 6bb812c commit 29a0de0
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Create harmonizer release
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
FED_VERSION: ${{ github.event.inputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -24,10 +24,10 @@ jobs:
node-version: 16

- name: start
run: echo "$VERSION"
run: echo "$FED_VERSION"

- name: Update @apollo/composition
run: npm i --prefix ./harmonizer -E "@apollo/composition@$VERSION"
run: npm i --prefix ./harmonizer -E "@apollo/composition@$FED_VERSION"

# - name: Install Rustup
# run: curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand All @@ -47,7 +47,7 @@ jobs:
name: Create router-bridge release
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
FED_VERSION: ${{ github.event.inputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -68,13 +68,27 @@ jobs:

- name: Run cargo edit and cargo build
run: |
echo $VERSION
NEW_VERSION=`cargo metadata --format-version 1 |jq -r '.packages[] | select(.name=="router-bridge") | .version' | python3 -c 'import sys; version=sys.stdin.readline().split("+")[0].split("."); version[2] = str(int(version[2]) + 1); print(".".join(version))'`+"v$VERSION"
echo $FED_VERSION
NEW_VERSION=`cargo metadata --format-version 1 |jq -r '.packages[] | select(.name=="router-bridge") | .version' | python3 -c '
import sys
import os
fedVersion=os.getenv("FED_VERSION").split(".")
router_version=sys.stdin.readline().split("+v")
rv_1 = router_version[0].split(".")
rv_2 = router_version[1].split(".")
if rv_2[0] == fedVersion[0] and rv_2[1] == fedVersion[1]:
rv_1[2] = str(int(rv_1[2]) + 1)
else:
rv_1[1] = str(int(rv_1[1]) + 1)
rv_1[2] = "0"
print(".".join(rv_1))
'`+"v$VERSION"
echo "New version " $NEW_VERSION
cargo set-version $NEW_VERSION -p router-bridge
cargo build -p router-bridge
cd router-bridge
npm version --allow-same-version "$VERSION"
npm version --allow-same-version "$FED_VERSION"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
Expand Down

0 comments on commit 29a0de0

Please sign in to comment.