Central repo for re-using actions across all other projects.
This repo contains the following reusable workflows that can be accessed from other repos.
The <version> referenced below can be a SHA, a release tag, or a branch name. Using a release tag is preferred to avoid accidentally running breaking changes.
A reusable standardised Java workflow to automate testing, dependency patching, and release publishing. This workflow calls the following workflows within this repo:
- Build with Gradle
- Dependabot Auto-Merge
In addition, it defines and runs a job for publishing the project as a package to Maven Central; this is only done when pushing to master, after first getting the correct tag/version for the project in question.
| Name | Description | Required | Type | Default |
|---|---|---|---|---|
os |
A JSON string containing the list of operating systems to run Gradle build on. | false |
string |
'["ubuntu-latest"]' |
java_version |
The JDK version to use. | false |
string |
21 |
The following secrets must be passed to this workflow:
GITHUB_TOKEN
NOTE: Its easiest to use @master for the version unless you really need to be explicit.
name: Java Workflow
on: [push, pull_request]
jobs:
call-java-workflow:
uses: brightsparklabs/github-actions/.github/workflows/java.yml@<version>
# Since all of our workflows are called from the same organisation, we can use the `inherit`
# keyword to pass secrets to the called workflow.
secrets: inherit
# These permissions are required for Dependabot to merge PRs.
permissions:
contents: write
pull-requests: writeBy default:
./gradlew buildwill run on theosspecified in the table above. Multiple operating systems can be specified using a matrix.- JDK version used for the build is
java_versionin the table above. This can be explicitly overridden with the input:
jobs:
call-java-workflow:
uses: brightsparklabs/github-actions/.github/workflows/java.yml@<version>
secrets: inherit
permissions:
contents: write
pull-requests: write
with:
os: '["ubuntu-latest", "windows-latest"]'
java_version: 25A reusable Gradle build workflow for testing for breaking changes.
Runs ./gradlew build using the specified JDK version (defaults to 17).
| Name | Description | Required | Type | Default |
|---|---|---|---|---|
os |
The operating system to run the Gradle build on. | false |
string |
ubuntu-latest |
java_version |
The JDK version to use for executing the gradle build. | false |
string |
21 |
No secrets need to be passed to this workflow.
# exmaple-repo/.github/workflows/test.yml
name: Test
on: [push, workflow_call]
jobs:
call-test-gradle-build-workflow:
uses: brightsparklabs/github-actions/.github/workflows/test-gradle-build.yml@<version>By default:
./gradlew buildwill run on theosspecified in the table above. Multiple operating systems can be specified using a matrix.- JDK version used for the build is
java_versionin the table above. This can be explicitly overridden with the input:
jobs:
call-test-gradle-build-workflow:
strategy:
matrix:
# Test on the following operating systems.
os:
- ubuntu-latest
- windows-latest
uses: brightsparklabs/github-actions/.github/workflows/test-gradle-build.yml@<version>
with:
os: ${{ matrix.os }}
java_version: 25A reusable Dependabot auto-merge workflow for merging patch and minor updates. Pull requests will still be created for major updates, however they will need to be merged manually.
This workflow has no inputs.
The following secrets must be passed to this workflow:
GITHUB_TOKEN
# exmaple-repo/.github/workflows/dependabot-test-and-auto-merge.yml
name: Dependabot test and auto-merge
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
call-test-workflow:
# Run the locally defined reusable test workflow.
uses: ./.github/workflows/test.yml
call-dependabot-auto-merge-workflow:
# Specify that this job should only run if the test job succeeds.
needs: call-test-workflow
uses: brightsparklabs/github-actions/.github/workflows/dependabot-auto-merge.yml@<version>
secrets: inheritA reusable standardised Gradle workflow to automate testing, dependency patching, and release publishing. This workflow calls the following workflows within this repo:
- Build with Gradle
- Dependabot Auto-Merge
In addition, it defines and runs a job for publishing gradle plugins when pushing to master, after first getting the correct tag/version for the project in question.
| Name | Description | Required | Type | Default |
|---|---|---|---|---|
os |
A JSON string containing the list of operating systems to run Gradle build on. | false |
string |
'["ubuntu-latest"]' |
java_version |
The JDK version to use. | false |
string |
21 |
The following secrets must be passed to this workflow:
GITHUB_TOKEN
NOTE: Its easiest to use @master for the version unless you really need to be explicit.
name: Gradle Plugins Workflow
on: [push, pull_request]
jobs:
call-gradle-plugins-workflow:
uses: brightsparklabs/github-actions/.github/workflows/gradle-plugins.yml@<version>
secrets: inherit
# These permissions are required for Dependabot to merge PRs.
permissions:
contents: write
pull-requests: writeBy default:
./gradlew buildwill run on theosspecified in the table above. Multiple operating systems can be specified using a matrix.- JDK version used for the build is
java_versionin the table above. This can be explicitly overridden with the input:
jobs:
call-gradle-plugins-workflow:
uses: brightsparklabs/github-actions/.github/workflows/gradle-plugins.yml@<version>
secrets: inherit
permissions:
contents: write
pull-requests: write
with:
os: '["ubuntu-latest", "windows-latest"]'
java_version: 25