From 2b4a10030d27d14ac8d165051e1f1adc05e097ee Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Fri, 3 Apr 2020 20:58:03 +0800 Subject: [PATCH] Try auto release to Sonatype --- .github/workflows/deploy.yml | 15 +++++++++++++++ pom.xml | 15 +++++++++------ settings.xml | 6 ++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 45ece78..1cf86f2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,9 @@ on: env: GITHUB_USERNAME: x-access-token GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} jobs: deploy-github: @@ -17,3 +20,15 @@ jobs: - uses: actions/checkout@v2 - name: Deploy to GitHub Package Registry run: ./mvnw --batch-mode --settings settings.xml -Pgithub clean deploy + + deploy-sonatype: + name: Deploy to Sonatype Package Registry + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Import GPG Keys + run: | + gpg --keyserver keyserver.ubuntu.com --recv-keys ${{ secrets.GPG_PUBLIC_KEY }} + echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --no-tty --batch --yes - + - name: Deploy to Sonatype Package Registry + run: ./mvnw --batch-mode --settings settings.xml -Possrh,sign clean deploy diff --git a/pom.xml b/pom.xml index 3230f75..7de91ef 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.github.kezhenxu94 cache-lite - 0.1.6-SNAPSHOT + 0.1.6 cache-lite An extremely light-weight cache framework for Kotlin @@ -30,7 +30,7 @@ scm:git:git://github.com/kezhenxu94/cache-lite.git scm:git:git@github.com:kezhenxu94/cache-lite.git https://github.com/kezhenxu94/cache-lite - v0.1.3 + v0.1.6 @@ -57,10 +57,6 @@ 1.3.71 4.12 1.8 - - gpg - ${env.GPG_KEY_NAME} - ${env.GPG_PASSPHRASE} @@ -81,6 +77,12 @@ + + + --pinentry-mode + loopback + + @@ -247,6 +249,7 @@ true false forked-path + -DskipTests diff --git a/settings.xml b/settings.xml index 4349894..bb0e1ec 100644 --- a/settings.xml +++ b/settings.xml @@ -7,6 +7,12 @@ + + sign + + ${env.GPG_PASSPHRASE} + + github