Skip to content

Commit

Permalink
ci: updated maven-publish action to perform the release
Browse files Browse the repository at this point in the history
  • Loading branch information
desusai7 committed May 28, 2024
1 parent c53aeeb commit ecccb8c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
28 changes: 13 additions & 15 deletions .github/actions/maven-publish/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Publish release to Java

inputs:
java-version:
required: true

secrets:
ossr-username:
required: true
ossr-password:
ossr-token:
required: true
signing-key:
required: true
signing-password:
required: true
java-version:
required: true
is-android:
required: true
version:
required: true


runs:
using: composite
Expand All @@ -33,12 +32,11 @@ runs:
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # [email protected]

- 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/Java Packages to Maven
run: ./gradlew publish -PisSnapshot=false
env:
MAVEN_USERNAME: ${{ secrets.ossr-username }}
MAVEN_PASSWORD: ${{ secrets.ossr-token }}
SIGNING_KEY: ${{ secrets.signing-key}}
SIGNING_PASSWORD: ${{ secrets.signing-password}}

- name: Publish Android
shell: bash
if: inputs.is-android == 'true'
run: ./gradlew clean assemble publishAndroidLibraryPublicationToMavenRepository -PisSnapshot=false -Pversion="${{ inputs.version }}" -PossrhUsername="${{ inputs.ossr-username }}" -PossrhPassword="${{ inputs.ossr-password }}" -PsigningKey="${{ inputs.signing-key }}" -PsigningPassword="${{ inputs.signing-password }}"
18 changes: 8 additions & 10 deletions .github/workflows/java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
java-version:
required: true
type: string
is-android:
required: true
type: string

secrets:
ossr-username:
required: true
ossr-password:
ossr-token:
required: true
signing-key:
required: true
Expand Down Expand Up @@ -68,12 +66,12 @@ jobs:

# Publish the release to Maven
- name: Publish package to Maven
run: ./gradlew publish -PisSnapshot=false
env:
MAVEN_USERNAME: ${{ secrets.OSSR_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSR_TOKEN }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY}}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD}}
- uses: ./.github/actions/maven-publish
secrets:
ossr-username: ${{ secrets.ossr-username }}
ossr-token: ${{ secrets.ossr-token }}
signing-key: ${{ secrets.signing-key}}
signing-password: ${{ secrets.signing-password}}

# Create a release for the tag
- uses: ./.github/actions/release-create
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
uses: ./.github/workflows/java-release.yml
with:
java-version: 8.0.402-zulu
is-android: true
secrets:
ossr-username: ${{ secrets.OSSR_USERNAME }}
ossr-password: ${{ secrets.OSSR_PASSWORD }}
ossr-token: ${{ secrets.OSSR_TOKEN }}
signing-key: ${{ secrets.SIGNING_KEY }}
signing-password: ${{ secrets.SIGNING_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ecccb8c

Please sign in to comment.