Declare the Bento release config in-repo
kind = "library" plus a publish.rhai, so releasing this crate goes
through Bento's preflight rather than a hand-run cargo publish. The
preflight is what would have caught pter 0.1.0's dead repository URL.
2 files changed,
+37 insertions,
-0 deletions
|
1 |
+ |
# How Bento releases pter. Lives here rather than in the daemon's config so it is
|
|
2 |
+ |
# versioned with the code it describes.
|
|
3 |
+ |
|
|
4 |
+ |
# A crate, not an app: one publish.rhai rather than a recipe per platform, and
|
|
5 |
+ |
# the target below names the host that uploads rather than a build matrix.
|
|
6 |
+ |
kind = "library"
|
|
7 |
+ |
|
|
8 |
+ |
targets = ["linux/x86_64"]
|
|
1 |
+ |
// Publish this crate to crates.io.
|
|
2 |
+ |
//
|
|
3 |
+ |
// A library has no per-platform artifact, so this is the whole release: one
|
|
4 |
+ |
// recipe, run on whichever host the manifest names.
|
|
5 |
+ |
//
|
|
6 |
+ |
// The preflight step is the point of routing this through Bento. crates.io
|
|
7 |
+ |
// versions can be yanked but never edited, so a wrong repository URL, a
|
|
8 |
+ |
// missing license, or a duplicate version is permanent the moment it uploads.
|
|
9 |
+ |
// pter 0.1.0 went out with a dead repository link and could only be corrected
|
|
10 |
+ |
// by releasing again.
|
|
11 |
+ |
|
|
12 |
+ |
let h = build_host();
|
|
13 |
+ |
let r = repo();
|
|
14 |
+ |
let v = version();
|
|
15 |
+ |
|
|
16 |
+ |
step("checkout");
|
|
17 |
+ |
sh_ok(h, "cd " + r + " && git pull --ff-only");
|
|
18 |
+ |
|
|
19 |
+ |
step("build");
|
|
20 |
+ |
sh_ok(h, "cd " + r + " && cargo test " + feature_flags());
|
|
21 |
+ |
|
|
22 |
+ |
step("verify");
|
|
23 |
+ |
// Aborts the run with the specific problems if anything is wrong.
|
|
24 |
+ |
log(crate_preflight());
|
|
25 |
+ |
sh_ok(h, "cd " + r + " && cargo publish --dry-run " + feature_flags());
|
|
26 |
+ |
|
|
27 |
+ |
step("publish");
|
|
28 |
+ |
sh_ok(h, "cd " + r + " && cargo publish " + feature_flags());
|
|
29 |
+ |
log("published " + v + " to crates.io");
|