HaaLeo / publish-vscode-extension

GitHub action to publish your VS Code Extension to the Open VSX Registry or Visual Studio Marketplace.
MIT License
209 stars 13 forks source link

Add pre-release support #16

Closed gnikit closed 2 years ago

gnikit commented 2 years ago

Description VS Code in release 1.63.0 added support for pre-releases and in the future they will be adding semver style tags. https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_63.md#publishing-pre-release-extensions

It would be a good idea IMO to allow for additional arguments to be passed into vsce, e.g. --pre-release. Of course care needs to be taken with how/when a pre-release build will be triggered. For example, the not so elegant solution that I thought of, is to have a separate .yml with --pre-release set as an argument that runs at every push on master and another .yml that triggers only on a GitHub release.

The important thing is to not allow for a normal release and a pre-release to publish under the exact same version number. There are some tricks that one can employ to ensure that but I would consider this responsibility lying with the developer of the VS Code extension and not this GitHub Action.

HaaLeo commented 2 years ago

Hi @gnikit I agree that the action should support pre-releases. IMHO it should be sufficient to expose the corresponding flag of vsce. Then it is up to the action users how they are using this flag.

gnikit commented 2 years ago

Yes, that sounds great!

HaaLeo commented 2 years ago

Another remark ist, that it seems that vsce only considers this option during the packaging step.

gnikit commented 2 years ago

it seems that vsce only considers this option during the packaging step.

Oh did I mess up and include it only in publish? Tbh I had a look at the vsce API and with my limited knowledge of typescript it was not clear to me how does one set the --pre-release flag from their API. As in there is a preRelease option for publish but it is not present in the API.

HaaLeo commented 2 years ago

No worries, I will browser their code and double check before releasing it.

HaaLeo commented 2 years ago

Released with v1.0.0

cvergne commented 2 years ago

Hi, sorry to "re-open" the issue. Since the 1.0 release, the release v2.6.3 en VSCE has fixed the missing preRelease in API, so maybe we can revert the files to handle the param on publish ? :) Thanks (and thanks for this Github Action, really really useful !)

HaaLeo commented 2 years ago

Hi @cvergne the release you are referring to adds this option only to the api definitions this release does not change any functional behaviour of vsce.

If you package and publish your extension (dryRun: false) with this GitHub action the preRelease option is considered as one expects. However if you first package your extension with dryRun: true, preRelease: false and then in a second step publish the packaged extension with (extensionFile: 'path/To/extension.vsix', preRelease: true) the extension will not be published as pre-release. This is what I mean with

it seems that vsce only considers this option during the packaging step.

I hope this clarifies the behaviour of the preRelease flag.

fendor commented 2 years ago

Hello! It looks like VSX marketplace has added this feature: https://github.com/eclipse/openvsx/pull/410 We should be able to have pre-releases for VSX now, too :)

HaaLeo commented 2 years ago

Hi @fendor thx for bringing this up. The action's pre-release support should already support pre-releases for both marketplaces.

kingdonb commented 2 years ago

I've been using this workflow to publish to the VS Code marketplace, regular releases and pre-releases, pretty much followed the guide: https://www.stateful.com/blog/the-github-action-you-need-to-publish-vscode-extensions

and I have just enabled publishing to the Open-VSX after I figured out what was missing (the Publisher agreement)

I noticed that the pre-release setting is not honored, so all of my pre-release builds are always promoted over the stable releases, and there is no way to choose between them except by selecting a specific version.

Then I went searching through the market in VS Codium for any prerelease builds at all, on any extension, and I noticed that also I did not find any other extension with a pre-release. Has this ever worked, or did the VSX market change something?

I understand the bit about not supporting semver properly that is more than a little strange decision on the MS extension store.

Edit: Screen Shot 2022-08-08 at 9 35 43 AM

for reference, the relevant step that publishes these to OpenVSX as pre-release, with the flag enabled:

Screen Shot 2022-08-08 at 9 44 25 AM

I'd love to hear that both markets are moving in the direction of supporting semver including the prerelease format of semver, as this method of marking builds with a timestamp so their semver number is always higher than non-prerelease builds in the same minor series is... definitely a kludge! But I have not been in any of the planning meetings so I have no idea what's up with this capability. Do you know if it is really supported?

gnikit commented 2 years ago

@kingdonb at the time I implemented this vsce had just added Pre-Release support on the VS Code Insiders build and ovsx had no support for Pre-release. Since the original contribution,, ovsx has added the --pre-release flag when publishing.

It's been on my TODO-list to open another PR to implement this, but I've haven't gotten around to it yet.

kingdonb commented 2 years ago

It looks like it wouldn't have made any difference yet, as vscodium does not appear to treat pre-releases different than regular releases. I tried various manual methods of publishing a (pre-)release and they all went to the main channel.

Confirmed (I think) on this issue thread: https://github.com/eclipse/openvsx/pull/410