Skip to content

Commit

Permalink
fix: npm releases failing to generate provenance (#3800)
Browse files Browse the repository at this point in the history
We are [seeing](https://github.com/cdk8s-team/cdk8s-plus/actions/runs/8081657712/job/22080844284) the following error in NPM releases: 

```console
npm ERR! Can't generate provenance for new or private package, you must set `access` to public.
```

As of Feb 14, projen [has started](projen/projen#3330) [generating provenance statements](https://docs.npmjs.com/generating-provenance-statements) for NPM releases (on by default for public packages). 
It is not clear why we are seeing the failure above because `access` should be `public` by default for public packages.
My suspicion is that for the very first version of a package, `access` must be explicitly set. Trying this out.
  • Loading branch information
iliapolo authored Feb 28, 2024
1 parent ba2e289 commit 119b5d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ const project = new Cdk8sTeamJsiiProject({
// Used in K8s upgrade tests to control publishing of new branches
project.package.addField('private', false);

// not using `npmAccess` property because projen omits values that are
// identical to npm defaults.
project.package.addField('publishConfig', { access: 'public' });

project.gitignore.exclude('.vscode/');

const importdir = path.join('src', 'imports');
Expand Down
3 changes: 3 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 119b5d4

Please sign in to comment.