-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Maven Build | ||
description: Run a Maven Build | ||
|
||
inputs: | ||
build-command: | ||
description: The Maven command to build the project. The default is `package`. | ||
required: false | ||
# type: string - `type` field is not supported (yet). See comment below. | ||
default: package | ||
run-tests: | ||
description: Whether or not to run tests. The default is true. | ||
required: false | ||
# type: boolean - This is not supported (yet). All inputs are of type `string`. See https://github.com/actions/runner/issues/2238. | ||
default: 'true' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up JDK 17 for x64 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
architecture: x64 | ||
cache: maven | ||
server-id: ossrh | ||
server-username: CI_DEPLOY_USERNAME | ||
server-password: CI_DEPLOY_PASSWORD | ||
- name: Build with Maven | ||
shell: bash | ||
run: mvn -B -U clean ${{ inputs.build-command }}${{ inputs.run-tests == 'false' && ' -DskipTests' || '' }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Normalize branch name" | ||
description: "Normalizes the branch name" | ||
inputs: | ||
branch: | ||
description: "Branch name to normalize. Defaults to $GITHUB_HEAD_REF" | ||
required: false | ||
outputs: | ||
normalized: | ||
description: "Normalized branch name" | ||
runs: | ||
using: "node12" | ||
main: "index.js" | ||
branding: | ||
icon: 'terminal' | ||
color: 'green' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const core = require("@actions/core"); | ||
try { | ||
const input = core.getInput("branch") ? core.getInput("branch") : process.env.GITHUB_HEAD_REF ? process.env.GITHUB_HEAD_REF : process.env.GITHUB_REF ? process.env.GITHUB_REF.replace("refs/heads/", "") : null; | ||
if (!input) { | ||
throw new Error("No branch was found."); | ||
} | ||
let output = input | ||
.trim() | ||
.toLowerCase() | ||
.replace(/([^0-9a-zA-Z-]+)/g, "-"); | ||
core.setOutput("normalized", output); | ||
if (output.charAt(output.length - 1) == '-') { | ||
output = output.substring(0, output.length - 1); | ||
} | ||
} catch (err) { | ||
core.setFailed(err); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.