diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b625fb1..210335b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,32 +1,67 @@ -name: Publish to Maven Central +name: Deploy Maven on: push: - branches: - - master + branches: [ "main", "deploy" ] jobs: - publish: + deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Setup Java 11 uses: actions/setup-java@v4 with: - java-version: '11' distribution: 'temurin' + java-version: '11' cache: maven - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Publish to Maven Central - run: mvn clean deploy -P release + + # 🔐 Importa GPG + - name: Import GPG key + run: | + echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + # ⚙️ Cria settings.xml dinâmico + - name: Create Maven settings.xml + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml < + + + central + ${{ secrets.OSSRH_USERNAME }} + ${{ secrets.OSSRH_TOKEN }} + + + + + + gpg + + ${{ secrets.GPG_PASSPHRASE }} + + + + + + gpg + + + EOF + + - name: Debug settings + run: cat ~/.m2/settings.xml + + # 🚀 Deploy + - name: Maven deploy + run: mvn clean deploy -Dmaven.test.skip=true env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/pom.xml b/pom.xml index 4ed5dd9..9037047 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.github.jpdev01 asaassdk - 1.8-SNAPSHOT + 1.3 jar Asaas SDK @@ -58,37 +58,25 @@ - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 + maven-jar-plugin + + + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central + true + true org.apache.maven.plugins maven-compiler-plugin - - 9 - 9 - org.apache.maven.plugins