Skip to content

Release Components #130

Release Components

Release Components #130

Workflow file for this run

name: Release Components
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: Federation release version
jobs:
router-bridge_pr:
name: Create router-bridge release
runs-on: ubuntu-latest
env:
FED_VERSION: ${{ github.event.inputs.version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js 16
uses: actions/setup-node@v4
with:
node-version: 16
# - name: Install Rustup
# run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: Update @apollo/federation-internals and @apollo/query-planner
run: npm i --prefix ./router-bridge "@apollo/federation-internals@$FED_VERSION" "@apollo/query-planner@$FED_VERSION"
- name: Install Cargo edit
run: cargo install cargo-edit
- name: Run cargo edit and cargo build
run: |
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$FED_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 "$FED_VERSION"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Automated PR for router-bridge release ${{github.event.inputs.version}}"
branch: create-pull-request/router-bridge