diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cbec30f..5deed71 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,5 @@ # This is a basic workflow to help you get started with Actions -# This file was contributed by Carlos Parada and Yamel Senih from ERP Consultores y Asociados, C.A +# This file was contributed by Carlos Parada, Edwin Betancourt and Yamel Senih from ERP Consultores y Asociados, C.A name: Publish With gradle to maven central @@ -13,15 +13,15 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build-ci: - name: Publish Project + publish-sonatype: + name: Publish Project (Sonatype) runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-package: 'jdk' @@ -29,13 +29,41 @@ jobs: architecture: x64 - name: Build with Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle-build-action@v3 with: - gradle-version: 8.0.1 + gradle-version: 8.0.2 arguments: publish env: - ADEMPIERE_LIBRARY_VERSION: ${{ github.event.release.tag_name }} - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }} - ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} - ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_deployVersion: ${{ github.event.release.tag_name }} + ORG_GRADLE_PROJECT_deployPublishUrl: ${{ secrets.DEPLOY_PUBLISH_SONATYPE_URL }} + ORG_GRADLE_PROJECT_deploySigningKey: ${{ secrets.PGP_SECRET }} + ORG_GRADLE_PROJECT_deploySigningPassword: ${{ secrets.PGP_PASSPHRASE }} + ORG_GRADLE_PROJECT_deployUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_deployPassword: ${{ secrets.OSSRH_TOKEN }} + publish-github: + name: Publish Project (Github) + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Set up Java JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-package: 'jdk' + java-version: 11 + architecture: x64 + + - name: Build with Gradle + uses: gradle/gradle-build-action@v3 + with: + gradle-version: 8.0.2 + arguments: publish + env: + ORG_GRADLE_PROJECT_deployVersion: ${{ github.event.release.tag_name }} + ORG_GRADLE_PROJECT_deployPublishUrl: ${{ secrets.DEPLOY_PUBLISH_GITHUB_URL }} + ORG_GRADLE_PROJECT_deploySigningKey: ${{ secrets.PGP_SECRET }} + ORG_GRADLE_PROJECT_deploySigningPassword: ${{ secrets.PGP_PASSPHRASE }} + ORG_GRADLE_PROJECT_deployUsername: "${{ github.actor }}" + ORG_GRADLE_PROJECT_deployPassword: "${{ secrets.DEPLOY_TOKEN }}" diff --git a/build.gradle b/build.gradle index 1a2f0da..4687a35 100644 --- a/build.gradle +++ b/build.gradle @@ -45,14 +45,14 @@ java { } -def entityType = 'D' +def entityType = 'ECA32' group = "io.github.adempiere" -version = System.getenv("ADEMPIERE_LIBRARY_VERSION") ?: "local-1.0.0" +version = findProperty("deployVersion") ?: "local-1.0.0" jar { manifest { attributes( - "Implementation-Title": "ADempiere Template Management", + "Implementation-Title": "ADempiere S3 Connector", "Implementation-Version": version, "EntityType": entityType ) @@ -64,10 +64,10 @@ publishing { mavenLocal() maven { - url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + url = findProperty("deployPublishUrl") ?: System.properties['deploy.publish_url'] credentials { - username = findProperty("sonatypeUsername") - password = findProperty("sonatypePassword") + username = findProperty("deployUsername") ?: System.properties['deploy.user'] + password = findProperty("deployPassword") ?: System.properties['deploy.token'] } } } @@ -122,8 +122,8 @@ signing { it.equals(PublishToMavenRepository) } } - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") + def signingKey = findProperty("deploySigningKey") + def signingPassword = findProperty("deploySigningPassword") useInMemoryPgpKeys(signingKey, signingPassword) sign publishing.publications.mavenJava }