Skip to content

Commit d6790f9

Browse files
authored
Unify with repository procedures (#12)
1 parent f5ccc10 commit d6790f9

File tree

12 files changed

+280
-50
lines changed

12 files changed

+280
-50
lines changed

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Thank you for making a pull request! Below are the recommended steps to validate that your PR will pass CI -->
2+
3+
## Checklist
4+
5+
- [ ] `cargo clippy` reports no issues
6+
- [ ] `cargo doc` reports no issues
7+
- [ ] [`cargo deny`](https://github.com/EmbarkStudios/cargo-deny/) issues have been fixed or added to `deny.toml`
8+
- [ ] Human-readable change descriptions added to CHANGELOG.md under the "Unreleased" heading.
9+
- [ ] If the change does not affect the user (or is a process change), preface the change with "Internal:"
10+
- [ ] Add credit to yourself for each change: `Added new functionality. @githubname`
11+
12+
## Description
13+
14+
## Related Issues

.github/workflows/ci.yml

Lines changed: 108 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ on:
1111
pull_request:
1212

1313
env:
14+
RUSTFLAGS: -Dwarnings
1415
RUSTDOCFLAGS: -Dwarnings
1516
CI_RUST_VERSION: "1.94.0"
17+
CI_RUST_MSRV: "1.64.0"
1618

1719
jobs:
1820
check-msrv:
@@ -25,14 +27,14 @@ jobs:
2527
os: windows-2025
2628

2729
# MacOS
28-
- name: MacOS x86_64
30+
- name: MacOS aarch64
2931
os: macos-15
3032

3133
# Linux
3234
- name: Linux x86_64
3335
os: ubuntu-24.04
3436

35-
name: MSRV ${{ matrix.name }}
37+
name: CI ${{ matrix.name }}
3638
runs-on: ${{ matrix.os }}
3739

3840
steps:
@@ -42,31 +44,121 @@ jobs:
4244
submodules: true
4345

4446
- name: install rust
45-
shell: bash
46-
run: |
47-
set -e
48-
49-
rustup toolchain install ${{ env.CI_RUST_VERSION }} --no-self-update --profile=minimal --component clippy,rustfmt
50-
rustup override set ${{ env.CI_RUST_VERSION }}
51-
cargo -V
47+
uses: cwfitzgerald/repo-common/.github/actions/install-rust@trunk
48+
with:
49+
version: ${{ env.CI_RUST_VERSION }}
50+
components: clippy
5251

5352
- name: caching
5453
uses: Swatinem/rust-cache@v2
5554
with:
56-
key: ${{ matrix.os }}
55+
key: ci-${{ matrix.os }}
56+
57+
- name: install cargo-nextest
58+
uses: taiki-e/install-action@cargo-nextest
59+
60+
- name: clippy
61+
shell: bash
62+
run: cargo clippy --all-features
63+
64+
- name: build
65+
shell: bash
66+
run: cargo build
67+
68+
- name: doc
69+
shell: bash
70+
run: cargo doc --no-deps
71+
72+
- name: test
73+
shell: bash
74+
run: cargo nextest run
75+
76+
- name: doctest
77+
shell: bash
78+
run: cargo test --doc
79+
80+
format:
81+
name: Format
82+
runs-on: ubuntu-24.04
83+
84+
steps:
85+
- name: checkout repo
86+
uses: actions/checkout@v6
87+
88+
- name: install rust
89+
uses: cwfitzgerald/repo-common/.github/actions/install-rust@trunk
90+
with:
91+
version: ${{ env.CI_RUST_VERSION }}
92+
components: rustfmt
5793

5894
- name: fmt
5995
shell: bash
6096
run: cargo fmt --check
6197

62-
- name: clippy
98+
deny:
99+
name: Deny
100+
runs-on: ubuntu-24.04
101+
102+
steps:
103+
- name: checkout repo
104+
uses: actions/checkout@v6
105+
106+
- name: install rust
107+
uses: cwfitzgerald/repo-common/.github/actions/install-rust@trunk
108+
with:
109+
version: ${{ env.CI_RUST_VERSION }}
110+
111+
- name: install cargo-deny
112+
uses: taiki-e/install-action@cargo-deny
113+
114+
- name: deny
63115
shell: bash
64-
run: cargo clippy -- -D warnings
116+
run: cargo deny --all-features check
65117

66-
- name: test
118+
msrv:
119+
strategy:
120+
fail-fast: false
121+
matrix:
122+
include:
123+
# Windows
124+
- name: Windows x86_64
125+
os: windows-2025
126+
127+
# MacOS
128+
- name: MacOS aarch64
129+
os: macos-15
130+
131+
# Linux
132+
- name: Linux x86_64
133+
os: ubuntu-24.04
134+
135+
name: MSRV ${{ matrix.name }}
136+
runs-on: ${{ matrix.os }}
137+
138+
env:
139+
RUSTFLAGS: ""
140+
RUSTDOCFLAGS: ""
141+
142+
steps:
143+
- name: checkout repo
144+
uses: actions/checkout@v6
145+
with:
146+
submodules: true
147+
148+
- name: install rust
149+
uses: cwfitzgerald/repo-common/.github/actions/install-rust@trunk
150+
with:
151+
version: ${{ env.CI_RUST_MSRV }}
152+
153+
- name: caching
154+
uses: Swatinem/rust-cache@v2
155+
with:
156+
key: msrv-${{ matrix.os }}
157+
158+
- name: check default features
67159
shell: bash
68-
run: cargo test
160+
run: cargo check
69161

70-
- name: doc
162+
- name: check no default features
71163
shell: bash
72-
run: cargo doc
164+
run: cargo check --no-default-features

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Per Keep a Changelog there are 6 main categories of changes:
1414
- Fixed
1515
- Security
1616

17-
## Versions
17+
#### Table of Contents
1818

1919
- [Unreleased](#unreleased)
20+
- [v0.1.2](#v012)
21+
- [v0.1.1](#v011)
2022
- [v0.1.0](#v010)
21-
- [Diffs](#diffs)
2223

2324
## Unreleased
2425

@@ -48,4 +49,6 @@ Released 2023-06-03
4849

4950
## Diffs
5051

51-
- [Unreleased](https://github.com/gfx-rs/nv-flip-rs/compare/v0.1.0...HEAD)
52+
- [Unreleased](https://github.com/gfx-rs/nv-flip-rs/compare/v0.1.2...HEAD)
53+
- [v0.1.2](https://github.com/gfx-rs/nv-flip-rs/compare/v0.1.1...v0.1.2)
54+
- [v0.1.1](https://github.com/gfx-rs/nv-flip-rs/compare/v0.1.0...v0.1.1)

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ resolver = "2"
33
members = [
44
"nv-flip",
55
"nv-flip-sys"
6-
]
6+
]
7+
8+
[workspace.package]
9+
edition = "2021"
10+
rust-version = "1.64"
11+
repository = "https://github.com/gfx-rs/nv-flip-rs"
12+
readme = "README.md"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ The result of this example looks like this:
7373
|:---------:|:---------:|:---------:|
7474
| ![comp](https://raw.githubusercontent.com/gfx-rs/nv-flip-rs/trunk/etc/tree-ref.png) | ![comp](https://raw.githubusercontent.com/gfx-rs/nv-flip-rs/trunk/etc/tree-test.png) | ![comp](https://raw.githubusercontent.com/gfx-rs/nv-flip-rs/trunk/etc/tree-comparison-cli.png) |
7575

76+
## Minimum Supported Rust Version
77+
78+
The minimum supported Rust version (MSRV) for this crate is **1.64**. MSRV bumps are considered breaking changes and will be accompanied by a minor version bump.
79+
7680
## License
7781

7882
The binding and rust interop code is tri-licensed under MIT, Apache-2.0, and ZLib.

RELEASE.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Release Process
2+
3+
This document describes how to publish a new release of `nv-flip`.
4+
5+
## Prerequisites
6+
7+
- Push access to the default branch
8+
- A crates.io API token with publish rights for all workspace crates
9+
- `gh` CLI installed and authenticated (for creating the GitHub release)
10+
11+
## Steps
12+
13+
### 1. Determine the new version
14+
15+
Pick the new version number following cargo semver conventions. For this document,
16+
we'll use `X.Y.Z` as a placeholder.
17+
18+
### 2. Update CHANGELOG.md
19+
20+
**a) Add the new version to the Table of Contents:**
21+
22+
Find the line:
23+
```
24+
- [Unreleased](#unreleased)
25+
```
26+
Add a new entry directly below it:
27+
```
28+
- [vX.Y.Z](#vXYZ)
29+
```
30+
(The anchor is the version with dots removed, e.g. `v0.2.0` -> `#v020`)
31+
32+
**b) Add a version heading under Unreleased:**
33+
34+
Find:
35+
```
36+
## Unreleased
37+
```
38+
Add a blank line and a new version section below it, moving all existing unreleased
39+
items under the new heading:
40+
```
41+
## Unreleased
42+
43+
## vX.Y.Z
44+
45+
Released YYYY-MM-DD
46+
47+
- (move all previously unreleased items here)
48+
```
49+
50+
**c) Update the Diffs section at the bottom:**
51+
52+
Find the existing unreleased diff link:
53+
```
54+
- [Unreleased](https://github.com/gfx-rs/nv-flip-rs/compare/vPREVIOUS...HEAD)
55+
```
56+
Update it and add a new entry:
57+
```
58+
- [Unreleased](https://github.com/gfx-rs/nv-flip-rs/compare/vX.Y.Z...HEAD)
59+
- [vX.Y.Z](https://github.com/gfx-rs/nv-flip-rs/compare/vPREVIOUS...vX.Y.Z)
60+
```
61+
62+
### 3. Update Cargo.toml
63+
64+
Set the `version` field to the new version:
65+
```toml
66+
version = "X.Y.Z"
67+
```
68+
69+
If this is a workspace, update `workspace.package.version` and any intra-workspace
70+
dependency versions as needed.
71+
72+
### 4. Update README.md
73+
74+
Update any version references (dependency snippets, compatibility tables, etc.)
75+
to reflect the new version.
76+
77+
### 5. Commit and tag
78+
79+
```bash
80+
jj commit -m "Release vX.Y.Z"
81+
jj tag create vX.Y.Z
82+
jj git push
83+
```
84+
85+
### 6. Publish to crates.io
86+
87+
```bash
88+
cargo publish -p nv-flip-sys
89+
cargo publish -p nv-flip
90+
```
91+
92+
### 7. Create the GitHub release
93+
94+
Extract the release notes from `CHANGELOG.md` and create a release:
95+
96+
```bash
97+
gh release create vX.Y.Z --title "vX.Y.Z" --notes "<paste release notes here>"
98+
```
99+
100+
### 8. Post-release
101+
102+
Verify:
103+
- [ ] The crate is visible at https://crates.io/crates/nv-flip/X.Y.Z
104+
- [ ] Docs are building at https://docs.rs/nv-flip/X.Y.Z
105+
- [ ] The GitHub release exists at https://github.com/gfx-rs/nv-flip-rs/releases/tag/vX.Y.Z

deny.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[licenses]
2+
allow = [
3+
"Apache-2.0",
4+
"BSD-3-Clause",
5+
"MIT",
6+
"Zlib",
7+
]
8+
9+
[bans]
10+
multiple-versions = "deny"
11+
skip = []
12+
13+
[sources]
14+
unknown-registry = "deny"
15+
unknown-git = "allow"
16+
17+
[advisories]
18+
ignore = []

0 commit comments

Comments
 (0)