Skip to content

Commit 501a48b

Browse files
authored
ci: added knope for managing releases (#547)
1 parent ca3d24a commit 501a48b

File tree

5 files changed

+87
-69
lines changed

5 files changed

+87
-69
lines changed

.gemini/styleguide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,11 @@ async fn handle(user: &User, req: &Request) -> Result<Response> {
8080
tracing::trace!(%user.id, %req.id, "entered handler");
8181
Ok(...)
8282
}
83+
84+
## Releasing
85+
86+
We are using `knope` with changesets for declaring changes. If you detect a new file in a PR under `.changeset/` directory, please confirm the following rules:
87+
88+
- Every new `changesets` file that touches `query-planner` must have a `router` changeset - either in the same changeset or a separate changeset.
89+
- Every new `changesets` file that touches `executor` must have a `query-planner` changeset - either in the same changeset or a separate changeset.
90+
- If a PR touches `config` crate and adds/changes to the `HiveRouterConfig` struct, it must have a `router` changeset that contains a YAML example on how the configuration needs to be used.

.github/workflows/release.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,38 @@ jobs:
2020
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
2121
with:
2222
cache: false
23-
- name: Authenticate with crates.io
23+
- name: authenticate with crates.io
2424
uses: rust-lang/crates-io-auth-action@v1
2525
id: auth
26-
- name: release-plz release
27-
uses: release-plz/action@d529f731ae3e89610ada96eda34e5c6ba3b12214 # v0.5.118
28-
with:
29-
command: release
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
32-
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
26+
# - name: release-plz release
27+
# uses: release-plz/action@d529f731ae3e89610ada96eda34e5c6ba3b12214 # v0.5.118
28+
# with:
29+
# command: release
30+
# env:
31+
# GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
32+
# CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
3333

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-
with:
44-
fetch-depth: 0
45-
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
46-
with:
47-
cache: false
48-
- name: Authenticate with crates.io
49-
uses: rust-lang/crates-io-auth-action@v1
50-
id: auth
51-
- name: release-plz release-pr
52-
uses: release-plz/action@d529f731ae3e89610ada96eda34e5c6ba3b12214 # v0.5.118
53-
with:
54-
command: release-pr
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
57-
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
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+
# with:
44+
# fetch-depth: 0
45+
# - uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
46+
# with:
47+
# cache: false
48+
# - name: Authenticate with crates.io
49+
# uses: rust-lang/crates-io-auth-action@v1
50+
# id: auth
51+
# - name: release-plz release-pr
52+
# uses: release-plz/action@d529f731ae3e89610ada96eda34e5c6ba3b12214 # v0.5.118
53+
# with:
54+
# command: release-pr
55+
# env:
56+
# GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
57+
# CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ See [GitHub Releases](https://github.com/graphql-hive/router/releases) to the fu
5252

5353
### Docker
5454

55-
The router image is being published to [Docker to GitHub Container Registry](). You may use it directly using the following command:
55+
The router image is being published to [Docker to GitHub Container Registry](https://github.com/graphql-hive/router/pkgs/container/router). You may use it directly using the following command:
5656

5757
```bash
5858
docker run \

knope.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[bot.releases]
2+
enabled = true
3+
4+
[github]
5+
owner = "graphql-hive"
6+
repo = "router"
7+
8+
[packages.query-planner]
9+
versioned_files = ["lib/query-planner/Cargo.toml", { path = "lib/executor/Cargo.toml", dependency = "hive-router-query-planner" }, { path = "bin/router/Cargo.toml", dependency = "hive-router-query-planner" }, "Cargo.lock"]
10+
scopes = ["hive-router-query-planner", "qp", "query-planner"]
11+
changelog = "lib/query-planner/CHANGELOG.md"
12+
13+
[packages.executor]
14+
versioned_files = ["lib/executor/Cargo.toml", { path = "bin/router/Cargo.toml", dependency = "hive-router-plan-executor" }, "Cargo.lock"]
15+
scopes = ["hive-router-plan-executor", "executor"]
16+
changelog = "lib/executor/CHANGELOG.md"
17+
18+
[packages.router]
19+
versioned_files = ["bin/router/Cargo.toml", "Cargo.lock"]
20+
scopes = ["hive-router", "router", "config", "qp", "executor"]
21+
changelog = "bin/router/CHANGELOG.md"
22+
23+
# "release" pipeline that prepares the release and pushes a release PR
24+
[[workflows]]
25+
name = "release"
26+
[[workflows.steps]]
27+
type = "PrepareRelease"
28+
ignore_conventional_commits = true
29+
[[workflows.steps]]
30+
type = "Command"
31+
command = 'git commit -m "chore: prepare releases"'
32+
[[workflows.steps]]
33+
type = "Command"
34+
command = "git push"
35+
[[workflows.steps]]
36+
type = "Release"
37+
38+
# "document-change" pipeline that prepares the release and pushes a release PR
39+
[[workflows]]
40+
name = "document-change"
41+
[[workflows.steps]]
42+
type = "CreateChangeFile"
43+
[[workflows]]
44+
name = "changeset"
45+
[[workflows.steps]]
46+
type = "CreateChangeFile"

release-plz.toml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)