diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 43e9494e..0e35797d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 38ae1a4a..26df5fc5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 diff --git a/etc/build-and-releases.adoc b/etc/build-and-releases.adoc new file mode 100644 index 00000000..d82475b1 --- /dev/null +++ b/etc/build-and-releases.adoc @@ -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. diff --git a/pom.xml b/pom.xml index ca5296b8..1c67c742 100644 --- a/pom.xml +++ b/pom.xml @@ -206,6 +206,9 @@ limitations under the License. + + ${env.GPG_PASSPHRASE} + diff --git a/spring-modulith-events/spring-modulith-events-jackson/pom.xml b/spring-modulith-events/spring-modulith-events-jackson/pom.xml index 0b7d1b91..9ff8fc19 100644 --- a/spring-modulith-events/spring-modulith-events-jackson/pom.xml +++ b/spring-modulith-events/spring-modulith-events-jackson/pom.xml @@ -14,7 +14,6 @@ org.springframework.modulith.events.jackson - @@ -33,4 +32,4 @@ - \ No newline at end of file + diff --git a/spring-modulith-events/spring-modulith-events-jdbc/pom.xml b/spring-modulith-events/spring-modulith-events-jdbc/pom.xml index c5edc4fb..648841a6 100644 --- a/spring-modulith-events/spring-modulith-events-jdbc/pom.xml +++ b/spring-modulith-events/spring-modulith-events-jdbc/pom.xml @@ -35,7 +35,7 @@ spring-modulith-events-core ${project.version} - + org.springframework spring-jdbc @@ -61,7 +61,7 @@ - + org.testcontainers testcontainers