GH-18 - Polishing.

Switch to consistent usage of secrets via environment variables. Remove documentation generation from standard build. Some general POM polishing. A bit of release documentation.
This commit is contained in:
Oliver Drotbohm
2022-07-28 08:45:51 +02:00
parent 0fdabdb9e6
commit 3ab5072e1e
6 changed files with 53 additions and 11 deletions

View File

@@ -31,9 +31,3 @@ jobs:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./mvnw -B clean deploy -Pci,artifactory
- name: Deploy documentation
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./mvnw -B clean deploy -Pdocumentation

View File

@@ -30,9 +30,10 @@ jobs:
env:
SONATYPE_USER: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./mvnw -B clean install -DskipTests
./mvnw -B clean deploy -Psonatype -s settings.xml -Dgpg.passphrase='${{ secrets.GPG_PASSPHRASE }}'
./mvnw -B clean deploy -Psonatype -s settings.xml
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1

View File

@@ -0,0 +1,45 @@
= Build and Releases
== Build profiles
* `ci` - Adds Javadoc creation (after delombokization of the source code)
* `artifactory` - Adds the Artifactory plugin to deploy artifacts to the Spring Artifactory server
** `env.ARTIFACTORY_USERNAME` -- the Artifactory username with deployment permissions
** `env.ARTIFACTORY_PASSWORD` -- the Artifactory password (needs to be encrypted itself, i.e. a token obtained via the web UI)
* `sonatype` -- adds GPG signing
** `env.GPG_PASSPHRASE` -- the GPG passphrase for the key to be used to sign the artifacts (usually just one deployed)
** `env.SONATYPE_USER` -- the username to authenticate with Sonatype's OSSRH Nexus (via `settings.xml`)
** `env.SONATYPE_PASSWORD` -- the password to authenticate with Sonatype's OSSRH Nexus (via `settings.xml`)
* `documentation` - Creates and packages the reference documentation for publication.
** `env.ARTIFACTORY_USERNAME` -- the Artifactory username with deployment permissions
** `env.ARTIFACTORY_PASSWORD` -- the Artifactory password (needs to be encrypted itself, i.e. a token obtained via the web UI)
== Workflows
* `build.yml` (`main`) -- Runs default build and deploys snapshots to Artifactory.
* `docs.yml` (every midnight) -- Runs documentation publication.
* `milestone.yml` (`release/milestone`) -- Runs Artifactory deployment of artifacts and documentation.
* `release.yml` (`release/release`) -- Runs Maven Central deployment of artifacts and Artifactory deployment of documentation.
== Release procedure
* On the version branch (`main`, `….x`) run:
+
[source]
----
./mvnw release:prepare \
-DreleaseVersion="${version}" \
-DdevelopmentVersion="${devVersion}" \
-DscmReleaseCommitComment="${ticketId} - Release version ${version}." \
-DscmDevelopmentCommitComment="${ticketId} - Prepare next development iteration." \
-Dtag="${version}"
----
* `git push && git push --tags`
* For milestones: `git checkout release/milestone`, for GA releases: `git checkout release/release`.
* `git reset --hard $version`
* `git push --force-with-lease` -- The `milestone.yml`/`release.yml` workflow will be triggered by the branches seeing a new commit and deploy to Artifactory / Maven Central.
* For GA releases, promote the https://s01.oss.sonatype.org/[release repository].
* Create release on GitHub. Generate https://github.com/spring-io/github-changelog-generator[changelog].
* Update project versions on https://spring.io/admin.

View File

@@ -206,6 +206,9 @@ limitations under the License.
</goals>
</execution>
</executions>
<configuration>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
</configuration>
</plugin>
</plugins>
</build>

View File

@@ -14,7 +14,6 @@
<properties>
<module.name>org.springframework.modulith.events.jackson</module.name>
</properties>
<dependencies>
@@ -33,4 +32,4 @@
</dependencies>
</project>
</project>

View File

@@ -35,7 +35,7 @@
<artifactId>spring-modulith-events-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
@@ -61,7 +61,7 @@
</dependency>
<!-- Testcontainers -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>