Merge pull request #4 from hoppjan/patch-1 #7
Workflow file for this run
This file contains hidden or 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: Publish to Maven Central | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-natives: | |
| if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} | |
| uses: ./.github/workflows/build-natives.yaml | |
| publish: | |
| needs: build-natives | |
| # macOS runner is required so Kotlin/Native can build iOS targets for the | |
| # Maven Central release. All other targets (jvm, android, js, wasmJs) build | |
| # on macOS too, so a single runner publishes the full KMP artefact set. | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Download PDFium JNI natives | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: pdfium/src/jvmMain/resources/pdfium/native/ | |
| pattern: 'pdfium-jni-*' | |
| merge-multiple: true | |
| - name: Verify all JNI natives present | |
| run: | | |
| EXPECTED=( | |
| "pdfium/src/jvmMain/resources/pdfium/native/linux-x86-64/libpdfiumjni.so" | |
| "pdfium/src/jvmMain/resources/pdfium/native/linux-aarch64/libpdfiumjni.so" | |
| "pdfium/src/jvmMain/resources/pdfium/native/darwin-aarch64/libpdfiumjni.dylib" | |
| "pdfium/src/jvmMain/resources/pdfium/native/darwin-x86-64/libpdfiumjni.dylib" | |
| "pdfium/src/jvmMain/resources/pdfium/native/win32-x86-64/pdfiumjni.dll" | |
| "pdfium/src/jvmMain/resources/pdfium/native/win32-arm64/pdfiumjni.dll" | |
| ) | |
| MISSING=0 | |
| for f in "${EXPECTED[@]}"; do | |
| if [ -f "$f" ]; then | |
| echo "OK: $f ($(wc -c < "$f") bytes)" | |
| else | |
| echo "MISSING: $f" >&2 | |
| MISSING=1 | |
| fi | |
| done | |
| if [ "$MISSING" = "1" ]; then exit 1; fi | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Publish to Maven Central | |
| run: ./gradlew :pdfium:publishAndReleaseToMavenCentral --no-configuration-cache | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVENCENTRALUSERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVENCENTRALPASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNINGINMEMORYKEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNINGKEYID }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNINGPASSWORD }} |