Skip to content

Commit 69334a1

Browse files
committed
Hopefully CI works now
1 parent 5180e66 commit 69334a1

105 files changed

Lines changed: 8810 additions & 849 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yml‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ jobs:
1212
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
1313
strategy:
1414
matrix:
15-
os: [ ubuntu-latest, windows-latest ] # TODO macos-latest
15+
os: [ ubuntu-latest, windows-latest, macos-latest ]
1616
include:
1717
- os: ubuntu-latest
18-
publish-api: true
18+
publish-core: true
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- name: "Checkout source"
2222
uses: actions/checkout@v3
23+
with:
24+
submodules: true
2325
- name: "Setup Java"
2426
uses: actions/setup-java@v3
2527
with:
@@ -32,27 +34,27 @@ jobs:
3234
- name: "sh: Get version type "
3335
if: ${{ matrix.os != 'windows-latest' }}
3436
run: |
35-
version_type=$(./gradlew -q --console=plain --no-daemon printVersionType)
36-
echo version_type=$version_type
37-
echo version_type=$version_type >> $GITHUB_ENV
37+
VERSION_TYPE=$(./gradlew -q --console=plain --no-daemon printVersionType)
38+
echo VERSION_TYPE=$VERSION_TYPE
39+
echo VERSION_TYPE=$VERSION_TYPE >> $GITHUB_ENV
3840
- name: "ps: Get version type"
3941
if: ${{ matrix.os == 'windows-latest' }}
4042
run: |
41-
$version_type = ./gradlew -q --console=plain --no-daemon printVersionType
42-
echo version_type=$version_type
43-
echo version_type=$version_type >> $env:GITHUB_ENV
43+
$VERSION_TYPE = ./gradlew -q --console=plain --no-daemon printVersionType
44+
echo VERSION_TYPE=$VERSION_TYPE
45+
echo VERSION_TYPE=$VERSION_TYPE >> $env:GITHUB_ENV
4446
- name: "Publish snapshot"
45-
if: ${{ env.version_type == 'snapshot' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
47+
if: ${{ env.VERSION_TYPE == 'snapshot' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
4648
run: ./gradlew publish
4749
env:
48-
CI_PUBLISH_API: ${{ matrix.publish-api }}
50+
CI_PUBLISH_CORE: ${{ matrix.publish-core }}
4951
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
5052
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
5153
- name: "Publish release"
52-
if: ${{ env.version_type == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
53-
run: ./gradlew -PforceSign=true publishToSonatype closeAndReleaseSonatypeStagingRepository
54+
if: ${{ env.VERSION_TYPE == 'release' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
55+
run: ./gradlew --info -PforceSign=true publishToSonatype closeSonatypeStagingRepository
5456
env:
55-
CI_PUBLISH_API: ${{ matrix.publish-api }}
57+
CI_PUBLISH_CORE: ${{ matrix.publish-core }}
5658
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
5759
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
5860
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}

‎build-logic/build.gradle.kts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ repositories {
99
dependencies {
1010
implementation(libs.indraCommon)
1111
implementation(libs.indraPublishingSonatype)
12-
implementation(libs.kotlin)
1312
implementation(libs.jextract)
1413
}

‎build-logic/src/main/kotlin/Extensions.kt‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import java.io.File
55
val Project.ci: Provider<Boolean>
66
get() = providers.environmentVariable("CI").map { it.toBoolean() }.orElse(false)
77

8-
val Project.ciPublishApi: Provider<Boolean>
9-
get() = providers.environmentVariable("CI_PUBLISH_API").map { it.toBoolean() }.orElse(false)
8+
val Project.ciPublishCore: Provider<Boolean>
9+
get() = providers.environmentVariable("CI_PUBLISH_CORE").map { it.toBoolean() }.orElse(false)
1010

1111
val Project.joltDir: File
1212
get() = rootDir.resolve("JoltPhysicsC")
@@ -31,8 +31,10 @@ val Project.buildFeatures: List<JoltBuildFeature>
3131
JoltBuildFeature.USE_FMADD // defines USE_SSE4_1, USE_SSE4_2, USE_AVX
3232
)
3333

34-
fun Project.publishIfNeeded() {
35-
if (!ci.get() || ciPublishApi.get()) {
36-
plugins.apply("publishing-conventions")
37-
}
34+
fun Project.publishCore(): Boolean {
35+
if (ci.get() && !ciPublishCore.get())
36+
return false
37+
38+
plugins.apply("publishing-conventions")
39+
return true
3840
}

‎build-logic/src/main/kotlin/java-conventions.gradle.kts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ indra {
1111
}
1212

1313
repositories {
14-
mavenLocal() // todo
1514
mavenCentral()
1615
}
1716

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
plugins {
22
id("net.kyori.indra.publishing.sonatype")
3+
id("publishing-conventions")
34
}
45

56
indraSonatype {
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+
}

‎build.gradle.kts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ plugins {
33
id("java-conventions")
44
}
55

6-
publishIfNeeded()
7-
86
group = "io.github.aecsocket"
97
version = "0.1.0-SNAPSHOT"
108
description = "Java bindings for JoltPhysics"
@@ -22,8 +20,10 @@ dependencies {
2220
//testRuntimeOnly(projects.joltJavaNativesMacosX86)
2321
}
2422

25-
tasks.register("printVersionType") {
26-
doFirst {
27-
println(if (net.kyori.indra.util.Versioning.isSnapshot(project)) "snapshot" else "release")
23+
if (!publishCore()) {
24+
tasks {
25+
withType<PublishToMavenRepository> {
26+
enabled = false
27+
}
2828
}
2929
}

‎generate-headers.sh‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎get-jextract.sh‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎gradle/libs.versions.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44

55
versions:
66
indra: 3.0.1
7-
kotlin: 1.8.10
87
jextract: 0.3.2
98
findBugs: 3.0.2
109
cpuFeaturesJava: 2.0.1
@@ -13,7 +12,6 @@ versions:
1312
dependencies:
1413
indraCommon: { group: net.kyori, name: indra-common, version: { ref: indra } }
1514
indraPublishingSonatype: { group: net.kyori, name: indra-publishing-sonatype, version: { ref: indra } }
16-
kotlin: { group: org.jetbrains.kotlin, name: kotlin-gradle-plugin, version: { ref: kotlin } }
1715
jextract: { group: gradle.plugin.io.github.krakowski, name: gradle-jextract, version: { ref: jextract } }
1816
findBugs: { group: com.google.code.findbugs, name: jsr305, version: { ref: findBugs } }
1917
cpuFeaturesJava: { group: io.github.aecsocket, name: cpu-features-java, version: { ref: cpuFeaturesJava } }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=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
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)