-
Notifications
You must be signed in to change notification settings - Fork 82
74 lines (66 loc) · 2.46 KB
/
ci.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
name: Continuous Integration
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ dev ]
workflow_dispatch:
inputs:
MANUAL_RELEASE_TRIGGERED:
description: "Environment Variable used to trigger a Maven Central release"
required: false
default: "true"
jobs:
build:
runs-on: ubuntu-20.04
steps:
# Setup
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: 11.0.2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Grant execute permission for Github Actions Workflows
run: chmod -R ug+x .github/workflow_scripts
- name: For release builds, remove -SNAPSHOT
env:
MANUAL_RELEASE_TRIGGERED: ${{ github.event.inputs.MANUAL_RELEASE_TRIGGERED }}
run: .github/workflow_scripts/update_project_version.sh
# Quality Checks
- name: Quality checks (No tests)
run: ./gradlew jar check -x test -x integrationTest
- name: Tests
run: ./gradlew check build
- name: Sonar
env:
SONAR_TOKEN: 374d4e512b90257ba50c21c37202ee01af40c6a0
SONAR_PR_DECORATION_GITHUB_TOKEN: ${{ secrets.SONAR_PR_DECORATION_GITHUB_TOKEN }}
run: .github/workflow_scripts/sonar.sh
# Merge to Main
- name: Merge dev to main
env:
MERGE_TAG_GITHUB_SECRET_TOKEN: ${{ secrets.MERGE_TAG_GITHUB_SECRET_TOKEN }}
run: .github/workflow_scripts/merge-dev-to-main.sh
# Sign and Publish
- name: Decrypt GPG key (To sign artifacts)
env:
GPG_KEY_LOCATION: secring.gpg
GPG_AES256_PASSPHRASE: ${{ secrets.GPG_AES256_PASSPHRASE }}
MANUAL_RELEASE_TRIGGERED: ${{ github.event.inputs.MANUAL_RELEASE_TRIGGERED }}
run: .github/workflow_scripts/decrypt_gpg_key.sh
- name: Sign and Upload Archives
env:
GPG_KEY_LOCATION: secring.gpg
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
MANUAL_RELEASE_TRIGGERED: ${{ github.event.inputs.MANUAL_RELEASE_TRIGGERED }}
run: .github/workflow_scripts/deploy.sh
- name: Tag main branch
env:
MANUAL_RELEASE_TRIGGERED: ${{ github.event.inputs.MANUAL_RELEASE_TRIGGERED }}
MERGE_TAG_GITHUB_SECRET_TOKEN: ${{ secrets.MERGE_TAG_GITHUB_SECRET_TOKEN }}
run: .github/workflow_scripts/tag-main.sh