Skip to content

Commit 6db5a66

Browse files
committed
Sync repo templates ⚙
Sync with coreos/repo-templates@9843b5e.
1 parent 972092a commit 6db5a66

File tree

4 files changed

+173
-37
lines changed

4 files changed

+173
-37
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
# Template generated by https://github.com/coreos/repo-templates; do not edit downstream
3+
---
4+
5+
# Release process
6+
7+
This project uses [cargo-release][cargo-release] in order to prepare new releases, tag and sign the relevant git commit, and publish the resulting artifacts to [crates.io][crates-io].
8+
The release process follows the usual PR-and-review flow, allowing an external reviewer to have a final check before publishing.
9+
10+
## Requirements
11+
12+
This guide requires:
13+
14+
* A web browser (and network connectivity)
15+
* `git`
16+
* [GPG setup][GPG setup] and personal key for signing
17+
* `cargo` (suggested: latest stable toolchain from [rustup][rustup])
18+
* `cargo-release` (suggested: `cargo install -f cargo-release`)
19+
* Write access to this GitHub project
20+
* A verified account on crates.io
21+
* Membership in the [Fedora CoreOS Crates Owners group](https://github.com/orgs/coreos/teams/fedora-coreos-crates-owners/members), which will give you upload access to crates.io
22+
23+
## Release checklist
24+
25+
These steps show how to release version `x.y.z` on the `origin` remote (this can be checked via `git remote -av`).
26+
Push access to the upstream repository is required in order to publish the new tag and the PR branch.
27+
28+
:warning:: if `origin` is not the name of the locally configured remote that points to the upstream git repository (i.e. `[email protected]:coreos/stream-metadata-rust.git`), be sure to assign the correct remote name to the `UPSTREAM_REMOTE` variable.
29+
30+
- prepare environment:
31+
- [ ] `RELEASE_VER=x.y.z`
32+
- [ ] `UPSTREAM_REMOTE=origin`
33+
- [ ] `git checkout -b pre-release-${RELEASE_VER}`
34+
35+
- write release notes:
36+
- [ ] write release notes in `docs/release-notes.md`
37+
- [ ] `git add docs/release-notes.md && git commit -m "docs/release-notes: update for release ${RELEASE_VER}"`
38+
39+
- land the changes:
40+
- [ ] PR the changes, get them reviewed, approved and merged
41+
- [ ] if doing a branched release, also include a PR to merge the `docs/release-notes.md` changes into main
42+
43+
- make sure the project is clean:
44+
- [ ] Make sure `cargo-release` is up to date: `cargo install cargo-release`
45+
- [ ] `git checkout main && git pull ${UPSTREAM_REMOTE} main`
46+
- [ ] `cargo test --all-features`
47+
- [ ] `cargo clean`
48+
- [ ] `git clean -fd`
49+
50+
- create release commit on a dedicated branch and tag it (the commit and tag will be signed with the GPG signing key you configured):
51+
- [ ] `git checkout -b release-${RELEASE_VER}`
52+
- [ ] `cargo release --execute ${RELEASE_VER}` (and confirm the version when prompted)
53+
54+
- open and merge a PR for this release:
55+
- [ ] `git push ${UPSTREAM_REMOTE} release-${RELEASE_VER}`
56+
- [ ] open a web browser and create a PR for the branch above
57+
- [ ] make sure the resulting PR contains exactly one commit
58+
- [ ] get the PR reviewed, approved and merged
59+
60+
- publish the artifacts (tag and crate):
61+
- [ ] `git checkout v${RELEASE_VER}`
62+
- [ ] verify that `grep "^version = \"${RELEASE_VER}\"$" Cargo.toml` produces output
63+
- [ ] `git push ${UPSTREAM_REMOTE} v${RELEASE_VER}`
64+
- [ ] `cargo publish`
65+
66+
- publish this release on GitHub:
67+
- [ ] find the new tag in the [GitHub tag list](https://github.com/coreos/stream-metadata-rust/tags), click the triple dots menu, and create a release for it
68+
- [ ] copy in the changelog from the release notes doc
69+
- [ ] publish release
70+
71+
- clean up the local environment (optional, but recommended):
72+
- [ ] `cargo clean`
73+
- [ ] `git checkout main`
74+
- [ ] `git pull ${UPSTREAM_REMOTE} main`
75+
- [ ] `git push ${UPSTREAM_REMOTE} :pre-release-${RELEASE_VER} :release-${RELEASE_VER}`
76+
- [ ] `git branch -d pre-release-${RELEASE_VER} release-${RELEASE_VER}`
77+
78+
[cargo-release]: https://github.com/sunng87/cargo-release
79+
[rustup]: https://rustup.rs/
80+
[crates-io]: https://crates.io/
81+
[GPG setup]: https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification

.github/dependabot.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# Maintained in https://github.com/coreos/repo-templates
2+
# Do not edit downstream.
3+
14
version: 2
25
updates:
3-
- package-ecosystem: cargo
4-
directory: /
5-
schedule:
6-
interval: weekly
7-
open-pull-requests-limit: 10
8-
labels:
9-
- dependency
6+
- package-ecosystem: cargo
7+
directory: /
8+
schedule:
9+
interval: weekly
10+
open-pull-requests-limit: 10
11+
labels:
12+
- dependency
13+
- skip-notes
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Maintained in https://github.com/coreos/repo-templates
2+
# Do not edit downstream.
3+
4+
name: Release notes
5+
6+
on:
7+
pull_request:
8+
branches: [main]
9+
types: [opened, synchronize, reopened, labeled, unlabeled]
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: release-note-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
require-notes:
20+
name: Require release note
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Require release-notes.md update
24+
uses: coreos/actions-lib/require-file-change@main
25+
with:
26+
path: docs/release-notes.md
27+
override-label: skip-notes

.github/workflows/rust.yml

+54-30
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,114 @@
1-
---
2-
name: Rust
1+
# Maintained in https://github.com/coreos/repo-templates
2+
# Do not edit downstream.
33

4+
name: Rust
45
on:
56
push:
67
branches: [main]
78
pull_request:
89
branches: [main]
9-
1010
permissions:
1111
contents: read
1212

13+
# don't waste job slots on superseded code
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1318
env:
1419
CARGO_TERM_COLOR: always
1520
# Pinned toolchain for linting
1621
ACTIONS_LINTS_TOOLCHAIN: 1.69.0
1722

1823
jobs:
1924
tests-stable:
20-
name: "Tests, stable toolchain"
25+
name: Tests, stable toolchain
2126
runs-on: ubuntu-latest
2227
steps:
23-
- name: Checkout repository
28+
- name: Check out repository
2429
uses: actions/checkout@v3
2530
- name: Install toolchain
2631
uses: dtolnay/rust-toolchain@v1
2732
with:
2833
toolchain: stable
34+
- name: Cache build artifacts
35+
uses: Swatinem/rust-cache@v2
2936
- name: cargo build
30-
run: cargo build
37+
run: cargo build --all-targets
3138
- name: cargo test
32-
run: cargo test
33-
tests-msrv:
34-
name: "Tests, minimum supported toolchain"
39+
run: cargo test --all-targets
40+
tests-release-stable:
41+
name: Tests (release), stable toolchain
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Check out repository
45+
uses: actions/checkout@v3
46+
- name: Install toolchain
47+
uses: dtolnay/rust-toolchain@v1
48+
with:
49+
toolchain: stable
50+
- name: Cache build artifacts
51+
uses: Swatinem/rust-cache@v2
52+
- name: cargo build (release)
53+
run: cargo build --all-targets --release
54+
- name: cargo test (release)
55+
run: cargo test --all-targets --release
56+
tests-release-msrv:
57+
name: Tests (release), minimum supported toolchain
3558
runs-on: ubuntu-latest
3659
steps:
37-
- name: Checkout repository
60+
- name: Check out repository
3861
uses: actions/checkout@v3
3962
- name: Detect crate MSRV
40-
shell: bash
4163
run: |
4264
msrv=$(cargo metadata --format-version 1 --no-deps | \
43-
jq -r '.packages | .[].rust_version')
65+
jq -r '.packages[0].rust_version')
4466
echo "Crate MSRV: $msrv"
4567
echo "MSRV=$msrv" >> $GITHUB_ENV
4668
- name: Install toolchain
4769
uses: dtolnay/rust-toolchain@v1
4870
with:
4971
toolchain: ${{ env.MSRV }}
50-
- name: cargo build
51-
run: cargo build
52-
- name: cargo test
53-
run: cargo test
54-
lints:
55-
name: "Lints, pinned toolchain"
72+
- name: Cache build artifacts
73+
uses: Swatinem/rust-cache@v2
74+
- name: cargo build (release)
75+
run: cargo build --all-targets --release
76+
- name: cargo test (release)
77+
run: cargo test --all-targets --release
78+
linting:
79+
name: Lints, pinned toolchain
5680
runs-on: ubuntu-latest
5781
steps:
58-
- name: Checkout repository
82+
- name: Check out repository
5983
uses: actions/checkout@v3
6084
- name: Install toolchain
6185
uses: dtolnay/rust-toolchain@v1
6286
with:
63-
toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }}
87+
toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }}
6488
components: rustfmt, clippy
89+
- name: Cache build artifacts
90+
uses: Swatinem/rust-cache@v2
6591
- name: cargo fmt (check)
6692
run: cargo fmt -- --check -l
6793
- name: cargo clippy (warnings)
68-
run: cargo clippy -- -D warnings
69-
- name: cargo build
70-
run: cargo build
94+
run: cargo clippy --all-targets -- -D warnings
7195
tests-other-channels:
72-
name: "Tests, unstable toolchain"
96+
name: Tests, unstable toolchain
7397
runs-on: ubuntu-latest
7498
continue-on-error: true
7599
strategy:
76100
matrix:
77-
channel:
78-
- beta
79-
- nightly
101+
channel: [beta, nightly]
80102
steps:
81-
- name: Checkout repository
103+
- name: Check out repository
82104
uses: actions/checkout@v3
83105
- name: Install toolchain
84106
uses: dtolnay/rust-toolchain@v1
85107
with:
86108
toolchain: ${{ matrix.channel }}
109+
- name: Cache build artifacts
110+
uses: Swatinem/rust-cache@v2
87111
- name: cargo build
88-
run: cargo build
112+
run: cargo build --all-targets
89113
- name: cargo test
90-
run: cargo test
114+
run: cargo test --all-targets

0 commit comments

Comments
 (0)