-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 2.36 KB
/
maven-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
name: Build
on:
workflow_call:
inputs:
jdk:
type: number
default: 11
goals:
type: string
default: 'clean package'
secrets:
PACKAGES_TOKEN:
required: true
ORIGIN_PACKAGES_TOKEN:
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
overwrite-settings: false
java-version: ${{ inputs.jdk }}
- name: Configure Maven
run: |
mkdir -p ~/.m2
echo "<settings>
<servers>
<server><id>github</id><username>x-access-token</username><password>${{ secrets.GITHUB_TOKEN }}</password></server>
<server><id>github-dkk-v2</id><username>x-access-token</username><password>${{ secrets.PACKAGES_TOKEN }}</password></server>
<server><id>github-dkk-okonomi</id><username>x-access-token</username><password>${{ secrets.PACKAGES_TOKEN }}</password></server>
<server><id>github-dkk-google-recaptcha</id><username>x-access-token</username><password>${{ secrets.PACKAGES_TOKEN }}</password></server>
<server><id>github-dkk-smartsend</id><username>x-access-token</username><password>${{ secrets.PACKAGES_TOKEN }}</password></server>
<server><id>github-origin-legacy</id><username>x-access-token</username><password>${{ secrets.ORIGIN_PACKAGES_TOKEN }}</password></server>
<server><id>github-origin-gt-legacy</id><username>x-access-token</username><password>${{ secrets.ORIGIN_PACKAGES_TOKEN }}</password></server>
<server><id>github-origin-seamless-mail</id><username>x-access-token</username><password>${{ secrets.ORIGIN_PACKAGES_TOKEN }}</password></server>
<server><id>github-origin-seamless-email</id><username>x-access-token</username><password>${{ secrets.ORIGIN_PACKAGES_TOKEN }}</password></server>
</servers>
</settings>" > ~/.m2/settings.xml
- name: Cache maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B ${{ inputs.goals }} --file pom.xml