-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (140 loc) · 4.13 KB
/
bom.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
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: boolean
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
- name: Set up Java
uses: actions/setup-java
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@v21
with:
servers: >
[
{
"id": "github",
"username": "${{secrets.USERNAME}}",
"password": "${{secrets.USER_TOKEN}}"
},
{
"id": "packages",
"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": "shibboleth",
"name": "shibboleth",
"url": "https://build.shibboleth.net/nexus/content/repositories/releases",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
}
]
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-${{ hashFiles('**pom.xml') }}
restore-keys: |
maven-
- name: Listings
run: ls -l
- name: Run Listings
run: |
cd ${{inputs.baseDir}}
ls -l
cd ..
- name: Build
run:
mvn -B package --file ${{inputs.baseDir}}pom.xml -U
- name: Publish
run: mvn deploy --file ${{inputs.baseDir}}pom.xml -Dignore.moditect=true
- name: Publish To Central
if: inputs.publishToCentral
run:
mvn org.apache.maven.plugins:maven-gpg-plugin:sign deploy -Psonatype-distribution,release --file ${{inputs.baseDir}}pom.xml -Dignore.moditect=true -Dgpg.passphrase=${{secrets.GPG_PASSPHRASE}}