Skip to content

Commit 2b10208

Browse files
author
Dustin Blackman
committed
chore: Add release script
1 parent ddca279 commit 2b10208

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ dist = ["bin", "cargo-dist"]
66
insta = ["bin", "cargo-insta"]
77
llvm-cov = ["bin", "cargo-llvm-cov"]
88
nextest = ["bin", "cargo-nextest"]
9-
release = ["bin", "cargo-release"]
109
watch = ["bin", "cargo-watch"]

Cargo.toml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ cargo-dist = { version = "0.1.0-prerelease.10" }
3838
cargo-insta = { version = "1.31.0", locked = true }
3939
cargo-llvm-cov = { version = "0.5.25" }
4040
cargo-nextest = { version = "0.9.57", locked = true }
41-
cargo-release = { version = "0.24.11" }
4241
cargo-watch = { version = "8.4.0" }
4342
committed = { version = "1.0.20" }
4443
dprint = { version = "0.40.2" }
@@ -60,27 +59,6 @@ strip = "symbols"
6059
[profile.dist]
6160
inherits = "release"
6261

63-
# Config for 'cargo dist'
64-
[workspace.metadata.dist]
65-
cargo-dist-version = "0.1.0-prerelease.10"
66-
ci = ["github"]
67-
installers = []
68-
targets = [
69-
"x86_64-unknown-linux-gnu",
70-
"x86_64-apple-darwin",
71-
"aarch64-apple-darwin",
72-
]
73-
unix-archive = ".tar.gz"
74-
75-
# Config for 'cargo release'
76-
[package.metadata.release]
77-
pre-release-hook = [
78-
"bash",
79-
"-c",
80-
"cargo cmd lint && cargo cmd test && cargo bin git-cliff -o CHANGELOG.md --tag {{version}} && cargo bin dprint fmt",
81-
]
82-
allow-branch = ["master"]
83-
8462
[package.metadata.commands]
8563
lint = '''set -e
8664
cargo cmd setup-nightly
@@ -104,6 +82,23 @@ setup-nightly = '''
10482
rustup toolchain link runbin-nightly "$(rustup toolchain list -v | grep $NIGHTLY | grep '^nightly-' | awk '{print $2}')"
10583
'''
10684

85+
release = '''set -e
86+
export RB_VERSION=$(cat Cargo.toml | grep version | head -n1 | awk -F '"' '{print $2}')
87+
88+
cargo check
89+
cargo bin git-cliff -o CHANGELOG.md --tag "v$RB_VERSION"
90+
91+
git add .
92+
git commit -m "feat: Release v$RB_VERSION"
93+
git tag -a "v$RB_VERSION" -m "v$RB_VERSION"
94+
95+
git push
96+
git push --tags
97+
98+
gh release create "v$RB_VERSION" --generate-notes
99+
cargo bin git-cliff --latest --strip header | cargo bin dprint fmt --stdin md | cargo gha gh release edit "v$RB_VERSION" --notes-file -
100+
'''
101+
107102
test-coverage = '''set -e
108103
cargo build
109104
cargo llvm-cov nextest --ignore-filename-regex='_test.rs'

0 commit comments

Comments
 (0)