-
Notifications
You must be signed in to change notification settings - Fork 49
48 lines (40 loc) · 1.6 KB
/
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
name: Java CI
on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: If present (and if on a branch that should be released), write the keystore to a file, and note it exists for the next step
#if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')
id: keystore
env:
SIGN_KEYSTORE_CONTENTS: ${{ secrets.SIGN_KEYSTORE_CONTENTS }}
run: |
if [ "$SIGN_KEYSTORE_CONTENTS" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT
echo "$SIGN_KEYSTORE_CONTENTS" | base64 --decode > ${HOME}/key
else
echo "available=false" >> $GITHUB_OUTPUT
fi
- name: Build with maven (sign artifacts)
if: ${{ steps.keystore.outputs.available == 'true' }}
env:
SIGN_STOREPASS: ${{ secrets.SIGN_STOREPASS }}
SIGN_ALIAS: ${{ secrets.SIGN_ALIAS }}
SIGN_KEYPASS: ${{ secrets.SIGN_KEYPASS }}
SIGN_STORETYPE: ${{ secrets.SIGN_STORETYPE }}
SIGN_TSA: http://timestamp.digicert.com/
run: SIGN_KEYSTORE=${HOME}/key mvn --batch-mode --update-snapshots package
- name: Build with maven (no signing)
if: ${{ steps.keystore.outputs.available != 'true' }}
run: mvn --batch-mode --update-snapshots package
- uses: actions/upload-artifact@v3
with:
name: repository
path: repo/target/repository/