-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (75 loc) · 2.03 KB
/
call-gradle.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
workflow_call:
inputs:
workdir:
required: false
default: "./"
type: "string"
description: "Specify all of gradle steps where are run"
outputs:
version:
value: ${{ jobs.build.outputs.version }}
description: "major version"
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.workdir }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: setup-gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- name: build and test
run: gradle clean build
env:
GPR_USER: ${{ secrets.user }}
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
needs: [lint]
outputs:
project: ${{ steps.environments.outputs.project }}
version: ${{ steps.environments.outputs.version }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.workdir }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: setup-gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
- id: environments
name: environments
run: |
echo "
project=$(gradle name -q | awk 'NR==1 {print}')
version=$(gradle version -q | awk 'NR==1 {print}')
" >> "$GITHUB_OUTPUT"
shell: bash
- name: build and test
run: gradle clean build
env:
GPR_USER: ${{ secrets.user }}
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: upload targets
uses: actions/upload-artifact@v4
with:
name: targets
path: |
${{ inputs.workdir }}build/