forked from QuestNav/QuestNav
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.89 KB
/
reusable-build-java.yml
File metadata and controls
66 lines (58 loc) · 1.89 KB
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
62
63
64
65
66
name: Build Java
on:
workflow_call:
inputs:
version:
description: 'Version string to use (optional, auto-generated if not provided)'
required: false
type: string
outputs:
version:
description: 'The version string used for this build'
value: ${{ jobs.build.outputs.version }}
artifact-id:
description: 'The artifact ID for the JAR'
value: ${{ jobs.build.outputs.artifact-id }}
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: questnav-lib
outputs:
version: ${{ steps.version-info.outputs.version }}
artifact-id: ${{ steps.upload-jar.outputs.artifact-id }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
sparse-checkout: |
questnav-lib
.github
sparse-checkout-cone-mode: false
- name: Determine Version
id: version-info
uses: ./.github/actions/determine-version
with:
version: ${{ inputs.version }}
- name: Setup Java and Gradle
uses: ./.github/actions/setup-java-gradle
with:
version: ${{ steps.version-info.outputs.version }}
working-directory: questnav-lib
cache-key-prefix: gradle-lib
- name: Build Library
run: |
./gradlew build \
-Pversion="${{ steps.version-info.outputs.version }}" \
-PversionType="${{ steps.version-info.outputs.version-type }}"
- name: Upload JAR Artifact
id: upload-jar
uses: actions/upload-artifact@v4
with:
name: questnav-jar-${{ steps.version-info.outputs.version }}
path: questnav-lib/build/libs/*.jar
retention-days: 7