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
13 changes: 9 additions & 4 deletions mavenbuild/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@ name: "Maven Build"
description: "Build Maven Project to jar packege and upload artifact"

inputs:
override-properties:
description: "Value of override properties"
default: "false"
required: false
application-properties:
description: "Value of application properties from secrets"
required: false
path:
description: "Path of Maven Project, default ./"
required: false
java-version:
description: 'The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file, default `21`'
description: "The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file, default `21`"
default: "21"
required: false
distribution:
description: 'Java distribution. See the list of supported distributions in README file, default `temurin`'
description: "Java distribution. See the list of supported distributions in README file, default `temurin`"
default: "temurin"
required: false
retention-days:
description: >
Duration after which artifact will expire in days. 0 means using default retention.
Minimum 1 day.
Maximum 90 days unless changed from the repository settings page.
default: "30"
default: "7"
required: false

runs:
using: "composite"
steps:
steps:
- name: Using Java ${{ inputs.java-version }} ${{ inputs.distribution }}
uses: actions/setup-java@v4.7.0
with:
Expand All @@ -38,6 +42,7 @@ runs:
env:
WORK_DIR: ${{ inputs.path }}
APPLICATION_PROPERTIES: ${{ inputs.application-properties }}
OVERRIDE_PROPERTIES: ${{ inputs.override-properties }}
run: $GITHUB_ACTION_PATH/mavenbuild.sh

- uses: actions/upload-artifact@v4
Expand Down
5 changes: 5 additions & 0 deletions mavenbuild/mavenbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ override_config() {
cd $WORK_DIR
fi

if [[ "${OVERRIDE_PROPERTIES:-false}" != "true" ]]; then
echo "Skipping override_config karena OVERRIDE_PROPERTIES != true"
return
fi

if [[ -n "$APPLICATION_PROPERTIES" ]]; then
if [[ -f src/main/resources/application.properties ]]; then
echo "Rewrite application.properties"
Expand Down