-
Notifications
You must be signed in to change notification settings - Fork 2
Feat: Npm provenance setup #9
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
Conversation
|
@Totto16 Thank you very much for this – it looks great to me! I just have one change request: could you execute the TypeScript script directly with Node.js >= 22 using the following command? node --experimental-specifier-resolution=node --experimental-strip-types --experimental-transform-types --no-warnings .github/release-script/src/index.tsThat way, we can skip the build step entirely. PS: I'm also open to completely dropping |
Yeah of course I can use node directly 👍🏼 |
|
Hey guys, despite my lack of participation in the recent activities, I closely followed all the conversations and PRs. Thanks for all the effort you put into this!
Fun fact: Last Friday I converted a TypeScript based npm package to a split-package (with a core package + multiple plugins). I tried npm workspaces for the first time because I also wanted to avoid additional tooling such as lerna, yarn, etc. Just wanted to say: It's working flawlessly - so unless yarn offers something additional to that, npm might suffices for these kind of projects. |
|
@Totto16 I’ve now set up the I didn’t add a global So this should be ready to go, feel free to let me know once you’re done on your side. |
Then everything should be ready, I already have tested this, and the node change is already done. So on my side everything is ready 😄 |
|
@Totto16 Great, then I'll merge it and test it as soon as I'm done with gjsify/ts-for-gir#281 :) |
|
@JumpLink I just saw, that you published https://github.com/gjsify/ts-for-gir/releases/tag/4.0.0-beta.35 And the script doesn't really seem to work 😓 d73e113 - 41c3a74 I don't have time yet to look into it yet, but do you need help or is it a problem with something other than provenance e.g. npm rate-limiting us? |
|
@Totto16 Yes, that was also my assumption, which is why I included waiting times, etc. I'll try it out a little more. |
According to https://docs.github.com/de/actions/tutorials/publish-packages/publish-nodejs-packages You also need the scope setup correctly, when uisng the action so add this scope: '@girs'IIRC i also had this for the gnome-shell types, and without it, it wouldn't work correctly, as the action assumes 🤔 |
|
@Totto16 I completely forgot that the yarn syntax |
So maybe you need to replace |
|
@Totto16 ts-for-gir offers the option of creating packages without the |
e38963c still fails 🤔 maybe really add the scope to the release.yml file 🤔 |
|
@Totto16 Thank you, unfortunately that doesn't seem to help either :( |
I saw it in https://github.com/gjsify/types/actions/runs/17106463430/job/48516564860 What is the problem, the error logs are not really helpfull IMO 🤔 |
|
@Totto16 I'm giving up for today. I've given you access to the repo. If you feel like it and have time, you might be able to find the problem 🤯 |
|
@Totto16 Oh my God, I think I have that problem, wait a minute... |
|
@Totto16 It was the wrong token 😭 |
🤦🏼♂️ 😭 At least it works now 👍🏼 |
|
@JumpLink https://github.com/gjsify/types/actions/runs/17108728370/job/48524379504 Edit: We also get this warning in all (presumably) packages: Ah it also says: |
|
@Totto16 Thank you
Thanks, I re-ran the action and then the remaining packages were published. Thanks for pointing out the URLs, I'll fix that. |
Similar to gjsify/gnome-shell#64
@JumpLink already knows what to setup and how provenance works.
So a few details on how this PR solves this.
You don't make releases here on GH, as you publish many packages in one commit and making a release for everyone here is not needed, as the releases (versions) are made on npm.
So this executes a GH action on every push to main, it executes this in the environment (npm-release)
It than builds and executes the script in
.github/release-script.That script does these things:
package,.jsonfiles (except the one for that script)package.jsonis already publishednpm publish ... --provenanceto publish the package with that version to npm with provenanceIt needs access to the NPM_TOKEN, like in gjsify/gnome-shell#64
As provenance is now standardized and npm + GH make it available, it would make sense, to publish all packages with provenance.
I tested this script with my own private repo (without provenance) and it works, as we use raw npm here and not yarn as in gjsify/gnome-shell#64 there is no need for an additional fix like in gjsify/gnome-shell#71
Feel free to ask any questions regarding the script 😄
(It would also make sense, to test it on the next release of these types with only one package at a time, but we would need to hardcode something for that)