jsr-io / jsr

The open-source package registry for modern JavaScript and TypeScript
https://jsr.io
MIT License
2.16k stars 97 forks source link

How to create a token for publishing a new package? #387

Open timharek opened 2 months ago

timharek commented 2 months ago

I want to try to publish a package from a different CI-system than GH Actions and according to the docs this should be possible?

https://jsr.io/docs/api#authentication-tokens

And according to these docs I should be able to generate a token in my account setting? I don't see anything in my settings for this.

image

Can I generate a token with a different method?

lucacasonato commented 2 months ago

Right now, you can not. I have opened a tracking issue and am updating the docs here: https://github.com/jsr-io/jsr/pull/394.

What CI system would you like to publish from?

timharek commented 2 months ago

Ah, OK – thanks for the quick reply!

I want to publish from Sourcehut's builds. And I guess that would be possible to do with deno publish --token<access-token-from-jsr>?

lucacasonato commented 2 months ago

Yes - that will need #393 first.

kunokareal commented 2 months ago

as a workaround you can use the jsrw_* tokens for now. those are issued for the frontend and stored as a cookie, and they seem to be working fine with --token param. they only live for 7 days, though :c

lucacasonato commented 2 months ago

I am going to close this in favor of #393. I have additionally opened an issue to add documentation on how to publish from alternative CI providers, such as GitLab CI or Sourcehut: #435