Skip to content

Commit 66b2299

Browse files
authored
Merge pull request #55 from sidhant92/develop
Actions
2 parents 200f5dc + e813e93 commit 66b2299

File tree

6 files changed

+82
-119
lines changed

6 files changed

+82
-119
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'java'
55
id 'maven-publish'
66
id 'signing'
7-
id 'com.gradleup.nmcp' version '0.0.8'
7+
id 'com.gradleup.nmcp.aggregation' version '1.1.0'
88
}
99

1010
group 'com.github.sidhant92'
@@ -103,12 +103,14 @@ signing {
103103
}
104104

105105
// Configure New Maven Central Portal publishing
106-
nmcp {
107-
publishAllPublications {
106+
nmcpAggregation {
107+
centralPortal {
108108
username = System.getenv("MAVEN_USERNAME") ?: findProperty("mavenCentralUsername")
109109
password = System.getenv("MAVEN_PASSWORD") ?: findProperty("mavenCentralPassword")
110-
publicationType = "AUTOMATIC"
110+
publishingType = "AUTOMATIC"
111111
}
112+
113+
publishAllProjectsProbablyBreakingProjectIsolation()
112114
}
113115

114116
ext.genOutputDir = file("${layout.buildDirectory.get()}/generated-resources")

0 commit comments

Comments
 (0)