Deploy to Maven Central #2
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: Deploy to Maven Central | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| deploy_interface: | |
| description: 'Deploy interface module' | |
| type: boolean | |
| default: true | |
| deploy_service: | |
| description: 'Deploy service module' | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| if: github.event.inputs.deploy_interface == 'true' || github.event.inputs.deploy_service == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - name: set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Publish to Maven Central | |
| run: | | |
| echo 'org.gradle.caching=true' >> gradle.properties | |
| echo 'org.gradle.parallel=true' >> gradle.properties | |
| echo 'org.gradle.vfs.watch=true' >> gradle.properties | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties | |
| TASKS="" | |
| if [[ "${{ github.event.inputs.deploy_interface }}" == "true" ]]; then | |
| TASKS="$TASKS publishInterfacePublicationToOssrhRepository" | |
| fi | |
| if [[ "${{ github.event.inputs.deploy_service }}" == "true" ]]; then | |
| TASKS="$TASKS publishServicePublicationToOssrhRepository" | |
| fi | |
| ./gradlew $TASKS | |
| ./gradlew --stop | |
| curl -X POST -H "Authorization: Bearer $(echo -n ${ORG_GRADLE_PROJECT_ossrhUsername}:${ORG_GRADLE_PROJECT_ossrhPassword} | base64)" https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/io.github.libxposed | |
| env: | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }} | |
| ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRHUSERNAME }} | |
| ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRHPASSWORD }} |