Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 3.55 KB

File metadata and controls

102 lines (75 loc) · 3.55 KB

Problem4J Workflows

Reusable GitHub Actions workflows shared across all problem4j repositories.

Table of Contents

Workflows

gradle-build.yml

See workflow - link.

Builds the project with Gradle across multiple Java versions.

Input Type Required Default Description
java-version number no 25 Java version to build with (e.g. 17, 21, 25).

Usage:

jobs:
  build:
    name: Build (Java ${{ inputs.java-version }})
    strategy:
      fail-fast: false
      matrix:
        java: [17, 21, 25]
    uses: problem4j/problem4j-workflows/.github/workflows/gradle-build.yml@main
    with:
      java-version: ${{ matrix.java }}

gradle-dependency-submission.yml

See workflow - link.

Generates and submits the Gradle dependency graph to GitHub for dependency review and Dependabot alerts.

Input Type Required Default Description
java-version number no 25 Java version to use.

Usage:

jobs:
  dependency-submission:
    name: Dependency Submission
    permissions:
      contents: write
    uses: problem4j/problem4j-workflows/.github/workflows/gradle-dependency-submission.yml@main

gradle-publish-release.yml

See workflow - link.

Publishes a release to Maven Central using the nmcp Gradle plugin. Triggered by a version tag push; extracts the version from the tag name (strips the leading v).

Input Type Required Default Description
java-version number no 25 Java version to use.
publish-task string yes Gradle publish task to run.
Secret Required Description
SIGNING_KEY yes GPG signing key
SIGNING_PASSWORD yes GPG signing password
PUBLISHING_USERNAME yes Maven Central (Sonatype) tokenized username
PUBLISHING_PASSWORD yes Maven Central (Sonatype) tokenized password

The publish-task depends on the repository structure:

  • Single-module repositories use publishAllPublicationsToCentralPortal (e.g. problem4j-core).
  • Multi-module repositories with an aggregation publication use publishAggregationToCentralPortal (e.g. problem4j-spring).

Usage:

jobs:
  publish-release:
    name: Publish Release
    uses: problem4j/problem4j-workflows/.github/workflows/gradle-publish-release.yml@main
    with:
      publish-task: publishAllPublicationsToCentralPortal
    secrets: inherit

Setting secrets: inherit forwards all secrets from the calling workflow to the reusable workflow automatically, without mapping each one individually.