Skip to content

Commit a80cb5b

Browse files
committed
feat(release): release via crates
release: major
1 parent 95f8493 commit a80cb5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+450
-251
lines changed

.cargo/config.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# The following are aliases you can use with "cargo command_name"
22
[alias]
3-
router = "run --package router"
3+
router = "run --package hive-router"
44
dev = "run --package qp-dev-cli"
55
subgraphs = "run --package subgraphs"
66
test_all = "test --workspace"
7-
test_qp = "test --package query-planner -- --nocapture"
8-
test_qpe = "test --package query-plan-executor -- --nocapture"
7+
test_qp = "test --package hive-router-query-planner -- --nocapture"
8+
test_qpe = "test --package hive-router-plan-executor -- --nocapture"
99
"clippy:fix" = "clippy --all --fix --allow-dirty --allow-staged"
10-
"router-config" = "run --release -p router-config router-config.schema.json"
10+
"router-config" = "run --release -p hive-router-config router-config.schema.json"

.github/workflows/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ env:
3131
jobs:
3232
config:
3333
runs-on: ubuntu-latest
34+
if: github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hive-router-v'))
3435
steps:
3536
- name: checkout
3637
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -61,6 +62,7 @@ jobs:
6162

6263
binary:
6364
name: ${{ matrix.name }}
65+
if: github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'release' && startsWith(github.event.release.tag_name, 'hive-router-v'))
6466
runs-on: ubuntu-latest
6567
strategy:
6668
matrix:

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ jobs:
8383
steps:
8484
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
8585
- uses: actions-rust-lang/setup-rust-toolchain@ac90e63697ac2784f4ecfe2964e1a285c304003a # v1
86-
- if: matrix.name == 'Executor'
86+
- if: matrix.name == 'executor'
8787
name: Build subgraphs
8888
run: cargo build --release -p subgraphs
89-
- if: matrix.name == 'Executor'
89+
- if: matrix.name == 'executor'
9090
name: Run subgraphs
9191
run: ./target/release/subgraphs & sleep 5
9292
- name: Run benchmarks
@@ -121,7 +121,7 @@ jobs:
121121
- name: Run subgraphs
122122
run: ./target/release/subgraphs & sleep 5
123123
- name: Build router
124-
run: cargo build --release -p router
124+
run: cargo build --release -p hive-router
125125
- name: Run router
126126
run: ./target/release/hive_router & sleep 5
127127
env:
@@ -179,7 +179,7 @@ jobs:
179179
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
180180
with:
181181
node-version-file: audits/.node-version
182-
- run: cargo build --package router
182+
- run: cargo build --package hive-router
183183
- run: npm install
184184
working-directory: audits
185185
- run: npm run test:federation-all

.github/workflows/release.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: release
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
id-token: write
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
publish-crates:
15+
name: crates
16+
runs-on: ubuntu-latest
17+
if: ${{ github.repository_owner == 'graphql-hive' }}
18+
steps:
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
20+
- uses: actions-rust-lang/setup-rust-toolchain@ac90e63697ac2784f4ecfe2964e1a285c304003a # v1
21+
with:
22+
cache: false
23+
- name: Authenticate with crates.io
24+
uses: rust-lang/crates-io-auth-action@v1
25+
id: auth
26+
- name: release-plz release
27+
uses: release-plz/action@f9715bc3b46e211f764f4440a221ddb89ae8abb3 # v0.5.112
28+
with:
29+
command: release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
32+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
33+
34+
release-pr:
35+
name: pr
36+
runs-on: ubuntu-latest
37+
if: ${{ github.repository_owner == 'graphql-hive' }}
38+
concurrency:
39+
group: create-release-pr-${{ github.ref }}
40+
cancel-in-progress: false
41+
steps:
42+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
43+
- uses: actions-rust-lang/setup-rust-toolchain@ac90e63697ac2784f4ecfe2964e1a285c304003a # v1
44+
with:
45+
cache: false
46+
- name: Authenticate with crates.io
47+
uses: rust-lang/crates-io-auth-action@v1
48+
id: auth
49+
- name: release-plz release-pr
50+
uses: release-plz/action@f9715bc3b46e211f764f4440a221ddb89ae8abb3 # v0.5.112
51+
with:
52+
command: release-pr
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
55+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

Cargo.lock

Lines changed: 97 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bench/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cargo router
1212

1313
```
1414
cargo build --release -p subgraphs
15-
cargo build --release -p router
15+
cargo build --release -p hive-router
1616
1717
./target/release/subgraphs
1818
./target/release/hive_router bench/supergraph.graphql

bench/subgraphs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "subgraphs"
33
version = "0.0.1"
44
edition = "2021"
5+
publish = false
56

67
[[bin]]
78
name = "subgraphs"

bin/dev-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "qp-dev-cli"
3-
version = "0.0.1"
43
edition = "2021"
4+
publish = false
55

66
[[bin]]
77
name = "qp-dev-cli"
88
path = "src/main.rs"
99

1010
[dependencies]
11-
query-planner = { path = "../../lib/query-planner" }
11+
hive-router-query-planner = { path = "../../lib/query-planner" }
1212

1313
graphql-parser = { workspace = true }
1414
tracing-subscriber = { workspace = true }

0 commit comments

Comments
 (0)