Skip to content

Commit 348f8b8

Browse files
authored
Merge pull request #1021 from cipherstash/fix/release-plz-publish-false
fix(release): opt the unreleased crates out of publishing in release-plz.toml
2 parents 308c434 + 739cee3 commit 348f8b8

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎release-plz.toml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
# `cipherstash-client`, which stays there. Every other workspace member is
1010
# `publish = false` in its Cargo.toml and is also listed below with
1111
# `release = false`, so `release-plz update` does not bump its version or
12-
# write its changelog either.
12+
# write its changelog either. Each also repeats `publish = false`: the
13+
# workspace `publish = true` applies to every package that does not override
14+
# it, and release-plz refuses to run when that contradicts the Cargo.toml.
1315
#
1416
# Tags are release-plz's default, `stack-auth-v<semver>` and
1517
# `stack-profile-v<semver>`. No workflow triggers on either.
@@ -33,27 +35,34 @@ version_group = "stack-auth"
3335
[[package]]
3436
name = "stack-kms"
3537
release = false
38+
publish = false
3639

3740
[[package]]
3841
name = "stack-encrypt"
3942
release = false
43+
publish = false
4044

4145
[[package]]
4246
name = "stack-encrypt-derive"
4347
release = false
48+
publish = false
4449

4550
[[package]]
4651
name = "stack-guest-abi"
4752
release = false
53+
publish = false
4854

4955
[[package]]
5056
name = "stack-auth-node"
5157
release = false
58+
publish = false
5259

5360
[[package]]
5461
name = "stack-profile-node"
5562
release = false
63+
publish = false
5664

5765
[[package]]
5866
name = "stack-auth-wasm"
5967
release = false
68+
publish = false

‎scripts/__tests__/release-plz-root-config.test.mjs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ import { readWorkflow } from './lib/workflows.mjs'
1515
* `release = false`. A member added to the workspace without a line here would
1616
* be versioned on the next release-plz run.
1717
*
18+
* Each of those members also carries `publish = false`. The workspace table
19+
* sets `publish = true`, and release-plz applies it to every package that
20+
* does not set its own. `release-plz release` then exits before publishing
21+
* anything: "Package `stack-kms` has `publish = false` or `publish = []` in
22+
* the Cargo.toml, but it has `publish = true` in the release-plz
23+
* configuration."
24+
*
1825
* `cargo-publish-opt-out.test.mjs` pins which members may publish; this pins
1926
* that the release-plz configuration agrees with it.
2027
*/
@@ -46,6 +53,7 @@ function configuredPackages(source) {
4653
packages.set(name, {
4754
versionGroup: /^version_group\s*=\s*"([^"]+)"/m.exec(body)?.[1] ?? null,
4855
release: !/^release\s*=\s*false$/m.test(body),
56+
publish: !/^publish\s*=\s*false$/m.test(body),
4957
})
5058
}
5159
return packages
@@ -90,6 +98,17 @@ describe('root release-plz.toml', () => {
9098
expect([...groups][0]).toBeTruthy()
9199
})
92100

101+
it('opts every unpublished member out of publishing here too', () => {
102+
const unpublished = members.filter((member) => !member.publish)
103+
expect(unpublished.length).toBeGreaterThan(0)
104+
for (const { name } of unpublished) {
105+
expect(packages.get(name)?.publish, name).toBe(false)
106+
}
107+
for (const name of PUBLISHED) {
108+
expect(packages.get(name)?.publish, name).toBe(true)
109+
}
110+
})
111+
93112
it('points the changelog at a file that exists', () => {
94113
const changelog = /^changelog_config\s*=\s*"([^"]+)"/m.exec(source)?.[1]
95114
expect(changelog).toBeTruthy()

0 commit comments

Comments
 (0)