Skip to content

Commit

Permalink
fix(ci): run spotless before the version updates are committed
Browse files Browse the repository at this point in the history
The release plugin updates the versions in our pom files. This update will break the formatting that we have configured in spotless. As a result, when we'd like to merge the release branch back to the main branch, we manually need to run spotless:apply in order to restore the formatting.

We can add a completion goal to the release plugin. This parameter will:

"Goals to run on completion of the preparation step, after transformation back to the next development version but before committing. Space delimited."

This means it will execute spotless:apply once the release plugin has updated the versions to the next development version, but before the commit is made. Making the correct format part of the release commit.

In order to make sure the spotless:apply is not getting skipped due to the skipChecks property we explicitly need to set the spotless.apply.skip property to false.

(cherry picked from commit 502f7fc)
  • Loading branch information
remcowesterhoud authored and github-actions[bot] committed Nov 29, 2022
1 parent 8584d58 commit 2f5effd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .ci/scripts/release/maven-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ mvn -s ${MAVEN_SETTINGS_XML} release:prepare release:perform -B \
-DpushChanges=${PUSH_CHANGES} \
-DremoteTagging=${PUSH_CHANGES} \
-DlocalCheckout=${SKIP_DEPLOY} \
-DcompletionGoals="spotless:apply" \
-P!autoFormat \
-Darguments='--settings=${MAVEN_SETTINGS_XML} -P-autoFormat -DskipChecks=true -DskipTests=true -Dgpg.passphrase="${GPG_PASS}" -Dskip.central.release=${SKIP_DEPLOY} -Dskip.camunda.release=${SKIP_DEPLOY} -Dzbctl.force -Dzbctl.rootDir=${ZBCTL_ROOT_DIR}'
-Darguments='--settings=${MAVEN_SETTINGS_XML} -P-autoFormat -DskipChecks=true -DskipTests=true -Dspotless.apply.skip=false -Dgpg.passphrase="${GPG_PASS}" -Dskip.central.release=${SKIP_DEPLOY} -Dskip.camunda.release=${SKIP_DEPLOY} -Dzbctl.force -Dzbctl.rootDir=${ZBCTL_ROOT_DIR}'

0 comments on commit 2f5effd

Please sign in to comment.