-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (130 loc) · 4.31 KB
/
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
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
name: Build
on:
push:
branches:
- develop
- release/*
- support/*
pull_request:
branches:
- develop
- release/*
- support/*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Build
run: ./mvnw -ntp clean verify -Dstyle.color=always
- name: Upload Test Results
uses: actions/upload-artifact@v4
with:
name: testResults
path: |
target/reports/*.xml
- name: Upload macos-x64 binary
if: ${{ github.event.pull_request == null }}
uses: actions/upload-artifact@v4
with:
name: macos-x64-unsigned
path: target/binaries/bonita-data-repository-macos-x64
retention-days: 1
- name: Upload macos-arm64 binary
if: ${{ github.event.pull_request == null }}
uses: actions/upload-artifact@v4
with:
name: macos-arm64-unsigned
path: target/binaries/bonita-data-repository-macos-arm64
retention-days: 1
- name: Upload linux-x64 binary
if: ${{ github.event.pull_request == null }}
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: target/binaries/bonita-data-repository-linux-x64
retention-days: 1
- name: Upload win-x64 binary
if: ${{ github.event.pull_request == null }}
uses: actions/upload-artifact@v4
with:
name: win-x64
path: target/binaries/bonita-data-repository-win-x64.exe
retention-days: 1
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: eventFile
path: ${{ github.event_path }}
macOs-codesign:
if: ${{ github.event.pull_request == null }}
needs: build
strategy:
matrix:
arch: [macos-x64, macos-arm64]
uses: ./.github/workflows/_reusable_macOs_codesign.yml
secrets: inherit
with:
input-artifact: ${{ matrix.arch}}-unsigned
output-artifact: ${{ matrix.arch}}
filename: bonita-data-repository-${{ matrix.arch}}
deploy:
if: ${{ github.event.pull_request == null }}
needs: macOs-codesign
runs-on: ubuntu-22.04
strategy:
matrix:
arch: [ win-x64, linux-x64, macos-x64, macos-arm64 ]
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Setup Maven configuration
uses: bonitasoft/maven-settings-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
- name: Download binaries
uses: actions/download-artifact@v4
with:
name: ${{ matrix.arch }}
path: target/binaries
- name: Read version
id: read-version
run: echo "version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Deploy
env:
SNAPSHOT_REPOSITORY_URL: ${{ vars.SNAPSHOTS_REPOSITORY_URL }}
run: |
./mvnw assembly:single@archive-${{ matrix.arch }}
./mvnw -ntp deploy:deploy-file -Dstyle.color=always -DrepositoryId=snapshots -Durl=${{ env.SNAPSHOT_REPOSITORY_URL }} \
-Dfile=target/bonita-data-repository-${{ steps.read-version.outputs.version }}-${{ matrix.arch }}.zip \
-DgroupId=org.bonitasoft.web \
-DartifactId=bonita-data-repository \
-Dversion=${{ steps.read-version.outputs.version }} \
-Dclassifier=${{ matrix.arch }} \
-Dpackaging=zip \
-DgeneratePom=false
delete-workfow-artifacts:
if: ${{ github.event.pull_request == null }}
needs: deploy
uses: ./.github/workflows/_reusable_delete-workflow-artifacts.yml
with:
excludes: |
testResults
eventFile