File tree Expand file tree Collapse file tree 5 files changed +24
-12
lines changed
build-logic/src/main/kotlin Expand file tree Collapse file tree 5 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,14 @@ jobs:
4444 echo version_type=$version_type
4545 echo version_type=$version_type >> $env:GITHUB_ENV
4646 - name : " Publish snapshot"
47- if : ${{ env.version_type == 'snapshot' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+ if : ${{ env.version_type == 'snapshot' && github.event_name == 'push' }}
4848 run : ./gradlew publish
4949 env :
5050 CI_PUBLISH_CORE : ${{ matrix.publish-core }}
5151 ORG_GRADLE_PROJECT_sonatypeUsername : ${{ secrets.SONATYPE_USERNAME }}
5252 ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.SONATYPE_PASSWORD }}
5353 - name : " Publish release"
54- if : ${{ env.version_type == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
54+ if : ${{ env.version_type == 'release' && github.event_name == 'push' }}
5555 run : ./gradlew --info -PforceSign=true publishToSonatype closeSonatypeStagingRepository
5656 env :
5757 CI_PUBLISH_CORE : ${{ matrix.publish-core }}
Original file line number Diff line number Diff line change 11import org.gradle.api.Project
22import org.gradle.api.provider.Provider
3+ import org.gradle.kotlin.dsl.findByType
4+ import org.gradle.plugins.signing.SigningExtension
35import java.io.File
46
57val Project .cpuFeaturesDir: File
@@ -11,8 +13,10 @@ val Project.ci: Provider<Boolean>
1113val Project .ciPublishCore: Provider <Boolean >
1214 get() = providers.environmentVariable(" CI_PUBLISH_CORE" ).map { it.toBoolean() }.orElse(false )
1315
14- fun Project.publishCore () {
15- if (! ci.get() || ciPublishCore.get()) {
16- plugins.apply (" publishing-conventions" )
17- }
16+ fun Project.publishCore (): Boolean {
17+ if (ci.get() && ! ciPublishCore.get())
18+ return false
19+
20+ plugins.apply (" publishing-conventions" )
21+ return true
1822}
Original file line number Diff line number Diff line change 11plugins {
22 id(" net.kyori.indra.publishing.sonatype" )
3+ id(" publishing-conventions" )
34}
45
56indraSonatype {
67 useAlternateSonatypeOSSHost(" s01" )
78}
9+
10+ tasks.register(" printVersionType" ) {
11+ doFirst {
12+ println (if (net.kyori.indra.util.Versioning .isSnapshot(project)) " snapshot" else " release" )
13+ }
14+ }
Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ plugins {
33 id(" java-conventions" )
44}
55
6- publishCore()
76
87group = " io.github.aecsocket"
9- version = " 2.0.1-SNAPSHOT "
8+ version = " 2.0.1"
109description = " Java bindings for Google cpu_features"
1110
1211dependencies {
@@ -21,8 +20,10 @@ dependencies {
2120 testRuntimeOnly(projects.cpuFeaturesJavaNativesMacosX86)
2221}
2322
24- tasks.register(" printVersionType" ) {
25- doFirst {
26- println (if (net.kyori.indra.util.Versioning .isSnapshot(project)) " snapshot" else " release" )
23+ if (! publishCore()) {
24+ tasks {
25+ withType<PublishToMavenRepository > {
26+ enabled = false
27+ }
2728 }
2829}
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.0-bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.0.2 -bin.zip
44networkTimeout =10000
55zipStoreBase =GRADLE_USER_HOME
66zipStorePath =wrapper/dists
You can’t perform that action at this time.
0 commit comments