-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (82 loc) · 3.33 KB
/
_reusable_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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: workflow-build
on:
workflow_call:
inputs:
ossrh-publication:
type: boolean
default: false
secrets:
KSM_CONFIG:
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_SONARCLOUD_RECORD_ID }}/field/password > env:SONAR_TOKEN
${{ vars.KEEPER_OSSRH_RECORD_ID }}/field/login > env:MAVEN_USERNAME
${{ vars.KEEPER_OSSRH_RECORD_ID }}/field/password > env:MAVEN_PASSWORD
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/field/login > env:GPG_KEYNAME
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/custom_field/gpg-private-key > env:GPG_PRIVATE_KEY
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/field/password > env:MAVEN_GPG_PASSPHRASE
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ env.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}
- name: Compile and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.DOCKER_SNAPSHOTS_REPOSITORY }}/bonita-community:10.2-SNAPSHOT
# Build and Push snapshots to maven central
- name: Deploy snapshots to Maven central
if: ${{ inputs.ossrh-publication }}
run: ./mvnw -B -ntp deploy -DskipTests=true -Pdeploy
test-supported-versions:
runs-on: ubuntu-22.04
strategy:
matrix:
bonita-version:
- '7.15.0'
- '8.0.0'
- '9.0.0'
- '10.0.0'
- '10.1.0'
steps:
- uses: actions/checkout@v4
- uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven
- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}
- name: ${{ matrix.bonita-version }} Integration tests
run: ./mvnw -B -ntp verify -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.INTERNAL_DOCKER_REPOSITORY_RELEASE }}/bonita-community:${{ matrix.bonita-version }}