@@ -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 : / ^ v e r s i o n _ g r o u p \s * = \s * " ( [ ^ " ] + ) " / m. exec ( body ) ?. [ 1 ] ?? null ,
4855 release : ! / ^ r e l e a s e \s * = \s * f a l s e $ / m. test ( body ) ,
56+ publish : ! / ^ p u b l i s h \s * = \s * f a l s e $ / 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 = / ^ c h a n g e l o g _ c o n f i g \s * = \s * " ( [ ^ " ] + ) " / m. exec ( source ) ?. [ 1 ]
95114 expect ( changelog ) . toBeTruthy ( )
0 commit comments