Skip to content

Commit

Permalink
Publish snapshot to OSSRH
Browse files Browse the repository at this point in the history
  • Loading branch information
sajjaadalipour committed Dec 23, 2023
1 parent 875992a commit 05ad7a5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build
on:
push:
branches:
- master
- develop

jobs:
build:
Expand All @@ -21,8 +21,9 @@ jobs:
with:
java-version: 21
distribution: 'oracle'
server-id: github
settings-path: ${{ github.workspace }}
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Cache SonarCloud packages
uses: actions/cache@v3
Expand All @@ -49,7 +50,8 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ github.token }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
15 changes: 10 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.github.sajjaadalipour</groupId>
<groupId>io.github.sajjaadalipour</groupId>
<artifactId>errors-spring-boot-starter</artifactId>
<version>2.0.0</version>
<version>2.0.0-SNAPSHOT</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>
Expand Down Expand Up @@ -56,10 +56,15 @@
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub sajjaadalipour Apache Maven Packages</name>
<url>https://maven.pkg.github.com/sajjaadalipour/errors-spring-boot-starter</url>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

Expand Down

0 comments on commit 05ad7a5

Please sign in to comment.