Skip to content

Commit 57d127e

Browse files
added publish2sonatype workflow
1 parent 400e1be commit 57d127e

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publishing to Sonatype
2+
on:
3+
push:
4+
# release:
5+
# types: [published]
6+
7+
env:
8+
GH_TOKEN: ${{ github.token }}
9+
10+
jobs:
11+
build_and_publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository code
15+
uses: actions/checkout@v3
16+
- name: Set up JDK 8
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '8.0.362'
20+
distribution: 'zulu'
21+
- name: Prepare gradle.properties
22+
run: |
23+
cd sift
24+
echo "$(pwd)"
25+
echo -e "${{ secrets.SECRING }}" | base64 -d > ./secring.gpg
26+
echo "$(ls -la)"
27+
echo "signing.keyId=${{ secrets.KEYID }}" >> ./gradle.properties
28+
echo "signing.password=${{ secrets.PASS }}" >> ./gradle.properties
29+
echo "signing.secretKeyRingFile=$(pwd)/secring.gpg" >> ./gradle.properties
30+
echo "NEXUS_USERNAME=${{ secrets.SUSER }}" >> ./gradle.properties
31+
echo "NEXUS_PASSWORD=${{ secrets.SPASSWORD }}" >> ./gradle.properties
32+
echo "$(ls -la)"
33+
- name: Sonatype Publish
34+
run: |
35+
cd sift
36+
./gradlew uploadArchives
37+
BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64)
38+
curl --request POST \
39+
--verbose \
40+
--header "Authorization: Bearer ${BEARER}" \
41+
https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }}

sift/maven-push.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ def isReleaseBuild() {
2323

2424
def getReleaseRepositoryUrl() {
2525
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
26-
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
26+
: "https://ossrh-staging-api.central.sonatype.com/service/local/"
2727
}
2828

2929
def getSnapshotRepositoryUrl() {
3030
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
31-
: "https://oss.sonatype.org/content/repositories/snapshots/"
31+
: "https://central.sonatype.com/repository/maven-snapshots/"
3232
}
3333

3434
def getRepositoryUsername() {

0 commit comments

Comments
 (0)