Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 11 additions & 36 deletions .github/workflows/mvn-release-prepare-perform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
distribution: 'temurin'
gpg-passphrase: 'GPG_PASSPHRASE'
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}'
java-version: '23'
mvn-toolchain-id: 'Temurin 23'
java-version: '24'
mvn-toolchain-id: 'Temurin 24'
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
server-id: 'sonatype-oss-repository-hosting' # see https://github.com/microbean/microbean-parent/blob/master/pom.xml#L38
server-password: 'SONATYPE_OSSRH_PASSWORD'
server-username: 'SONATYPE_OSSRH_USERNAME'
server-id: 'central.sonatype.com'
server-password: 'CENTRAL_SONATYPE_COM_PASSWORD'
server-username: 'CENTRAL_SONATYPE_COM_USERNAME'
- id: 'setup-askpass'
name: 'Step: Set Up GIT_ASKPASS'
run: |
Expand All @@ -58,29 +58,28 @@ jobs:
- id: 'mvn-release-prepare'
name: 'Step: Maven Release: Prepare, Perform and Publish Site'
env:
CENTRAL_SONATYPE_COM_PASSWORD: '${{ secrets.CENTRAL_SONATYPE_COM_PASSWORD }}'
CENTRAL_SONATYPE_COM_USERNAME: '${{ secrets.CENTRAL_SONATYPE_COM_USERNAME }}'
DRY_RUN: '${{ inputs.dryRun }}'
GIT_ASKPASS: '${{ runner.temp }}/.askpass'
GPG_PASSPHRASE: '${{ secrets.GPG_PASSPHRASE }}'
MVN_DEBUG: ${{ inputs.mvnDebug && '--debug' || '' }}
MVN_TRANSFER_LOGGING: ${{ inputs.mvnTransferLogging && '' || '--no-transfer-progress' }}
PUSH_TOKEN : '${{ secrets.PUSH_TOKEN }}' # critical; see ${GIT_ASKPASS} file
SCM_GIT_HTTPS_URL: 'scm:git:${{ github.server_url }}/${{ github.repository }}.git'
SONATYPE_OSSRH_PASSWORD: '${{ secrets.SONATYPE_OSSRH_PASSWORD }}'
SONATYPE_OSSRH_STAGING_PROFILE_ID: '${{ vars.SONATYPE_OSSRH_STAGING_PROFILE_ID }}'
SONATYPE_OSSRH_USERNAME: '${{ secrets.SONATYPE_OSSRH_USERNAME }}'
shell: 'bash -e {0}'
run: >
git config --global user.email '[email protected]'

git config --global user.name 'microbean'

echo "::group::Running mvn prepare"

./mvnw --batch-mode ${MVN_DEBUG} --errors ${MVN_TRANSFER_LOGGING} release:prepare
-DdryRun="${DRY_RUN}"
-Darguments="${MVN_TRANSFER_LOGGING}"
-Dscm.url="${SCM_GIT_HTTPS_URL}"

scm_tag="$(grep '^scm.tag=' release.properties | cut -f 2 -d =)"

echo "Prepared ${scm_tag}" >> "${GITHUB_STEP_SUMMARY}"
Expand All @@ -90,37 +89,13 @@ jobs:
echo "::endgroup::"

echo "::group::Running mvn perform"

set +e

{
./mvnw --batch-mode ${MVN_DEBUG} --errors ${MVN_TRANSFER_LOGGING} release:perform
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DstagingProfileId=${SONATYPE_OSSRH_STAGING_PROFILE_ID}"
-Darguments="${MVN_TRANSFER_LOGGING} -Dscmpublish.dryRun=${DRY_RUN} -Dscmpublish.pubScmUrl=${SCM_GIT_HTTPS_URL} -DskipTests -DautoPublish=true -DwaitUntil=published -DwaitMaxTime=3600"
-DdryRun="${DRY_RUN}"
-Dgoals="process-classes,post-site,scm-publish:publish-scm,deploy"
-Dscm.url="${SCM_GIT_HTTPS_URL}"
|
tee /dev/fd/3
|
grep --invert-match --silent 'Java class com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO' || cat > /dev/null
;
}
3>&1

exit_codes=(${PIPESTATUS[@]})
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";

echo "::endgroup::"

set -e

if [ "${exit_codes[2]}" -ne 0 ] ; then
# grep "failed" (found com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO) and mvn failed
echo "Released ${scm_tag} successfully, but verify that the staging repository was successfully released" >> "${GITHUB_STEP_SUMMARY}";
# Treat this as a successful run
exit 0;
elif [ "${exit_codes[0]}" -eq 0 ] ; then
# mvn succeeded and grep "succeeded" (did not find com.sonatype.nexus.staging.api.dto.StagingProfileRepositoryDTO)
echo "Released ${scm_tag} successfully" >> "${GITHUB_STEP_SUMMARY}";
fi

exit "${exit_codes[0]}"
4 changes: 2 additions & 2 deletions .github/workflows/mvn-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
with:
cache: 'maven'
distribution: 'temurin'
java-version: '23'
mvn-toolchain-id: 'Temurin 23'
java-version: '24'
mvn-toolchain-id: 'Temurin 24'
mvn-toolchain-vendor: 'openjdk' # see ../../pom.xml
- id: 'mvn-verify'
name: 'Step: Maven Verify'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependency:
<groupId>org.microbean</groupId>
<artifactId>microbean-assign</artifactId>
<!-- Always check https://search.maven.org/artifact/org.microbean/microbean-bean for up-to-date available versions. -->
<version>0.0.6</version>
<version>0.0.7</version>
</dependency>
```

Expand Down
54 changes: 14 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,11 @@
</issueManagement>

<distributionManagement>
<repository>
<id>sonatype-oss-repository-hosting</id>
<!-- See https://central.sonatype.org/publish/publish-maven/#distribution-management-and-authentication -->
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<site>
<id>Github Pages</id>
<name>microBean™ Assign Site</name>
<url>https://microbean.github.io/microbean-assign/</url>
</site>
<snapshotRepository>
<id>sonatype-oss-repository-hosting</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<properties>
Expand All @@ -89,7 +80,6 @@
<releaseProfiles>deployment</releaseProfiles>
<scmCommentPrefix>[maven-release-plugin] [skip ci]</scmCommentPrefix>
<tagNameFormat>v@{project.version}</tagNameFormat>
<useReleaseProfile>false</useReleaseProfile>

<!-- maven-scm-publish-plugin properties;
see https://maven.apache.org/plugins/maven-scm-publish-plugin/publish-scm-mojo.html -->
Expand All @@ -101,12 +91,8 @@
<maven.site.deploy.skip>true</maven.site.deploy.skip>
<relativizeDecorationLinks>false</relativizeDecorationLinks>

<!-- nexus-staging-maven-plugin properties -->
<!-- See https://github.com/sonatype/nexus-maven-plugins/blob/0aee3defb33cb133ff536aba59b11d32a368b1e6/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L169-L175 -->
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<!-- <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl> -->
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
<!-- central-publishing-maven-plugin properties -->
<deploymentName>${project.name} v${project.version}</deploymentName>

<!-- Other properties -->
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
Expand All @@ -125,7 +111,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.13.1</version>
<version>5.13.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -135,19 +121,19 @@
<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-attributes</artifactId>
<version>0.0.3</version>
<version>0.0.5</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-constant</artifactId>
<version>0.0.7</version>
<version>0.0.8</version>
</dependency>

<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-construct</artifactId>
<version>0.0.11</version>
<version>0.0.15</version>
</dependency>

</dependencies>
Expand Down Expand Up @@ -314,7 +300,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.12.6</version>
<version>10.26.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -357,7 +343,6 @@
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<!-- <version>3.1.0</version> -->
<version>3.2.7</version>
</plugin>
<plugin>
Expand Down Expand Up @@ -402,7 +387,6 @@
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<!-- <version>3.0.0-M6</version> --> <!-- see https://issues.apache.org/jira/browse/MRELEASE-1038 -->
<version>3.1.1</version>
</plugin>
<plugin>
Expand Down Expand Up @@ -444,7 +428,7 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.9.3.0</version>
<version>4.9.3.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand All @@ -457,22 +441,12 @@
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<dependencies>
<!-- https://issues.sonatype.org/browse/NEXUS-26993?focusedCommentId=1098136&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1098136 -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.20</version>
</dependency>
</dependencies>
<configuration>
<serverId>sonatype-oss-repository-hosting</serverId>
<nexusUrl>${nexusUrl}</nexusUrl>
<autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose>
<publishingServerId>central.sonatype.com</publishingServerId>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -518,8 +492,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>

Expand Down
2 changes: 1 addition & 1 deletion src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</skin>
<body>
<menu name="Documentation">
Expand Down