Skip to content

Commit 2a4df9e

Browse files
committed
update for sonatype contral repo and add test workflow
1 parent ff68875 commit 2a4df9e

File tree

2 files changed

+54
-6
lines changed

2 files changed

+54
-6
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- migrate-sonatype-test
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-java@v1
12+
with:
13+
java-version: 11
14+
- name: Cache Gradle Modules
15+
uses: actions/cache@v4
16+
with:
17+
path: ~/.gradle/caches
18+
key: gradle-caches-${{ hashFiles('**/*.gradle.kts') }}
19+
- name: Cache Gradle Wrapper
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.gradle/wrapper
23+
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
24+
- name: Build and test
25+
run: ./gradlew build -Prelease.version=0.0.1-test --stacktrace
26+
env:
27+
CI: true
28+
- name: Build and publish to sonatype
29+
run: ./gradlew final closeAndReleaseSonatypeStagingRepository -Prelease.version=0.0.1-test --stacktrace
30+
env:
31+
CI: true
32+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME_TEST }}
33+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD_TEST }}
34+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
35+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
36+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
37+
GRGIT_USER: ${{ github.actor }}
38+
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
39+
# - name: Create Release
40+
# id: create_release
41+
# uses: actions/create-release@v1
42+
# env:
43+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
# with:
45+
# tag_name: v${{ github.event.inputs.version }}
46+
# release_name: Release v${{ github.event.inputs.version }}
47+
# draft: true
48+
# prerelease: false

build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ release {
4343
nexusPublishing {
4444
repositories {
4545
sonatype {
46-
nexusUrl.set(uri("https://aws.oss.sonatype.org/service/local/"))
47-
snapshotRepositoryUrl.set(uri("https://aws.oss.sonatype.org/content/repositories/snapshots/"))
48-
username.set("${findProperty("aws.sonatype.username") ?: System.getenv("SONATYPE_USERNAME")}")
49-
password.set("${findProperty("aws.sonatype.password") ?: System.getenv("SONATYPE_PASSWORD")}")
46+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
47+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
48+
username.set(System.getenv("PUBLISH_TOKEN_USERNAME_TEST"))
49+
password.set(System.getenv("PUBLISH_TOKEN_PASSWORD_TEST"))
5050
}
5151
}
5252
}
5353

5454
allprojects {
55-
group = "com.amazonaws"
55+
group = "com.sonatype.central.testing.amazon"
5656

5757
repositories {
5858
mavenCentral()
@@ -301,7 +301,7 @@ allprojects {
301301
}
302302

303303
subprojects {
304-
group = "com.amazonaws"
304+
group = "com.sonatype.central.testing.amazon"
305305

306306
plugins.withId("java-library") {
307307
plugins.apply("jacoco")

0 commit comments

Comments
 (0)