Skip to content

Add provenance attestation when publishing to NPM #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 8, 2024
Merged

Conversation

jtbandes
Copy link
Member

@jtbandes jtbandes commented Apr 6, 2024

Changelog

None

Description

This adds a provenance attestation to the published package so consumers can verify that the package was built on GitHub Actions:

The package will appear like this on npm:

Also fixes an error when publishing due to trying to publish the same package twice (with different node versions).

- run: yarn workspace @foxglove/${{ matrix.package }} pack
- name: Publish to NPM (dry run)
if: ${{ matrix.node-version == '18.x' }}
# `yarn publish` does not support --provenance
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you linked to the yarn berry issue in the mcap repo, would be good to have it here too:
yarnpkg/berry#5430

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repo isn’t using berry for better or worse

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can drop this yarn comment altogether. It isn't crazy that to publish to a repository you use the tool made by that repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep the comment since I think the yarn pack && npm publish package.tgz is a bit unusual otherwise and I would wonder why it's being done this way.

@jtbandes jtbandes merged commit 736c8df into main Apr 8, 2024
@jtbandes jtbandes deleted the jacob/provenance branch April 8, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants