diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 8bf4c60..fa31f37 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -11,6 +11,11 @@ name: maven-release # version, then creates the tag and the GitHub release. on: workflow_call: + inputs: + maven-args: + description: Extra arguments for the publishing build, such as a switch that skips tests needing services the runner lacks + type: string + default: '' secrets: CENTRAL_USERNAME: required: true @@ -113,6 +118,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} CENTRAL_DONE: ${{ steps.check.outputs.central }} GITHUB_DONE: ${{ steps.check.outputs.github }} + ARGS: ${{ inputs.maven-args }} run: | cat > "$RUNNER_TEMP/settings.xml" <<'EOF' @@ -138,7 +144,7 @@ jobs: [ "$GITHUB_DONE" = false ] && goals="$goals deploy:deploy -DaltDeploymentRepository=github::https://maven.pkg.github.com/$GITHUB_REPOSITORY" # Central can take longer than the plugin's default 30-minute wait - ./mvnw -B -ntp -s "$RUNNER_TEMP/settings.xml" -Ppublish -Dgpg.signer=bc -DwaitMaxTime=3600 $goals + ./mvnw -B -ntp -s "$RUNNER_TEMP/settings.xml" -Ppublish -Dgpg.signer=bc -DwaitMaxTime=3600 $ARGS $goals - name: Tag and create the GitHub release env: diff --git a/README.md b/README.md index 24e31cd..8f7e568 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,5 @@ jobs: ``` A release is a pull request titled `Release X.Y.Z` that sets that version in `pom.xml` and adds a `## [X.Y.Z] - YYYY-MM-DD` section to `CHANGELOG.md`. Merging it publishes the release to Maven Central and to GitHub Packages. Maven Central is where users get the library; GitHub Packages requires a token even to download public packages. The library also needs the Maven Wrapper (`./mvnw`) and access to the four release secrets, which are organization secrets limited to selected repositories. + +Both shared workflows take an optional `maven-args` input, set with `with:` under the calling job. In `maven-build.yml` it replaces `verify`; in `maven-release.yml` it adds arguments to the publishing build. A library whose tests need a service the runner does not have, such as a Redis server, uses it to skip those tests in both.