Folio Java SDK 0.1.0 #1
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*'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 22 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 22 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| sed -i "s/version = \".*\"/version = \"$VERSION\"/" lib/build.gradle.kts | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Verify native libraries are bundled | |
| run: | | |
| for platform in macos-aarch64 macos-x86_64 linux-x86_64 linux-aarch64 windows-x86_64; do | |
| dir="lib/src/main/resources/natives/$platform" | |
| if [ -z "$(ls -A $dir 2>/dev/null)" ]; then | |
| echo "ERROR: No native library found in $dir" | |
| exit 1 | |
| fi | |
| done | |
| echo "All native libraries present." | |
| - name: Run tests | |
| run: ./gradlew test | |
| - name: Publish to Maven Central | |
| run: ./gradlew publishAllPublicationsToMavenCentralRepository | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} |