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
8 changes: 7 additions & 1 deletion .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
<settings>
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.