Skip to content
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

automatically publish extension to open vsx registry on release #161

Merged
merged 5 commits into from
Oct 24, 2023
Merged

automatically publish extension to open vsx registry on release #161

merged 5 commits into from
Oct 24, 2023

Conversation

Yakiyo
Copy link
Contributor

@Yakiyo Yakiyo commented Oct 9, 2023

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
Copy link
Collaborator

fdncred commented Oct 9, 2023

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
Copy link
Collaborator

fdncred commented Oct 9, 2023

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

@Yakiyo
Copy link
Contributor Author

Yakiyo commented Oct 9, 2023

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

  • generate an access token from here
  • create a namespace for the extension before hand (docs). It can be done by running
npx ovsx create-namespace vscode-nushell-lang -p <token>

i think that will more or less do it.
Might need to create an eclipse account for signing in to the registry. Can be either ur personal account or maybe one owned by the nushell team or something. The wiki describes all of them pretty neatly

@fdncred
Copy link
Collaborator

fdncred commented Oct 9, 2023

ok, i did all that.

@fdncred
Copy link
Collaborator

fdncred commented Oct 9, 2023

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

@Yakiyo
Copy link
Contributor Author

Yakiyo commented Oct 11, 2023

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
Copy link
Collaborator

fdncred commented Oct 11, 2023

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
Copy link
Contributor Author

Yakiyo commented Oct 22, 2023

@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
Copy link
Collaborator

fdncred commented Oct 23, 2023

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

@fdncred
Copy link
Collaborator

fdncred commented Oct 23, 2023

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
Copy link
Contributor Author

Yakiyo commented Oct 24, 2023

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
Copy link
Collaborator

fdncred commented Oct 24, 2023

, if thats fine with u.

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

@Yakiyo
Copy link
Contributor Author

Yakiyo commented Oct 24, 2023

@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
Copy link
Collaborator

fdncred commented Oct 24, 2023

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 fdncred merged commit 779c104 into nushell:main Oct 24, 2023
@fdncred
Copy link
Collaborator

fdncred commented Oct 24, 2023

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

@Yakiyo
Copy link
Contributor Author

Yakiyo commented Oct 24, 2023

@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 EclipseFdn/open-vsx.org#2160 so will have to wait till thats done.

@fdncred
Copy link
Collaborator

fdncred commented Oct 24, 2023

cool. looks like both are removed now. thanks!

@fdncred
Copy link
Collaborator

fdncred commented Jan 11, 2024

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

@fdncred
Copy link
Collaborator

fdncred commented Jan 11, 2024

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 added a commit that referenced this pull request Jan 11, 2024
@fdncred
Copy link
Collaborator

fdncred commented Jan 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish on OpenVSX as well
2 participants