nushell / vscode-nushell-lang

A Nushell grammar for Visual Studio Code with IDE support
https://www.nushell.sh/
MIT License
122 stars 27 forks source link

automatically publish extension to open vsx registry on release #161

Closed Yakiyo closed 1 year ago

Yakiyo commented 1 year ago

Currently the release workflow just bundles the extension and uploads it to the newest Github Release, and then i assume the maintainers manually publish it to vscode marketplace. This pr attempts to publish the extension to the open vsx registry by using the HaaLeo/publish-vscode-extension action. By adding it to open vsx, stuff like gitpod and vscodium and other tools which uses open vsx can also allow users to use the nushell extension. In #43 @fdncred mentioned that he couldn't get the action setup to automatically publish to the vscode marketplace. The action used for uploading to vsx can also do the same for vscode marketplace. I can push another commit if that is needed.

This will require a new secret named OPEN_VSX_TOKEN to be defined containing the access token for open vsx more here and a namespace created beforehand more here

This pr should resolve #43

fdncred commented 1 year ago

sure, I'd love to publish to vscode marketplace automatically. I'm just not sure what I need to do to support this. Any help would be amazing.

fdncred commented 1 year ago

We could do a point release to test all this out too. There's some changes I'd like to push out.

Yakiyo commented 1 year ago

sure, I'd love to publish to vscode marketplace automatically. I'm just not sure what I need to do to support this. Any help would be amazing.

it should be more or less simple

fdncred commented 1 year ago

ok, i did all that.

fdncred commented 1 year ago

Not sure which secret to put the token in though. Any ideas? image

Yakiyo commented 1 year ago

Not sure which secret to put the token in though. Any ideas?

should be repository secrets. can use organizational secrets ig if ull be using that token throughout other repos in the org. upto you.

fdncred commented 1 year ago

ok, I added OPEN_VSX_TOKEN as a repository secret with the token I generated. I'd also want to get this going for vscode marketplace.

Yakiyo commented 1 year ago

@fdncred created a commit so that itll publish to vscode marketplace alongside open vsx. This'll need VS_MARKETPLACE_TOKEN defined as a secret similar to the vsx token.

fdncred commented 1 year ago

ok, i'll dig around to see if I can figure out how to generate a token for vsmarketplace. Thanks!

fdncred commented 1 year ago

ok, i added this latest secret. i already had a token. Do you know if there's anyway to do a dry-run to see if this will work without actually shipping anything?

Yakiyo commented 1 year ago

ok, i added this latest secret. i already had a token. Do you know if there's anyway to do a dry-run to see if this will work without actually shipping anything?

doesnt seem like it. if u dont mind, i could do a dry-run on a different repo with the same workflow file. ill try publishing them under my username, if thats fine with u.

fdncred commented 1 year ago

, if thats fine with u.

I'm fine with it as long as it doesn't mess things up on our marketplaces.

Yakiyo commented 1 year ago

@fdncred i finished it. I created a clone of my fork at https://github.com/Yakiyo/vs-nu and had the workflow run. It successfully managed to publish both to vscode marketplace and open vsx.

https://open-vsx.org/extension/Yakiyo/vs-nu https://marketplace.visualstudio.com/items?itemName=Yakiyo.vs-nu there was a smoll issue with the filepaths, so had to fix that. it should work completely fine now, provided that repository secrets are set and a namespace in open vsx has been created.

fdncred commented 1 year ago

Ok, I think I have it setup right but who really knows? Let's pretend it is. We can always revert this if we need to. Thanks!

fdncred commented 1 year ago

@Yakiyo are you able to delete those two items you published so that people aren't confused?

Yakiyo commented 1 year ago

@Yakiyo are you able to delete those two items you published so that people aren't confused?

i removed the one from vscode marketplace, but open vsx doesnt have feature to remove an extension, had to open an issue at https://github.com/EclipseFdn/open-vsx.org/issues/2160 so will have to wait till thats done.

fdncred commented 1 year ago

cool. looks like both are removed now. thanks!

fdncred commented 10 months ago

Apparently something isn't working with the OpenVSX https://github.com/nushell/vscode-nushell-lang/actions/runs/7490370794/job/20389054777

fdncred commented 10 months ago

Maybe OpenVSX worked since I ran npx ovsc create-namespace with TheNuProjectContributors, but now VS Marketplace is broken. Not sure what to do there https://github.com/nushell/vscode-nushell-lang/actions/runs/7490370794/job/20389250639

fdncred commented 10 months ago

What an incredible royal mess this PR caused.

  1. couldn't publish to openvsx because of the wrong namespace (fixed that)
  2. published to openvsx but then vsmarketplace failed
  3. commented out tried again but couldn't republish to openvsx or unpublish so had to comment that out
  4. vsmarketplace still didn't work so commented that out
  5. assets were linked to openvsx so then just a normal release wouldn't work.
  6. ended up reverting everything, such a pain.