-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (59 loc) · 2.25 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
name: Resuable Build
on:
workflow_call:
inputs:
ref:
type: string
default: ${{ github.ref }}
description: The branch ref to build. Leave empty to use workflow branch.
publish:
type: boolean
default: false
description: To publish the project artifacts on Bonita Artifact Repository.
release:
type: boolean
default: false
description: To indicate that the current build is for a release (it will publish artifacts as well).
secrets:
BONITA_CI_PAT:
required: true
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: bonitasoft/bonita-super-admin-application
token: ${{ secrets.BONITA_CI_PAT }}
ref: ${{ inputs.ref }}
- name: ☕ Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: maven
- name: Configure Maven Settings
uses: bonitasoft/maven-settings-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
- name: Maven Build
if: ${{ !inputs.publish }}
timeout-minutes: 60
run: ./mvnw -ntp verify
- name: Maven Build & Deploy snapshot
if: ${{ inputs.publish && !inputs.release }}
timeout-minutes: 60
run: ./mvnw -ntp deploy -DaltDeploymentRepository=snapshots::${{ vars.SNAPSHOTS_REPOSITORY_URL }}
- name: Maven Build & Deploy release
if: ${{ inputs.release }}
timeout-minutes: 60
# Profile release is used to sign artifacts with GPG
run: ./mvnw -ntp deploy -Prelease -DaltDeploymentRepository=staging::${{ vars.STAGING_REPOSITORY_URL }}
- name: Upload BOS to the Github release
if: ${{ inputs.release }}
env:
GH_TOKEN: ${{ secrets.BONITA_CI_PAT }}
run: |
gh release upload ${{ inputs.ref }} ./community/target/bonita-super-admin-application-${{ inputs.ref }}.bos --repo bonitasoft/bonita-super-admin-application
gh release upload ${{ inputs.ref }} ./subscription/target/bonita-super-admin-application-sp-${{ inputs.ref }}.bos --repo bonitasoft/bonita-super-admin-application