Publish Capacitor Plugin to Maven Central #1
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 Capacitor Plugin to Maven Central | |
| on: | |
| workflow_call: | |
| secrets: | |
| ANDROID_CENTRAL_USERNAME: | |
| required: true | |
| ANDROID_CENTRAL_PASSWORD: | |
| required: true | |
| ANDROID_SIGNING_KEY_ID: | |
| required: true | |
| ANDROID_SIGNING_PASSWORD: | |
| required: true | |
| ANDROID_SIGNING_KEY: | |
| required: true | |
| ANDROID_SONATYPE_STAGING_PROFILE_ID: | |
| required: true | |
| CAP_GH_RELEASE_TOKEN: | |
| required: true | |
| workflow_dispatch: | |
| jobs: | |
| publish-android: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref_name }} # explicitly set ref to include commit from `semantic-release` | |
| token: ${{ secrets.CAP_GH_RELEASE_TOKEN }} | |
| - name: set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| - name: Grant execute permission for publishing script | |
| run: chmod +x ./scripts/publish-android.sh | |
| - name: Run publish script | |
| env: | |
| ANDROID_CENTRAL_USERNAME: ${{ secrets.ANDROID_CENTRAL_USERNAME }} | |
| ANDROID_CENTRAL_PASSWORD: ${{ secrets.ANDROID_CENTRAL_PASSWORD }} | |
| ANDROID_SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }} | |
| ANDROID_SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} | |
| ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }} | |
| ANDROID_SONATYPE_STAGING_PROFILE_ID: ${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }} | |
| run: ./scripts/publish-android.sh |