From c9b91831ae8e0c2bff67ed2402b40e7505c26b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= <2270033969@qq.com> Date: Sun, 25 Aug 2024 19:18:18 +0800 Subject: [PATCH] =?UTF-8?q?ci(version):=20=E8=87=AA=E5=8A=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=83=20=E4=BF=AE=E6=94=B9=20tag=20=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/oss-release-deploy.yml | 12 ++++---- .github/workflows/oss-snapshot-deploy.yml | 36 ----------------------- 2 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/oss-snapshot-deploy.yml diff --git a/.github/workflows/oss-release-deploy.yml b/.github/workflows/oss-release-deploy.yml index 85d1b55..6a85ec7 100644 --- a/.github/workflows/oss-release-deploy.yml +++ b/.github/workflows/oss-release-deploy.yml @@ -1,8 +1,9 @@ -name: publish SNAPSHOT maven package +name: Publish SNAPSHOT Maven Package on: - workflow_dispatch: - push: - branches: [ release ] + workflow_dispatch: + push: + tags: + - 'v*' # 只在推送以 "v" 开头的标签时触发,如 "v1.0.0" jobs: oss-release-deploy: @@ -10,6 +11,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Set up JDK 8 uses: actions/setup-java@v2 with: @@ -29,7 +31,7 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Publish to Maven Central - run: mvn clean deploy -P release -Dmaven.test.skip=true + run: mvn clean deploy -P release -Dmaven.test.skip=true env: MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} diff --git a/.github/workflows/oss-snapshot-deploy.yml b/.github/workflows/oss-snapshot-deploy.yml deleted file mode 100644 index fc60c5f..0000000 --- a/.github/workflows/oss-snapshot-deploy.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: publish SNAPSHOT maven package -on: - workflow_dispatch: - push: - branches: [ master ] - -jobs: - oss-snapshot-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - cache: maven - - - name: Setup Maven Central - uses: actions/setup-java@v3 - with: # overwrite settings.xml - java-version: '8' - distribution: 'adopt' - server-id: sonatype - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD - gpg-private-key: ${{ secrets.MAVEN_GPG_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Publish to Maven Central - run: mvn clean deploy -P snapshot -Dmaven.test.skip=true - env: - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}