Skip to content

Commit 21266fb

Browse files
committed
added github actions
1 parent 74492d8 commit 21266fb

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/maven.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Maven Build
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- uses: actions/checkout@v2
11+
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 11
16+
17+
- name: Build with Maven
18+
run: mvn -B install --no-transfer-progress --file pom.xml
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: release-to-maven-central
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
releaseversion:
6+
description: 'Release version'
7+
required: true
8+
default: '2.0.0'
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up settings.xml for Maven Central Repository
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
server-id: oss.sonatype.org
22+
server-username: MAVEN_USERNAME
23+
server-password: MAVEN_PASSWORD
24+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
26+
27+
- name: Set projects Maven version to GitHub Action GUI set version
28+
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress
29+
30+
- name: Publish package
31+
run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true
32+
env:
33+
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
34+
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
36+
37+
- name: Generate changelog
38+
id: changelog
39+
uses: metcalfc/[email protected]
40+
with:
41+
myToken: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Create GitHub Release
44+
id: create_release
45+
uses: actions/create-release@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
tag_name: ${{ github.event.inputs.releaseversion }}
50+
release_name: ${{ github.event.inputs.releaseversion }}
51+
body: |
52+
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/reedelk/module-file/${{ github.event.inputs.releaseversion }}/
53+
### Things that changed in this release
54+
${{ steps.changelog.outputs.changelog }}
55+
draft: false
56+
prerelease: false

0 commit comments

Comments
 (0)