Skip to content

Commit f476a06

Browse files
authored
Fixes Github Actions (#10)
Signed-off-by: Laird Nelson <[email protected]>
1 parent 1823e82 commit f476a06

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

.github/workflows/mvn-release-prepare-perform.yaml

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ jobs:
3939
java-version: '25'
4040
mvn-toolchain-id: 'Temurin 25'
4141
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
42-
server-id: 'sonatype-oss-repository-hosting' # see https://github.com/microbean/microbean-parent/blob/master/pom.xml#L38
43-
server-password: 'SONATYPE_OSSRH_PASSWORD'
44-
server-username: 'SONATYPE_OSSRH_USERNAME'
42+
server-id: 'central.sonatype.com'
43+
server-password: 'CENTRAL_SONATYPE_COM_PASSWORD'
44+
server-username: 'CENTRAL_SONATYPE_COM_USERNAME'
4545
- id: 'setup-askpass'
4646
name: 'Step: Set Up GIT_ASKPASS'
4747
run: |
@@ -58,29 +58,28 @@ jobs:
5858
- id: 'mvn-release-prepare'
5959
name: 'Step: Maven Release: Prepare, Perform and Publish Site'
6060
env:
61+
CENTRAL_SONATYPE_COM_PASSWORD: '${{ secrets.CENTRAL_SONATYPE_COM_PASSWORD }}'
62+
CENTRAL_SONATYPE_COM_USERNAME: '${{ secrets.CENTRAL_SONATYPE_COM_USERNAME }}'
6163
DRY_RUN: '${{ inputs.dryRun }}'
6264
GIT_ASKPASS: '${{ runner.temp }}/.askpass'
6365
GPG_PASSPHRASE: '${{ secrets.GPG_PASSPHRASE }}'
6466
MVN_DEBUG: ${{ inputs.mvnDebug && '--debug' || '' }}
6567
MVN_TRANSFER_LOGGING: ${{ inputs.mvnTransferLogging && '' || '--no-transfer-progress' }}
6668
PUSH_TOKEN : '${{ secrets.PUSH_TOKEN }}' # critical; see ${GIT_ASKPASS} file
6769
SCM_GIT_HTTPS_URL: 'scm:git:${{ github.server_url }}/${{ github.repository }}.git'
68-
SONATYPE_OSSRH_PASSWORD: '${{ secrets.SONATYPE_OSSRH_PASSWORD }}'
69-
SONATYPE_OSSRH_STAGING_PROFILE_ID: '${{ vars.SONATYPE_OSSRH_STAGING_PROFILE_ID }}'
70-
SONATYPE_OSSRH_USERNAME: '${{ secrets.SONATYPE_OSSRH_USERNAME }}'
7170
shell: 'bash -e {0}'
7271
run: >
7372
git config --global user.email '[email protected]'
7473
7574
git config --global user.name 'microbean'
7675
7776
echo "::group::Running mvn prepare"
78-
77+
7978
./mvnw --batch-mode ${MVN_DEBUG} --errors ${MVN_TRANSFER_LOGGING} release:prepare
8079
-DdryRun="${DRY_RUN}"
8180
-Darguments="${MVN_TRANSFER_LOGGING}"
8281
-Dscm.url="${SCM_GIT_HTTPS_URL}"
83-
82+
8483
scm_tag="$(grep '^scm.tag=' release.properties | cut -f 2 -d =)"
8584
8685
echo "Prepared ${scm_tag}" >> "${GITHUB_STEP_SUMMARY}"
@@ -90,37 +89,13 @@ jobs:
9089
echo "::endgroup::"
9190
9291
echo "::group::Running mvn perform"
93-
94-
set +e
9592
96-
{
9793
./mvnw --batch-mode ${MVN_DEBUG} --errors ${MVN_TRANSFER_LOGGING} release:perform
98-
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DstagingProfileId=${SONATYPE_OSSRH_STAGING_PROFILE_ID}"
94+
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DautoPublish=true -DwaitUntil=published -DwaitMaxTime=3600"
9995
-DdryRun="${DRY_RUN}"
10096
-Dgoals="process-classes,post-site,scm-publish:publish-scm,deploy"
10197
-Dscm.url="${SCM_GIT_HTTPS_URL}"
102-
|
103-
tee /dev/fd/3
104-
|
105-
grep --invert-match --silent 'Java class com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO' || cat > /dev/null
106-
;
107-
}
108-
3>&1
10998
110-
exit_codes=(${PIPESTATUS[@]})
99+
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";
111100
112101
echo "::endgroup::"
113-
114-
set -e
115-
116-
if [ "${exit_codes[2]}" -ne 0 ] ; then
117-
# grep "failed" (found com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO) and mvn failed
118-
echo "Released ${scm_tag} successfully, but verify that the staging repository was successfully released" >> "${GITHUB_STEP_SUMMARY}";
119-
# Treat this as a successful run
120-
exit 0;
121-
elif [ "${exit_codes[0]}" -eq 0 ] ; then
122-
# mvn succeeded and grep "succeeded" (did not find com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO)
123-
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";
124-
fi
125-
126-
exit "${exit_codes[0]}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependency:
2727
<groupId>org.microbean</groupId>
2828
<artifactId>microbean-scopelet</artifactId>
2929
<!-- Always check https://search.maven.org/artifact/org.microbean/microbean-scopelet for up-to-date available versions. -->
30-
<version>0.0.9</version>
30+
<version>0.0.11</version>
3131
</dependency>
3232
```
3333

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.microbean</groupId>
66
<artifactId>microbean-scopelet</artifactId>
7-
<version>0.0.10-SNAPSHOT</version>
7+
<version>0.0.11-SNAPSHOT</version>
88

99
<name>microBean™ Scopelet</name>
1010
<description>microBean™ Scopelet: Utility classes for implementing scopelets.</description>

0 commit comments

Comments
 (0)