-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (147 loc) · 4.46 KB
/
bom-submodules.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: BOM Builder
on:
workflow_call:
inputs:
baseDir:
description: 'Base Directory with suffix /'
required: true
type: string
default: ''
name:
description: 'BOM Name'
required: true
type: string
default: ''
publishToCentral:
description: 'Whether or not to publish to the central repository'
required: false
type: string
default: 'false'
secrets:
USERNAME:
required: true
description: 'Username for Github'
USER_TOKEN:
required: true
description: 'The supplied token for Github'
SONA_USERNAME:
required: true
description: 'Username for Maven Central'
SONA_PASSWORD:
required: true
description: 'Passphrase for Maven Central'
GPG_PASSPHRASE:
required: false
description: 'Passphrase for GPG'
GPG_PRIVATE_KEY:
required: false
description: 'A GPG private key '
permissions:
contents: read
packages: write
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
java-version: [ 21 ]
name: ${{ inputs.name }} Builder
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
show-progress: 'true'
fetch-depth: 0
- name: Set up Java
uses: actions/[email protected]
with:
java-version: ${{ matrix.java-version }}
distribution: 'oracle'
#server-id: github_token
#settings-path: ${{ github.workspace }}
#cache: 'maven'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Update Settings.xml
uses: whelk-io/maven-settings-xml-action@v22
with:
servers: >
[
{
"id": "github",
"username": "${{secrets.USERNAME}}",
"password": "${{secrets.USER_TOKEN}}"
},
{
"id": "packages",
"username": "${{secrets.USERNAME}}",
"password": "${{secrets.USER_TOKEN}}"
},
{
"id": "packages_jwebmp",
"username": "${{secrets.USERNAME}}",
"password": "${{secrets.USER_TOKEN}}"
},
{
"id": "sona-snapshot",
"username": "${{secrets.SONA_USERNAME}}",
"password": "${{secrets.SONA_PASSWORD}}"
},
{
"id": "sona-release",
"username": "${{secrets.SONA_USERNAME}}",
"password": "${{secrets.SONA_PASSWORD}}"
}
]
repositories: >
[
{
"id": "packages",
"name": "packages",
"url": "https://maven.pkg.github.com/GuicedEE/Packages",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
},
{
"id": "packages_jwebmp",
"name": "packages_jwebmp",
"url": "https://maven.pkg.github.com/JWebMP/Packages",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
},
{
"id": "shibboleth",
"name": "shibboleth",
"url": "https://build.shibboleth.net/nexus/content/repositories/releases",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
}
]
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-cache-${{inputs.name}}
restore-keys: |
maven-cache-${{inputs.name}}
- name: Build
run:
mvn -B deploy --file ${{inputs.baseDir}}pom.xml -U ${{inputs.publishToCentral == 'true' && '-Psonatype-distribution,release -Dgpg.passphrase=' || ' '}}${{inputs.publishToCentral == 'true' && secrets.GPG_PASSPHRASE || ' '}} -Dmaven.test.failure.ignore=true