Skip to content

Commit 8652760

Browse files
authored
Merge pull request #235 from Sh3Rm4n/cargo-release
Add configuration for cargo-release
2 parents 6d3daf6 + 42e10cf commit 8652760

File tree

3 files changed

+131
-18
lines changed

3 files changed

+131
-18
lines changed

CHANGELOG.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [Unreleased]
8+
## Unreleased
99

1010
### Added
1111

@@ -388,21 +388,21 @@ let clocks = rcc
388388
[#4]: https://github.com/stm32-rs/stm32f3xx-hal/pull/4
389389
[#2]: https://github.com/stm32-rs/stm32f3xx-hal/pull/2
390390

391-
[Unreleased]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.6.1...HEAD
392-
[v0.6.1]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.6.0...v0.6.1
393-
[v0.6.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.5.0...v0.6.0
394-
[v0.5.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.3...v0.5.0
395-
[v0.4.3]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.2...v0.4.3
396-
[v0.4.2]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.1...v0.4.2
397-
[v0.4.1]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.4.0...v0.4.1
398-
[v0.4.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.3.0...v0.4.0
399-
[v0.3.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.2.3...v0.3.0
400-
[v0.2.3]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.2.2...v0.2.3
401-
[v0.2.2]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.2.1...v0.2.2
402-
[v0.2.1]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.2.0...v0.2.1
403-
[v0.2.0]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.1.5...v0.2.0
404-
[v0.1.5]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.1.4...v0.1.5
405-
[v0.1.4]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.1.3...v0.1.4
406-
[v0.1.3]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.1.2...v0.1.3
407-
[v0.1.2]: https://github.com/stm32-rs/stm32f3xx-hal/compare/v0.1.1...v0.1.2
391+
<!-- cargo-release: latest tag -->
392+
[v0.6.1]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.6.1
393+
[v0.6.0]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.6.0
394+
[v0.5.0]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.5.0
395+
[v0.4.3]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.4.3
396+
[v0.4.2]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.4.2
397+
[v0.4.1]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.4.1
398+
[v0.4.0]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.4.0
399+
[v0.3.0]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.3.0
400+
[v0.2.3]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.2.3
401+
[v0.2.2]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.2.2
402+
[v0.2.1]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.2.1
403+
[v0.2.0]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.2.0
404+
[v0.1.5]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.1.5
405+
[v0.1.4]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.1.4
406+
[v0.1.3]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.1.3
407+
[v0.1.2]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.1.2
408408
[v0.1.1]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v0.1.1

RELEASE_PROCESS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# What to do to publish a new release
2+
3+
1. Ensure all notable changes are in the changelog under "Unreleased".
4+
5+
2. Execute `cargo release <level>` to bump version(s), tag and publish
6+
everything. External subcommand, must be installed with `cargo install
7+
cargo-release`.
8+
9+
`<level>` can be one of `major|minor|patch`. If this is the first release
10+
(`0.1.0`), use `minor`, since the version starts out as `0.0.0`.
11+
12+
3. Go to the GitHub releases, edit the just-pushed tag. Copy the release notes
13+
from the changelog.

release.toml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# cargo-release configuration
2+
3+
tag-message = "{{version}}"
4+
no-dev-version = true
5+
pre-release-commit-message = "Release {{version}}"
6+
7+
# Change the changelog's `Unreleased` section to refer to this release and
8+
# prepend a new `Unreleased` section
9+
[[pre-release-replacements]]
10+
file = "CHANGELOG.md"
11+
search = "## Unreleased\n"
12+
replace = """
13+
## Unreleased
14+
15+
No changes.
16+
17+
## [v{{version}}] {{date}}
18+
"""
19+
20+
# Change the tag links in the bottom of the file
21+
#
22+
# The <!-- cargo-release: latest tag --> marker is needed to
23+
# reliably match on the latest tag
24+
[[pre-release-replacements]]
25+
exactly = 1
26+
file = "CHANGELOG.md"
27+
search = """
28+
<!-- cargo-release: latest tag -->
29+
\\[[a-z0-9\\.-]+\\]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/[a-z0-9\\.-]+
30+
"""
31+
replace = """
32+
<!-- cargo-release: latest tag -->
33+
[v{{version}}]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v{{version}}
34+
[v{{prev_version}}]: https://github.com/stm32-rs/stm32f3xx-hal/releases/tag/v{{prev_version}}
35+
"""
36+
37+
# Bump the version inside the example manifest in `README.md`
38+
[[pre-release-replacements]]
39+
file = "README.md"
40+
search = 'stm32f3xx-hal = \{ version = "[a-z0-9\\.-]+",'
41+
replace = 'stm32f3xx-hal = { version = "{{version}}",'
42+
43+
# Point to the latest release in documentation
44+
#
45+
# All files have to be listed here, until
46+
# https://github.com/sunng87/cargo-release/issues/104
47+
# is implemented.
48+
[[pre-release-replacements]]
49+
min = 0
50+
file = "src/i2c.rs"
51+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
52+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
53+
54+
[[pre-release-replacements]]
55+
min = 0
56+
file = "src/serial.rs"
57+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
58+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
59+
60+
[[pre-release-replacements]]
61+
min = 0
62+
file = "src/watchdog.rs"
63+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
64+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
65+
66+
[[pre-release-replacements]]
67+
min = 0
68+
file = "src/gpio.rs"
69+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
70+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
71+
72+
[[pre-release-replacements]]
73+
min = 0
74+
file = "src/dma.rs"
75+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
76+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
77+
78+
[[pre-release-replacements]]
79+
min = 0
80+
file = "src/can.rs"
81+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
82+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
83+
84+
[[pre-release-replacements]]
85+
min = 0
86+
file = "src/adc.rs"
87+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
88+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
89+
90+
[[pre-release-replacements]]
91+
min = 0
92+
file = "src/usb.rs"
93+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
94+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"
95+
96+
[[pre-release-replacements]]
97+
min = 0
98+
file = "src/lib.rs"
99+
search = "https://github.com/stm32-rs/stm32f3xx-hal/blob/[a-z0-9\\.-]+/"
100+
replace = "https://github.com/stm32-rs/stm32f3xx-hal/blob/v{{version}}/"

0 commit comments

Comments
 (0)