@@ -29,21 +29,13 @@ jobs:
2929
3030 kotlin-release :
3131 needs : release-please
32- runs-on : ubuntu-latest
32+ # Run on macOS to ensure we can publish iOS/Mac targets AND Linux/Android targets (via cross-compilation).
33+ # This ensures a single consistent root module file is published.
34+ runs-on : macos-latest
3335 if : ${{ needs.release-please.outputs.release_created }}
3436 steps :
3537 # The logic below handles the github release:
36- - name : Cache Gradle and wrapper
37- uses : actions/cache@v3
38- with :
39- path : |
40- ~/.gradle/caches
41- ~/.gradle/wrapper
42- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
43- restore-keys : |
44- ${{ runner.os }}-gradle-
45-
46- - uses : actions/checkout@v5
38+ - uses : actions/checkout@v6
4739
4840 - name : Configure GPG Key
4941 run : |
5648 run : |
5749 mkdir -p ~/.gradle/
5850 echo "signing.keyId=08C5EC5C" >> ~/.gradle/gradle.properties
59- echo "signing.secretKeyRingFile=/home/runner /.gnupg/secring.gpg" >> ~/.gradle/gradle.properties
51+ echo "signing.secretKeyRingFile=$HOME /.gnupg/secring.gpg" >> ~/.gradle/gradle.properties
6052 echo "signing.password=$GPG_SIGNING_KEY_PASSWORD" >> ~/.gradle/gradle.properties
6153 env :
6254 GPG_SIGNING_KEY_ID : ${{ secrets.GPG_SIGNING_KEY_ID }}
@@ -68,13 +60,19 @@ jobs:
6860 java-version : 17
6961 distribution : ' zulu'
7062
63+ - name : Setup Gradle
64+ uses : gradle/actions/setup-gradle@v5
65+
7166 - name : Grant Permission for Gradlew to Execute
7267 run : chmod +x gradlew
7368
7469 - name : Publish to Sonatype
7570 env :
7671 CENTRAL_USERNAME : ${{ secrets.CENTRAL_USERNAME }}
7772 CENTRAL_PASSWORD : ${{ secrets.CENTRAL_PASSWORD }}
73+ # We publish everything from Mac.
74+ # Note: This will compile Linux targets but NOT run their tests (which would fail on Mac).
75+ # We assume CI has already validated Linux tests.
7876 run : ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon --stacktrace
7977
8078 - name : Clean up signing secrets
0 commit comments