nbadal / ktlint-intellij-plugin

Ktlint plugin for IntelliJ IDEA + Android Studio
MIT License
157 stars 23 forks source link

Releases on the beta channel #434

Closed jasonab closed 8 months ago

jasonab commented 8 months ago

First off, thanks very much to @paul-dingemans for taking up the mantle of this plugin - it's needed more official support for some time now (and of course thanks to @nbadal for kicking things off).

I added the beta channel a couple of weeks ago, and the upgrade went smoothly, but now I see that I'm stuck on the most recent beta version, instead of upgrading to the current release version. I'm not sure what the correct procedure is to make sure that non-beta releases are taken up by beta channel subscribers, but it would be nice for that to work.

paul-dingemans commented 8 months ago

Functionally there is no difference between latest beta and official 0.20. In order to get the official release, you will need to remove the beta-channel repository. But it means that you won't get next beta automatically.

jasonab commented 8 months ago

ok, as long as the betas are at least at release level, that works

paul-dingemans commented 8 months ago

I just had a second look at the build pipeline. I get the feeling that it should be possible to publish a plugin to multiple channels:

    publishPlugin {
        dependsOn("patchChangelog")
        token = environment("PUBLISH_TOKEN")
        // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
        // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
        // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel.
        // The channel is set by setting the pluginVersion in the root `gradle.properties`
        channels =
            // Replace due to multi-module setup
            // properties("pluginVersion").map {
            listOf(
                pluginVersion
                    .split('-')
                    .getOrElse(1) { "default" }
                    .split('.')
                    .first(),
            )
    }

Code above should be changed so that if the pluginVersion is suffixed with beta, that the plugin is published to the beta channel only. When not suffixed, it should be released to both the default as well as the beta channel. Let me try that out with next release.