From aca498cef1e45247c6faa65775450511e6f721f4 Mon Sep 17 00:00:00 2001 From: smallchill Date: Wed, 12 Jun 2024 13:51:24 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-snapshot.yml | 32 ++++++++++++++++++++++++++ .github/workflows/test-and-build.yml | 8 +++---- deploy.sh | 12 ++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish-snapshot.yml create mode 100644 deploy.sh diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 0000000..30c3817 --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,32 @@ +name: Publish Snapshot + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + cache: 'maven' + java-version: 17 + server-id: oss + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-passphrase: MAVEN_GPG_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + - name: Publish to the Maven Central Repository + run: | + chmod +x ./deploy.sh + ./deploy.sh + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSWORD }} diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml index c2d1312..27620c2 100644 --- a/.github/workflows/test-and-build.yml +++ b/.github/workflows/test-and-build.yml @@ -2,16 +2,16 @@ name: Java CI on: [push, pull_request] jobs: - buildOnJava8: - name: build on java8 + buildOnJava17: + name: build on java17 runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up JDK 8 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'zulu' cache: 'maven' - java-version: 8 + java-version: 17 - name: Build with Maven run: mvn package diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..7a5c7c8 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +## 1. java version +java -version +printf "\n" + +## 2. mvn version +mvn -version +printf "\n" + +## 3. deploy +mvn clean package deploy -Prelease