diff --git a/.github/actions/maven-publish/action.yml b/.github/actions/maven-publish/action.yml index e2436c5b..ee477061 100644 --- a/.github/actions/maven-publish/action.yml +++ b/.github/actions/maven-publish/action.yml @@ -3,7 +3,7 @@ name: Publish release to Java inputs: ossr-username: required: true - ossr-token: + ossr-password: required: true signing-key: required: true @@ -11,6 +11,10 @@ inputs: required: true java-version: required: true + is-android: + required: true + version: + required: true runs: using: composite @@ -29,11 +33,12 @@ runs: - uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # pin@1.1.0 - - name: Publish Android/Java Packages to Maven + - name: Publish Java + shell: bash + if: inputs.is-android == 'false' + run: ./gradlew clean assemble sign publishMavenJavaPublicationToMavenRepository -PisSnapshot=false -Pversion="${{ inputs.version }}" -PossrhUsername="${{ inputs.ossr-username }}" -PossrhPassword="${{ inputs.ossr-password }}" -PsigningKey="${{ inputs.signing-key }}" -PsigningPassword="${{ inputs.signing-password }}" + + - name: Publish Android shell: bash - run: ./gradlew publish -PisSnapshot=false --stacktrace - env: - MAVEN_USERNAME: ${{ inputs.ossr-username }} - MAVEN_PASSWORD: ${{ inputs.ossr-token }} - SIGNING_KEY: ${{ inputs.signing-key}} - SIGNING_PASSWORD: ${{ inputs.signing-password}} \ No newline at end of file + if: inputs.is-android == 'true' + run: ./gradlew clean assemble sign publishAndroidLibraryPublicationToMavenRepository -PisSnapshot=false -Pversion="${{ inputs.version }}" -PossrhUsername="${{ inputs.ossr-username }}" -PossrhPassword="${{ inputs.ossr-password }}" -PsigningKey="${{ inputs.signing-key }}" -PsigningPassword="${{ inputs.signing-password }}" diff --git a/.github/workflows/java-release.yml b/.github/workflows/java-release.yml index cc38e928..3f81eb14 100644 --- a/.github/workflows/java-release.yml +++ b/.github/workflows/java-release.yml @@ -6,11 +6,13 @@ on: java-version: required: true type: string - + is-android: + required: true + type: string secrets: ossr-username: required: true - ossr-token: + ossr-password: required: true signing-key: required: true @@ -68,8 +70,10 @@ jobs: - uses: ./.github/actions/maven-publish with: java-version: ${{ inputs.java-version }} + is-android: ${{ inputs.is-android }} + version: ${{ steps.get_version.outputs.version }} ossr-username: ${{ secrets.ossr-username }} - ossr-token: ${{ secrets.ossr-token }} + ossr-password: ${{ secrets.ossr-password }} signing-key: ${{ secrets.signing-key }} signing-password: ${{ secrets.signing-password }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c07a415c..3a07969c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,10 @@ jobs: uses: ./.github/workflows/java-release.yml with: java-version: 11.0.21-tem + is-android: false secrets: ossr-username: ${{ secrets.OSSR_USERNAME }} - ossr-token: ${{ secrets.OSSR_TOKEN }} + ossr-password: ${{ secrets.OSSR_PASSWORD }} signing-key: ${{ secrets.SIGNING_KEY }} signing-password: ${{ secrets.SIGNING_PASSWORD }} github-token: ${{ secrets.GITHUB_TOKEN }}