Skip to content

Commit 5f68a14

Browse files
Issue 56/publish snapshots central (#57)
* Issue #56 - Publish SNAPSHOTs to Maven Central, not TBD Artifactory * Issue #56 - Update to new org secret name * publishing: add tailing slash to ossrh-snapshots URL * Fix the user token in GH Actions org secrets - must be tied to the correct Sonatype server Align with URLs from https://central.sonatype.org/publish/publish-guide/#accessing-repositories --------- Co-authored-by: finn <[email protected]>
1 parent 3528730 commit 5f68a14

File tree

4 files changed

+6
-47
lines changed

4 files changed

+6
-47
lines changed

.github/workflows/build.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,13 @@ jobs:
9595
--batch-mode \
9696
-DnewVersion=${{ steps.resolve_version.outputs.resolved_version }}
9797
98-
set +x
99-
GITHUB_ID_TOKEN="$(curl -sLS -H "User-Agent: actions/oidc-client" -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=jfrog-github" | jq -r .value)"
100-
export ARTIFACTORY_PASSWORD="$(curl -fsH "Content-Type: application/json" "https://blockxyz.jfrog.io/access/api/v1/oidc/token" -d "{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"${GITHUB_ID_TOKEN}\", \"provider_name\": \"github\"}" | jq -r .access_token)"
101-
export ARTIFACTORY_USERNAME="github/${GITHUB_ACTOR}"
102-
set -x
103-
10498
# Maven deploy lifecycle will build, run tests, verify, sign, and deploy
105-
mvn deploy --batch-mode --settings .maven_settings.xml -P sign-artifacts
99+
mvn deploy --batch-mode --settings .maven_settings.xml -P sign-artifacts,ossrh
106100
env:
107101
SIGN_KEY_PASS: ${{ secrets.GPG_SECRET_PASSPHRASE }}
108102
SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}
103+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME_XYZ_BLOCK }}
104+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD_XYZ_BLOCK }}
109105

110106
- name: Upload coverage reports to Codecov
111107
uses: codecov/codecov-action@v5

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jobs:
7575
env:
7676
SIGN_KEY_PASS: ${{ secrets.GPG_SECRET_PASSPHRASE }}
7777
SIGN_KEY: ${{ secrets.GPG_SECRET_KEY }}
78-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
79-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
78+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME_XYZ_BLOCK }}
79+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD_XYZ_BLOCK }}
8080

8181
- name: Create GitHub Release
8282
uses: softprops/action-gh-release@v2

.maven_settings.xml

-20
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
11
<settings>
22
<servers>
3-
<server>
4-
<id>block-oss-releases</id>
5-
<username>${env.ARTIFACTORY_USERNAME}</username>
6-
<password>${env.ARTIFACTORY_PASSWORD}</password>
7-
</server>
8-
<server>
9-
<id>block-oss-snapshots</id>
10-
<username>${env.ARTIFACTORY_USERNAME}</username>
11-
<password>${env.ARTIFACTORY_PASSWORD}</password>
12-
</server>
13-
<server>
14-
<id>block-oss-releases</id>
15-
<username>${env.ARTIFACTORY_USERNAME}</username>
16-
<password>${env.ARTIFACTORY_PASSWORD}</password>
17-
</server>
18-
<server>
19-
<id>block-oss-snapshots</id>
20-
<username>${env.ARTIFACTORY_USERNAME}</username>
21-
<password>${env.ARTIFACTORY_PASSWORD}</password>
22-
</server>
233
<server>
244
<id>ossrh-snapshots</id>
255
<username>${env.SONATYPE_USERNAME}</username>

pom.xml

+1-18
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
<distributionManagement>
450450
<snapshotRepository>
451451
<id>ossrh-snapshots</id>
452-
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
452+
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
453453
</snapshotRepository>
454454
<!-- Sonatype's OSSRH - replicates to Maven Central within 30min of publish -->
455455
<repository>
@@ -460,23 +460,6 @@
460460
</profile>
461461
</profiles>
462462

463-
<distributionManagement>
464-
<repository>
465-
<uniqueVersion>false</uniqueVersion>
466-
<id>block-oss-releases</id>
467-
<name>Block OSS Releases Repository</name>
468-
<url>https://blockxyz.jfrog.io/artifactory/block-oss-releases-maven2</url>
469-
<layout>default</layout>
470-
</repository>
471-
<snapshotRepository>
472-
<uniqueVersion>false</uniqueVersion>
473-
<id>block-oss-snapshots</id>
474-
<name>Block OSS Snapshots Repository</name>
475-
<url>https://blockxyz.jfrog.io/artifactory/block-oss-snapshots-maven2</url>
476-
<layout>default</layout>
477-
</snapshotRepository>
478-
</distributionManagement>
479-
480463
<repositories>
481464
<repository>
482465
<id>block-oss-thirdparty</id>

0 commit comments

Comments
 (0)