-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Qiang Zhao <mattisonchao@apache.org>
- Loading branch information
1 parent
95ffb86
commit c1cc49c
Showing
2 changed files
with
155 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -Prelease -DskipTests deploy | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters