-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (58 loc) · 1.85 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build
on:
workflow_call:
inputs:
java-version:
description: Version of the JDK to use to run the Gradle command.
required: false
default: '17'
type: string
distribution:
description: Distribution of the JDK to use to run the Gradle command.
required: false
default: 'temurin'
type: string
runs-on:
description: GitHub Actions runner to run the build task on.
required: false
default: 'ubuntu-latest'
type: string
outputs:
should-deploy-artifacts:
description: Whether artifacts should be deployed.
value: ${{ jobs.build.outputs.should-deploy-artifacts }}
secrets:
ARTIFACTORY_USERNAME:
required: false
ARTIFACTORY_PASSWORD:
required: false
DEVELOCITY_ACCESS_KEY:
required: false
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
jobs:
build:
name: Build
runs-on: ${{ inputs.runs-on }}
outputs:
should-deploy-artifacts: ${{ steps.should-deploy-artifacts.outputs.result }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ inputs.java-version }}
uses: spring-io/spring-gradle-build-action@v2
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.distribution }}
- name: Build with Gradle
run: ./gradlew build --continue
- id: should-deploy-artifacts
name: Check Deploy Artifacts using Secrets
if: ${{ runner.os == 'Linux' }}
run: |
if [[ -z "$ARTIFACTORY_PASSWORD" ]] ; then
echo "result=false" >> $GITHUB_OUTPUT
else
echo "result=true" >> $GITHUB_OUTPUT
fi