From 40ee9a8c41a9ed31b5216bbbb00e6badff154deb Mon Sep 17 00:00:00 2001 From: Antonio Bonifacio Date: Fri, 10 May 2024 00:09:15 +0200 Subject: [PATCH] chore: setup publishing to github maven repo --- .github/workflows/maven-publish.yml | 17 ++----- .github/workflows/maven.yml | 4 +- try-monad/pom.xml | 72 ++++++++++++++--------------- 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 1842918..0a81627 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -9,19 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + - name: Set up Java + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - name: Publish package - run: mvn --file try-monad/pom.xml --batch-mode deploy + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy env: - MAVEN_USERNAME: ${{ secrets.OSSRH_ID }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f2fa30d..27a6d31 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' diff --git a/try-monad/pom.xml b/try-monad/pom.xml index 314b34e..6c5f671 100644 --- a/try-monad/pom.xml +++ b/try-monad/pom.xml @@ -128,12 +128,12 @@ org.apache.maven.plugins maven-source-plugin - ${version.plugin.source} + 3.1.0 attach-sources - jar-no-fork + jar @@ -176,11 +176,12 @@ - org.apache.maven.plugins maven-deploy-plugin - ${version.plugin.deploy} + 2.8.2 - true + + internal.repo::default::file://${project.build.directory}/mvn-artifact + @@ -196,20 +197,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - org.jacoco jacoco-maven-plugin @@ -261,7 +248,32 @@ - + + com.github.github + site-maven-plugin + 0.12 + + Maven artifacts for ${project.version} + true + ${project.build.directory} + refs/heads/main + + **/* + + true + java-try-monad + anbonifacio + github + + + + + site + + deploy + + + com.diffplug.spotless spotless-maven-plugin @@ -298,29 +310,15 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + internal.repo + Temporary Staging Repository + file://${project.build.directory}/mvn-artifact