Skip to content

Commit

Permalink
autorelease workflow (#2584)
Browse files Browse the repository at this point in the history
  • Loading branch information
chayim authored and sazzad16 committed Jul 14, 2021
1 parent ac85198 commit df05370
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/version-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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 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: mvn versions
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}

- 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 }}' \
-DskipTests deploy -P release
env:
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,13 @@
<!--Sign the components - this is required by maven central for releases -->
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.0.1</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down

0 comments on commit df05370

Please sign in to comment.