Skip to content

Commit 65343e9

Browse files
committed
Utilize macos machines in CI
Signed-off-by: penguindan <[email protected]>
1 parent 32d09ff commit 65343e9

File tree

2 files changed

+41
-15
lines changed

2 files changed

+41
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,42 @@ on:
99
- '*'
1010

1111
jobs:
12-
Tests:
12+
test-linux:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v5
16+
uses: actions/checkout@v6
17+
18+
- name: Validate Gradle Wrapper
19+
uses: gradle/actions/wrapper-validation@v5
20+
21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v5
1723

1824
# For browser tests
1925
- uses: browser-actions/setup-chrome@v2
2026

2127
- name: Run checks
2228
run: ./gradlew check --no-daemon --stacktrace
29+
30+
test-mac:
31+
runs-on: macos-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v6
35+
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v5
38+
with:
39+
java-version: 17
40+
distribution: 'zulu'
41+
42+
- name: Validate Gradle Wrapper
43+
uses: gradle/actions/wrapper-validation@v5
44+
45+
- name: Setup Gradle
46+
uses: gradle/actions/setup-gradle@v5
47+
48+
- name: Run checks (skipping Linux tests)
49+
# linuxX64Test fails on macOS because it tries to execute the Linux binary
50+
run: ./gradlew check -x linuxX64Test --no-daemon --stacktrace

.github/workflows/release_please.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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: |
@@ -56,7 +48,7 @@ jobs:
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

Comments
 (0)