Skip to content

Commit

Permalink
Attempt to add publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
aaberg committed Mar 10, 2024
1 parent 1cd21df commit 6df9a4b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
build:

name: Build, test and publish to Github Packages
runs-on: ubuntu-latest

steps:
Expand All @@ -31,10 +31,6 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: publish artifacts to Github Packages
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy to maven central

on:
release:
types: [ "created" ]

jobs:
build:
name: Build, test and publish to Github Packages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Docker Compose Action
uses: isbang/[email protected]
- name: Set up JDK 17 and Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: publish to maven central
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ github.token }}
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<!-- <snapshotRepository>-->
<!-- <id>ossrh</id>-->
<!-- <url>https://oss.sonatype.org/content/repositories/snapshots</url>-->
<!-- </snapshotRepository>-->
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
Expand Down

0 comments on commit 6df9a4b

Please sign in to comment.