-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (126 loc) · 4.02 KB
/
ci.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
package:
runs-on: ubuntu-22.04
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Download Dependencies
run: ./mvnw dependency:go-offline -U -B
- name: Build with Maven
run: ./mvnw package -DskipUnitTests -B
unit-tests:
needs: package
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Maven package
uses: actions/cache@v3
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Run Unit Tests and analyze on SonarCloud
run: ./mvnw test sonar:sonar -B
integration-tests:
needs: package
runs-on: ubuntu-22.04
steps:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
# Crowd and thus the integration tests are not compatible with Java 17
java-version: 11
distribution: temurin
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Maven package
uses: actions/cache@v3
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Run Integration Tests
run: ./mvnw integration-test -DskipUnitTests -B
deploy:
needs: [unit-tests, integration-tests]
if: github.event_name == 'push' # to 'main'
runs-on: ubuntu-22.04
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGN_ASC_SALT: ${{ secrets.SIGN_ASC_SALT }}
SIGN_ASC_KEY: ${{ secrets.SIGN_ASC_KEY }}
SIGN_ASC_IV: ${{ secrets.SIGN_ASC_IV }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Maven package
uses: actions/cache@v3
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Decrypt Signing Key
run: openssl aes-256-cbc -S ${SIGN_ASC_SALT} -K ${SIGN_ASC_KEY} -iv ${SIGN_ASC_IV} -in .github/workflows/sign.asc.enc -out .github/workflows/sign.asc -d
- name: Import Signing Key
run: gpg --no-tty --batch --import .github/workflows/sign.asc
- name: Deploy to Maven Central
run: export GPG_TTY=$(tty) && ./mvnw -s .github/workflows/settings.xml -DskipTests deploy -B
apcc:
needs: package
runs-on: ubuntu-22.04
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Maven package
uses: actions/cache@v3
with:
path: ~/.m2
key: confapi-plugin-${{ hashFiles('**/pom.xml') }}
restore-keys: confapi-plugin
- name: Download APCC
run: ./mvnw dependency:get -DgroupId=de.aservo -DartifactId=atlassian-plugin-compatibility-check -Dversion=0.0.4
- name: Copy APCC to current Directory
run: ./mvnw dependency:copy -Dartifact=de.aservo:atlassian-plugin-compatibility-check:0.0.4 -DoutputDirectory=.
- name: Run APCC
run: java -jar atlassian-plugin-compatibility-check-0.0.4.jar "crowd.version"