Skip to content

Commit 24201a1

Browse files
committed
Added release job
1 parent 997ed0e commit 24201a1

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish package to the Maven Central Repository
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release-github-tag:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Maven Central Repository
14+
uses: actions/setup-java@v2
15+
with:
16+
java-version: 1.8
17+
server-id: ossrh
18+
server-username: MAVEN_USERNAME
19+
server-password: MAVEN_PASSWORD
20+
21+
- name: Build a project & run unit tests
22+
run: mvn -B -ntp package
23+
24+
- name: Get the tag name
25+
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
26+
27+
- name: Set version from git tag
28+
run: mvn -B -ntp versions:set -DgenerateBackupPoms=false -DnewVersion="$TAG"
29+
30+
- name: Import GPG key
31+
run: |
32+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
33+
gpg --list-secret-keys --keyid-format LONG
34+
35+
- name: Publish maven package
36+
run: |
37+
mvn \
38+
--no-transfer-progress \
39+
--batch-mode \
40+
-D gpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
41+
-P ossrh \
42+
clean deploy
43+
env:
44+
MAVEN_USERNAME: kilmajster
45+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
46+
47+
- name: Add jar to Github Release
48+
uses: svenstaro/upload-release-action@v2
49+
continue-on-error: true
50+
with:
51+
repo_token: ${{ secrets.GITHUB_TOKEN }}
52+
file: target/ngrok-spring-boot-starter-${{ env.TAG }}.jar
53+
asset_name: ngrok-spring-boot-starter-${{ env.TAG }}.jar
54+
tag: ${{ github.ref }}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>io.github.kilmajster</groupId>
77
<artifactId>ngrok-spring-boot-starter</artifactId>
8-
<version>0.4.0</version>
8+
<version>SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>ngrok-spring-boot-starter</name>

0 commit comments

Comments
 (0)