Skip to content

Commit df05370

Browse files
chayimsazzad16
authored andcommitted
autorelease workflow (#2584)
1 parent ac85198 commit df05370

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: get version from tag
16+
id: get_version
17+
run: |
18+
realversion="${GITHUB_REF/refs\/tags\//}"
19+
realversion="${realversion//v/}"
20+
echo "::set-output name=VERSION::$realversion"
21+
22+
- name: Set up publishing to maven central
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: '8'
26+
distribution: 'adopt'
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
31+
- name: mvn versions
32+
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}
33+
34+
- name: Install gpg key
35+
run: |
36+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
37+
gpg --list-secret-keys --keyid-format LONG
38+
39+
- name: Publish
40+
run: |
41+
mvn --no-transfer-progress \
42+
--batch-mode \
43+
-Dgpg.passphrase='${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}' \
44+
-DskipTests deploy -P release
45+
env:
46+
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
47+
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,13 @@
236236
<!--Sign the components - this is required by maven central for releases -->
237237
<plugin>
238238
<artifactId>maven-gpg-plugin</artifactId>
239-
<version>1.6</version>
239+
<version>3.0.1</version>
240+
<configuration>
241+
<gpgArguments>
242+
<arg>--pinentry-mode</arg>
243+
<arg>loopback</arg>
244+
</gpgArguments>
245+
</configuration>
240246
<executions>
241247
<execution>
242248
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)