From 108e5c6baa7d3a5c5abfa584ee6a12b6374c69aa Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 16 Nov 2022 16:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=87=AA=E5=8A=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 7 ++++--- .github/workflows/release.yml | 16 +++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 728e060e..69ba885a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,12 +36,13 @@ jobs: with: java-version: ${{ matrix.java }} distribution: ${{ matrix.distribution }} - - name: Cache Maven + - name: Cache local Maven m2 uses: actions/cache@v3 with: path: ~/.m2 - key: m2 - restore-keys: m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2 - name: Chmod run: chmod +x mvnw - name: Test with Maven diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c60418f..63b20d27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,14 +34,20 @@ jobs: server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - - name: Cache Maven + - name: Cache local Maven m2 uses: actions/cache@v3 with: path: ~/.m2 - key: m2 - restore-keys: m2 - - name: Release Maven package - run: mvn --batch-mode deploy + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-m2 + - id: install-secret-key + name: Install GPG secret key + run: | + cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import + - name: Publish package + run: | + mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} clean deploy -Dmaven.test.skip=false -Dmaven.javadoc.skip=false -Dgpg.skip=false env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} \ No newline at end of file