Skip to content

Commit 4a51350

Browse files
committed
new github workflows
1 parent 77c1543 commit 4a51350

File tree

6 files changed

+78
-116
lines changed

6 files changed

+78
-116
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up JDK 8
15-
uses: actions/setup-java@v3
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 21
15+
uses: actions/setup-java@v4
1616
with:
17-
java-version: '8'
17+
java-version: '21'
1818
distribution: 'temurin'
1919
cache: 'gradle'
2020

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags: [ 'v*' ]
7+
8+
jobs:
9+
publish-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Setup Gradle
22+
uses: gradle/gradle-build-action@v2
23+
24+
- name: Run tests
25+
run: ./gradlew test
26+
27+
- name: Publish release
28+
run: ./gradlew publishAggregationToCentralPortal
29+
env:
30+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
31+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
32+
signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
33+
signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Snapshot
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
7+
jobs:
8+
publish-snapshot:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up JDK 21
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '21'
18+
distribution: 'temurin'
19+
20+
- name: Setup Gradle
21+
uses: gradle/gradle-build-action@v2
22+
23+
- name: Set snapshot version
24+
run: |
25+
VERSION=$(grep "version = " build.gradle | sed 's/version = "\(.*\)"/\1/')
26+
if [[ ! $VERSION == *"-SNAPSHOT" ]]; then
27+
sed -i "s/version = \"$VERSION\"/version = \"$VERSION-SNAPSHOT\"/" build.gradle
28+
fi
29+
30+
- name: Run tests
31+
run: ./gradlew test
32+
33+
- name: Publish snapshot
34+
run: ./gradlew publishAggregationToCentralPortalSnapshots
35+
env:
36+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
37+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
38+
signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
39+
signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

.github/workflows/release.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/snapshot.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ signing {
104104

105105
// Configure New Maven Central Portal publishing
106106
nmcp {
107-
publishAllPublications {
107+
publishAggregation {
108+
project(":")
108109
username = System.getenv("MAVEN_USERNAME") ?: findProperty("mavenCentralUsername")
109110
password = System.getenv("MAVEN_PASSWORD") ?: findProperty("mavenCentralPassword")
110111
publicationType = "AUTOMATIC"

0 commit comments

Comments
 (0)