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
Conversation
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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?
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
8813624
to
4628f67
Compare
* 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 |
There was a problem hiding this comment.
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
Unable to change dokka's version to RC without these changes, it'll fail build locally then.
RC
version typeMC
version type as it seems to be unused (will revert if it's really needed for something)gradle-plugin-portal
as a publication channel (onlyRELEASE
andRC
are allowed)dokka_version_base
in favour ofdokka_version
. Base version seems unused now, as TC passes value directly todokka_version
and automatically adding-SNAPSHOT
is not that big of a deal, it'll be present by default anyway.ENABLE_VERSION_CHECK
totrue
)I've also updated TeamCity publish configuration and added
env.ENABLE_VERSION_CHECK = true
and also added anRC
option fordokka_version
. Will test it when publishing RC to spaceSo version checking should still work now when publishing from TC, but is disabled locally.