-
Notifications
You must be signed in to change notification settings - Fork 122
132 lines (130 loc) · 3.92 KB
/
build.yaml
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
name: Build
on:
push:
branches:
- main
- 2.2.x
paths-ignore:
- README.adoc
- docs/**
pull_request:
branches:
- main
- 2.2.x
paths-ignore:
- README.adoc
- docs/**
jobs:
build:
name: Build
strategy:
fail-fast: false
max-parallel: 12
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
java:
- 11
- 17
- 21
# Support 1-year-old version + latest minor
maven:
- 3.8.8
- 3.9.6
runs-on: ${{ matrix.os }}
steps:
- uses: s4u/[email protected]
with:
java-distribution: 'temurin'
java-version: ${{ matrix.java }}
maven-version: ${{ matrix.maven }}
- name: Maven version
run: mvn -version
- name: Build & Test
run: mvn -B -Prun-its clean verify
javadocs:
name: Javadocs
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
java:
- 11
maven:
- 3.9.6
runs-on: ${{ matrix.os }}
steps:
- uses: s4u/[email protected]
with:
java-distribution: 'temurin'
java-version: ${{ matrix.java }}
maven-version: ${{ matrix.maven }}
- name: Build & Test
run: mvn -B clean javadoc:jar
signature:
name: Sign artifacts
environment: test
env:
ARTIFACTS_DIR: target/artifacts
GPG_KEYNAME: AD1FC1D8A84C23D92DC1377D519F6A9DA113C4F3
GPG_PASSPHRASE: 1234567890
GPG_PRIVATE_KEY: |
-----BEGIN PGP PRIVATE KEY BLOCK-----
lIYEZZNGnRYJKwYBBAHaRw8BAQdACk2kGg4AXHMDO4yyfUgVoxNkdgwH5JeU4RKC
oWiJ8T7+BwMCsLucYGxSgqf/wrrRjmsWthIvcmSGikVBbmURXvygOSEAVvM6/dqW
exlh52f1W38SeQV1lteQjNUP5qc+F7y4eD8wqQQ3MRf6C3lTciMHr7RAYXNjaWlk
b2N0b3ItbWF2ZW4tcGx1Z2luIHRlc3RpbmcgPGFzY2lpZG9jdG9yLXRlc3RpbmdA
ZmFrZS5tYWlsPoiZBBMWCgBBFiEErR/B2KhMI9ktwTd9UZ9qnaETxPMFAmWTRp0C
GwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQUZ9qnaETxPPJ
BgD/Zrvgxa74ectHRj+lOF1Tc+u47B5RraAbGsDRcVRzYJABALWXYMywNLObobpU
pvNBnCyBYWwrW/+o1D3FI6aDzhgBnIsEZZNGnRIKKwYBBAGXVQEFAQEHQLdLXbH0
Q6wiP0b/QF+gJfXDNcJCWu4yAYO3WrdhyddmAwEIB/4HAwI8l2WaMrWsVP9cRuJg
ifCy3/n6Sk2DSC4028DJRCFx99oQx85dwDysmLMCccL/Od/X5RR9X4c9mCP9ZI2V
i9Fp7zcNKGCy7TafFoS2w5RTiH4EGBYKACYWIQStH8HYqEwj2S3BN31Rn2qdoRPE
8wUCZZNGnQIbDAUJBaOagAAKCRBRn2qdoRPE86XrAPwPakum1coasOY7U2mNbky3
X1Exlurk0IMFiW/GJkNcjgD+PkU7pXgRSy2YEl7ZWswheLvlQQT0PsyNSfkWS201
/ww=
=BCbM
-----END PGP PRIVATE KEY BLOCK-----
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
java:
- 11
maven:
- 3.9.6
runs-on: ${{ matrix.os }}
steps:
- name: debug
run: |
echo "${{ env.GPG_KEYNAME }}"
echo "${{ env.GPG_PASSPHRASE }}"
echo "${{ env.GPG_PRIVATE_KEY }}"
- name: Prepare key
run: echo -e "${{ env.GPG_PRIVATE_KEY }}" | gpg --import --batch
- name: List kys
run: gpg --list-keys
- uses: s4u/[email protected]
with:
java-distribution: 'temurin'
java-version: ${{ matrix.java }}
maven-version: ${{ matrix.maven }}
- name: Build & Test
run: mvn -B clean install -Prelease -DskipTests
- name: Collect artifacts
run: |
mkdir -p $ARTIFACTS_DIR
cp -r $HOME/.m2/repository/org/asciidoctor/asciidoctor-maven-* $ARTIFACTS_DIR
cp -r $HOME/.m2/repository/org/asciidoctor/*-doxia-module $ARTIFACTS_DIR
- name: Verify JAR signatures
run: find $ARTIFACTS_DIR -type f -name "*.jar" -exec gpg --verify "{}.asc" \;
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: signed-artifacts
path: ${{ env.ARTIFACTS_DIR }}