Skip to content

Commit

Permalink
Publish packages only to GitHub, not Maven Central
Browse files Browse the repository at this point in the history
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling committed May 21, 2021
1 parent 69b7c7e commit 9f03697
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 51 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 3 additions & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9f03697

Please sign in to comment.