-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (55 loc) · 1.73 KB
/
ci_main.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
name: CI Main
on:
push:
branches:
- 'main'
jobs:
package:
runs-on: ubuntu-20.04
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: apcc-${{ hashFiles('**/pom.xml') }}
restore-keys: apcc
- name: Download Dependencies
run: ./mvnw dependency:go-offline -U -B
- name: Build with Maven
run: ./mvnw package -DskipTests -B
deploy:
needs: package
runs-on: ubuntu-20.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 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout Code
uses: actions/checkout@v2
- name: Cache Maven package
uses: actions/cache@v2
with:
path: ~/.m2
key: apcc-${{ hashFiles('**/pom.xml') }}
restore-keys: apcc
- 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