From 34e5443e88b66329be05f419de69ad3dcde934ff Mon Sep 17 00:00:00 2001 From: "felord.cn" Date: Tue, 23 Mar 2021 00:12:53 +0800 Subject: [PATCH] ci: github action support --- .github/workflow/deployment.yaml | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflow/deployment.yaml diff --git a/.github/workflow/deployment.yaml b/.github/workflow/deployment.yaml new file mode 100644 index 0000000..ac556cf --- /dev/null +++ b/.github/workflow/deployment.yaml @@ -0,0 +1,34 @@ +name: Maven Central Repo Deployment +# 当合并到release 分支的 +on: + create: + branches: + - release +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Maven Central Repo + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: sonatype-nexus-staging + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - id: install-secret-key + name: Install GPG Secret Key + run: | + cat <(echo -e "${{ secrets.GPG_PUB }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + - id: publish-to-central + name: Publish to Maven Central Repo + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USER }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + run: | + mvn \ + --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase=${{ secrets.GPG_PASSWORD }} \ + clean deploy