diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c8e7a9..0e6cedc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: - run: mvn cobertura:cobertura - run: bash <(curl -s https://raw.githubusercontent.com/codecov/codecov-action/master/codecov) -t ${CODECOV_TOKEN} - - run: mvn -s .circleci.settings.xml -DskipTests deploy + - run: mvn -s .circleci.settings.xml -DskipTests -Dgpg.skip deploy workflows: version: 2 diff --git a/.github/workflows/version-and-release.yml b/.github/workflows/version-and-release.yml new file mode 100644 index 0000000..4e66ba6 --- /dev/null +++ b/.github/workflows/version-and-release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: get version from tag + id: get_version + run: | + realversion="${GITHUB_REF/refs\/tags\//}" + realversion="${realversion//v/}" + echo "::set-output name=VERSION::$realversion" + + - name: set version from tag + uses: actions/setup-java@v2 + run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }} + + - name: Set up publishing to maven central + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + + - name: Install gpg key + run: | + cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + + - name: Publish + run: | + mvn --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase="${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}" \ + -s -DskipTests deploy -P release + env: + MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}} + MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}} diff --git a/pom.xml b/pom.xml index 34644ca..1c108ee 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.redislabs jrejson 1.5.0-SNAPSHOT - + JReJSON Official client for ReJSON https://oss.redislabs.com/rejson @@ -159,7 +159,13 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 3.0.1 + + + --pinentry-mode + loopback + + sign-artifacts