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

Minor refactoring of dokka versioning and publishing #2401

Merged
merged 3 commits into from Mar 25, 2022

Conversation

IgnatBeresnev
Copy link
Member

@IgnatBeresnev IgnatBeresnev commented Mar 22, 2022

Unable to change dokka's version to RC without these changes, it'll fail build locally then.

  • Added RC version type
  • Removed MC version type as it seems to be unused (will revert if it's really needed for something)
  • Added gradle-plugin-portal as a publication channel (only RELEASE and RC are allowed)
  • Removed dokka_version_base in favour of dokka_version. Base version seems unused now, as TC passes value directly to dokka_version and automatically adding -SNAPSHOT is not that big of a deal, it'll be present by default anyway.
  • Reverted condition for version check (now off by default, needs to by enabled by setting ENABLE_VERSION_CHECK to true)

I've also updated TeamCity publish configuration and added env.ENABLE_VERSION_CHECK = true and also added an RC option for dokka_version. Will test it when publishing RC to space

So version checking should still work now when publishing from TC, but is disabled locally.

@@ -1,6 +1,5 @@
# Project Settings
dokka_version_base=1.6.10
dokka_publication_channels=maven-central-snapshot&space-dokka-dev
dokka_version=1.6.20-SNAPSHOT
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add this because integration tests fail otherwise. Previously, it added -SNAPSHOT automatically and integration test projects used 1.6.10-SNAPSHOT when running the tests (reloading it from local every build).

However, If I revert it back to 1.6.10, integration tests will use 1.6.10 from maven central, which doesn't have some features yet (like documentedVisibilities), and so some integration tests will fail.

I set it to 1.6.20-SNAPSHOT specifically since this is the version that is now in master. I'll change it to 1.6.30-SNAPSHOT after creating the 1.6.20 release branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to change the integration test to use a special version like here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice, but not without some refactoring, unfortunately. I tried it for it-basic project and it doesn't resolve the version.

I think we could make it work somehow, but I don't think it's necessary for now

Copy link
Member

@vmishenev vmishenev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is about building scripts of GH pages?

CONTRIBUTING.md Show resolved Hide resolved
@@ -53,22 +55,24 @@ open class ValidatePublications : DefaultTask() {
}

private fun Project.assertPublicationVersion() {
if (System.getenv("SKIP_VERSION_CHECK")?.contains("true", ignoreCase = true) == true)
val isVersionCheckEnabled = System.getenv("ENABLE_VERSION_CHECK").equals("true", ignoreCase = true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to rename the var? It is dangerous. It makes easier to skip the checking to release. We have a chance to publish with an incorrect version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this check altogether - we don't really need it.

It is not executed if dokka_publication_channels is empty, and I removed it from the default configuration. So this will be 100% executed on TeamCity and can be executed locally if you add a publication channel

* Added RC version type
* Added gradle-plugin-portal as a publication channel
* Removed `dokka_version_base` in favour of `dokka_version`
* Reverted condition for version check (now off by default)
* Remove explicit flag for version checking, will be executed automatically if publication channels are present
* Update publish to GH pages script to include SNAPSHOT docs
run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2 | cut -d '-' -f 1`" >> $GITHUB_ENV
run: echo "DOKKA_VERSION=`./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2`" >> $GITHUB_ENV
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ignat@jb dokka]$ ./gradlew :properties | grep '^version:.*' | cut -d ' ' -f 2
1.6.20-SNAPSHOT

@IgnatBeresnev IgnatBeresnev merged commit 414475f into master Mar 25, 2022
@IgnatBeresnev IgnatBeresnev deleted the dokka_version_refactoring branch March 25, 2022 16:07
@Kotlin Kotlin deleted a comment from vominhky Mar 26, 2022
@Dqddyvillager1722 Dqddyvillager1722 linked an issue Mar 26, 2022 that may be closed by this pull request
@IgnatBeresnev IgnatBeresnev removed a link to an issue Mar 28, 2022
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.

None yet

2 participants