Skip to content

Commit

Permalink
Revert "Revert "Publish jar to maven centre (#105)" (#110)"
Browse files Browse the repository at this point in the history
This reverts commit 23114ae.
  • Loading branch information
mattisonchao committed Jan 5, 2024
1 parent 9e15bf1 commit 9c081a0
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci-maven-publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI - Maven Publish Release

on:
push:
tags:
- 'v*'
workflow_dispatch:
# Publish nightly builds
schedule:
- cron: '0 0 * * *' # run at midnight UTC
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Verify
run: mvn --no-transfer-progress --batch-mode verify
- name: Package surefire test results
if: failure()
run: |
rm -rf test-results
mkdir test-results
find . -type d -name "*surefire*" -exec cp --parents -R {} test-results/ \;
zip -r test-results.zip test-results
- name: Upload test results
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-results
path: test-results.zip
- name: Publish to the Maven Central Repository
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/streamnative/oxia-java</url>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Snapshot Repository OSSRH</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
Expand Down

0 comments on commit 9c081a0

Please sign in to comment.