Skip to content

Commit b8a2c05

Browse files
committed
ci: add backport workflow
Add GitHub Actions workflow to allow backporting PRs to release branches.
1 parent 1866144 commit b8a2c05

File tree

2 files changed

+69
-6
lines changed

2 files changed

+69
-6
lines changed

.github/workflows/backport.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Backport"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- "closed"
7+
- "labeled"
8+
9+
concurrency:
10+
group: "PR #${{ github.event.pull_request.number }}"
11+
cancel-in-progress: false
12+
13+
jobs:
14+
backport:
15+
if: "github.event.pull_request.merged"
16+
runs-on: "ubuntu-24.04"
17+
steps:
18+
- uses: "actions/checkout@v5"
19+
with:
20+
ref: "main"
21+
clean: false
22+
fetch-depth: 0
23+
- uses: "actions/create-github-app-token@v2"
24+
id: "backport-pr-app-token"
25+
with:
26+
app-id: "${{ vars.BACKPORT_PR_APP_ID }}"
27+
private-key: "${{ secrets.BACKPORT_PR_APP_KEY }}"
28+
- uses: "oxidecomputer/backport-pr-action@v0"
29+
with:
30+
pr: "${{ github.event.pull_request.number }}"
31+
github-token: "${{ steps.backport-pr-app-token.outputs.token }}"
32+
bot-name: "Oxide Backport Bot"
33+
bot-email: "[email protected]"

CONTRIBUTING.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,47 @@ you wish to generate the SDK from, and run:
1414
$ make all
1515
```
1616

17+
## Backporting changes
18+
19+
The repository is organized with multiple release branches, each targeting a
20+
specific release line. The release branches are named `rel/vX.Y` where `X.Y`
21+
represents the release line version.
22+
23+
Pull requests should target the `main` branch and be backported to release
24+
lines as necessary.
25+
26+
To backport a PR to the branch `rel/vX.Y` add the label
27+
`backport/vX.Y` to the PR. Once merged, the backport automation will create a
28+
new PR backporting the changes to the release branch. The backport label can
29+
also be added after the PR is merged.
30+
31+
If a backport has merge conflicts, the conflicts are committed to the PR and
32+
you can checkout the branch to fix them. Once the changes are clean, you can
33+
merge the backport PR.
34+
1735
## Releasing a new SDK version
1836

19-
1. Make sure the following files have the new version you want to release.
37+
### Breaking change release
38+
39+
Releases that contain breaking changes require a new release branch.
40+
41+
1. Create a branch called `rel/vX.Y` from `main`.
42+
2. Create a new label called `backport/vX.Y`.
43+
44+
Proceed with the steps below to complete the release.
45+
46+
### General release flow
47+
48+
1. Switch to the release branch you are targeting.
49+
2. Make sure the following files have the new version you want to release.
2050
- [`VERSION`](./VERSION)
2151
- [`oxide/version.go`](./oxide/version.go)
22-
2. Make sure you have run `make all` and pushed any changes. The release
52+
3. Make sure you have run `make all` and pushed any changes. The release
2353
will fail if running `make all` causes any changes to the generated
2454
code.
25-
3. Generate the changelog with `make changelog`.
26-
4. Run `make tag` from your local `main` branch. This is just a command for making a git tag
55+
4. Generate the changelog with `make changelog`.
56+
5. Run `make tag` from your local `main` branch. This is just a command for making a git tag
2757
formatted correctly with the version.
28-
5. Push the tag (the result of `make tag` gives instructions for this) to this repository.
29-
6. Everything else is triggered from the tag push. Just make sure all the tests
58+
6. Push the tag (the result of `make tag` gives instructions for this) to this repository.
59+
7. Everything else is triggered from the tag push. Just make sure all the tests
3060
pass on the `main` branch before making and pushing a new tag.

0 commit comments

Comments
 (0)