From 10a881860e1a7d9ec056fa5d775589ff67101c4c Mon Sep 17 00:00:00 2001 From: bianjie Date: Thu, 2 Mar 2023 18:51:35 +0800 Subject: [PATCH] add cicd --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bc8d0a8 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Maven Central Repo Deployment +on: + release: + types: [released] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'adopt' + shell: bash -l {0} + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase : GPG_PASSPHRASE + - run: | + export GPG_TTY=$(tty) + gpg --pinentry-mode loopback --passphrase '${{ secrets.GPG_PASSPHRASE }}' -s pom.xml + mvn --batch-mode deploy -Dmaven.test.skip=true + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}