Update build.gradle.kts #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Maven Central | |
on: | |
push: | |
branches: | |
- main # Trigger deployment only on the main branch | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
deploy: | |
runs-on: macos-latest # Use macOS for iOS builds | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
steps: | |
# Step 1: Checkout Code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up JDK | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
# Step 3: Set up Gradle Cache | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# Step 4: Build Artifacts | |
- name: Build Artifacts | |
run: | | |
./gradlew clean assemble --no-configuration-cache | |
./gradlew :shared:linkReleaseFrameworkIosArm64 | |
./gradlew :shared:linkReleaseFrameworkIosSimulatorArm64 | |
./gradlew publishToMavenLocal --no-configuration-cache --info --stacktrace | |
# Step 6: Publish to Maven Central | |
- name: Publish to Maven Central | |
run: | | |
./gradlew :shared:publishToMavenCentral --no-configuration-cache --info --stacktrace --scan -Dorg.gradle.build-scan.agree=true |