How Do I Publish To An EAP Channel?

Answered

When developing with gradle the publishPlugin can take a channel name.

This then allows me to publish to an EAP channel if I so wish.

https://jetbrains.org/intellij/sdk/docs/tutorials/build_system/deployment.html#specifying-a-release-channel

However, the devil is in the details.

Ideally I would want to publish to the main repo when I do releases from the master branch.

However, I would want to publish to the EAP channel when building from other branches.

What is the pattern for this?

Do you set an environment variable for the channel and set it to an empty string by default?

When empty, this uses the default plugin repository, available to all JetBrains Plugins Repository users. 

What about the version number?

After I have finished EAP does the stable version number have to be higher than the EAP version number?

Do I even have to increment the version number when publishing multiple versions to the EAP?

Do people do that via commits or via environment properties in the build server?

Is there an easy way to create an incrementing version number?

If I was using SVN I could use the svn repo version number but since I'm using git I have a hash and not a convenient number to use.

Are there any good examples of doing this?

 

 

 

 

 

 

2 comments
Comment actions Permalink

Recently we have releases the IntelliJ Platform Plugin Template which, among the others, provides a preconfigured CI using GitHub Actions.

The problem of providing the channel name automatically has been resolved by using the version property, as follows:

publishPlugin {
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}

https://github.com/JetBrains/intellij-platform-plugin-template/blob/master/build.gradle.kts#L110

 

CI takes the plugin version from any branch - i.e. 1.0.0-eap and publishes it to the eap channel.

If you're interested particularly in handling the branch names, you can use a variable name, like System.getenv("BRANCH_NAME") and provide it via CI to the Gradle script. Keep in mind that plugin should also contain such suffix to make the name different from the default main channel.

0
Comment actions Permalink

That is interesting.

So if I have a version that is 1.4.0-SNAPSHOT it will publish it to a channel called "SNAPSHOT" right?

But if the version is 1.4.0 it will publish it to a channel called "default"?

I thought you had to pass an empty string to use the general channel.

Or is the name of the general channel actually secretly called "default" and it isn't mentioned in the docs?

 

What about the question of version numbers?

I don't see anything in the GitHub actions that changes the version number

https://github.com/JetBrains/intellij-platform-plugin-template/blob/master/.github/workflows/release.yml

This commit seems to imply that you are changing the version number manually in commits

https://github.com/JetBrains/intellij-platform-plugin-template/commit/e427cdcfd011d12ffe31d2616bfba05db46f0e85

Using your example, is it OK then to publish the 1.0.0 version to the eap channel multiple times?

Does the plugin repo use something other than the version id to determine which is the latest version to update to?

 

After I have finished EAP does the stable version number have to be higher than the EAP version number?

0

Please sign in to leave a comment.