-
Notifications
You must be signed in to change notification settings - Fork 31
80 lines (77 loc) · 2.49 KB
/
ci-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
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
name: CI build
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches: [ '**' ]
tags-ignore: [ '**' ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up GPG
if: env.GPG_SECRET_KEYS != null && env.GPG_OWNERTRUST != null
run: |
cat <(echo -e "${{ env.GPG_SECRET_KEYS }}") | base64 --decode | gpg --batch --import
cat <(echo -e "${{ env.GPG_OWNERTRUST }}") | base64 --decode | gpg --batch --import-ownertrust
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
cache: maven
- name: Perform build
run: .github/scripts/build.sh
shell: bash
env:
MAVEN_CLI_OPTS: --settings .github/mvn-settings.xml
GPG_EXECUTABLE: /usr/bin/gpg
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish test coverage
if: env.COVERALLS_REPO_TOKEN != null
run: ./mvnw --batch-mode -DrepoToken=${{ env.COVERALLS_REPO_TOKEN }} jacoco:report coveralls:report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
release:
name: "Release"
runs-on: ubuntu-latest
needs: build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Check out code
if: env.GH_TOKEN != null
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ env.GH_TOKEN }}
- name: Set up CI git user
if: env.GH_TOKEN != null
run: |
git config user.name "Talsma CI"
git config user.email "ci-user@talsma-ict.nl"
- name: Set up JDK
if: env.GH_TOKEN != null
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
cache: 'maven'
- name: Perform optional release
if: env.GH_TOKEN != null
run: .github/scripts/release.sh
shell: bash
env:
MAVEN_CLI_OPTS: --settings .github/mvn-settings.xml