From 9f0369760be9eb8a95d9ad856d9524d016756091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= <juraci@kroehling.de> Date: Fri, 21 May 2021 15:00:41 +0200 Subject: [PATCH] Publish packages only to GitHub, not Maven Central MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de> --- .github/workflows/release.yaml | 21 ++++++++--------- pom.xml | 42 +++------------------------------- 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dca183b..33001b3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,23 +1,20 @@ -name: Publish package to the Maven Central Repository +name: Publish package to GitHub Packages on: - push: - tags: - - '*' + release: + types: [created] jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v2 - - name: Set up Maven Central Repository - uses: actions/setup-java@v2 + - uses: actions/setup-java@v2 with: java-version: '11' distribution: 'adopt' - server-id: ossrh - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - name: Publish package run: mvn --batch-mode deploy env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pom.xml b/pom.xml index 6057acb..4e8db9f 100644 --- a/pom.xml +++ b/pom.xml @@ -84,48 +84,12 @@ <distributionManagement> <repository> - <id>ossrh</id> - <name>Central Repository OSSRH</name> - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> + <id>github</id> + <name>GitHub Packages</name> + <url>https://maven.pkg.github.com/opentracing-contrib/java-ejb</url> </repository> </distributionManagement> - <build> - <pluginManagement> - <plugins> - <!-- mvn -N io.takari:maven:wrapper -Dmaven=3.5.0 --> - <plugin> - <groupId>io.takari</groupId> - <artifactId>maven</artifactId> - <version>${version.io.takari-maven}</version> - </plugin> - </plugins> - </pluginManagement> - - <plugins> - <plugin> - <artifactId>maven-release-plugin</artifactId> - <version>${version.maven-release-plugin}</version> - <configuration> - <useReleaseProfile>false</useReleaseProfile> - <releaseProfiles>release</releaseProfiles> - <autoVersionSubmodules>true</autoVersionSubmodules> - <tagNameFormat>@{project.version}</tagNameFormat> - </configuration> - </plugin> - <plugin> - <groupId>io.zipkin.centralsync-maven-plugin</groupId> - <artifactId>centralsync-maven-plugin</artifactId> - <version>${version.io.zikin.centralsync-maven-plugin}</version> - <configuration> - <subject>opentracing</subject> - <repo>maven</repo> - <packageName>opentracing-ejb</packageName> - </configuration> - </plugin> - </plugins> - </build> - <profiles> <profile> <id>release</id>