-
Notifications
You must be signed in to change notification settings - Fork 23
62 lines (54 loc) · 2.02 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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