From b1a676de9052bcf152655557a34972b111789556 Mon Sep 17 00:00:00 2001 From: Hccake Date: Sat, 13 Apr 2024 13:37:02 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?1.x=20=E7=89=88=E6=9C=AC=E6=89=8B=E5=8A=A8=20deploy=20=E7=9A=84?= =?UTF-8?q?=20Github=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy 1.x.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy 1.x.yml diff --git a/.github/workflows/deploy 1.x.yml b/.github/workflows/deploy 1.x.yml new file mode 100644 index 00000000..4d24c6c9 --- /dev/null +++ b/.github/workflows/deploy 1.x.yml @@ -0,0 +1,39 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Deploy 1.x to Maven Central + +on: + # 手动触发事件 + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + environment: ci + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + ref: '1.x' + java-version: '8' + distribution: 'temurin' + cache: maven + server-id: ossrh + server-username: CI_DEPLOY_USERNAME + server-password: CI_DEPLOY_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + + - name: Build With Maven + run: mvn -B package --file pom.xml "-Dextend.dingtalk.webhook=${{ secrets.CI_DINGTALK_HOOK }}" "-Dextend.dingtalk.secret=${{ secrets.CI_DINGTALK_SECRET }}" -P ci + + - name: Deploy Release + if: github.event_name != 'pull_request' + run: mvn -B deploy -DskipTests -P ossrh + env: + CI_DEPLOY_USERNAME: ${{ secrets.HCCAKE_OSSRH_USERNAME }} + CI_DEPLOY_PASSWORD: ${{ secrets.HCCAKE_OSSRH_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file