-
Notifications
You must be signed in to change notification settings - Fork 132
273 lines (248 loc) · 10.7 KB
/
publish-jitexecutor-native-rc.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: "Publish jitexecutor-native - Release Candidate"
on:
pull_request:
branches: ["**"]
paths:
- ".github/workflows/publish-jitexecutor-native-rc.yml"
workflow_dispatch:
inputs:
release_candidate_version:
description: "Release candidate version"
required: true
kogito_runtimes_repository:
description: "Kogito runtimes repository"
required: true
jobs:
build_jitexecutor_native:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set version
id: version
run: |
if [ ${{ github.event_name }} == "pull_request" ]; then
echo "REPOSITORY=${{github.event.pull_request.head.repo.full_name}}" >> "$GITHUB_OUTPUT"
echo "REF=${{github.event.pull_request.head.ref}}" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=999-SNAPSHOT" >> "$GITHUB_OUTPUT"
else
echo "REPOSITORY=apache/incubator-kie-kogito-apps" >> "$GITHUB_OUTPUT"
echo "REF=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=${{ github.event.inputs.release_candidate_version }}" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: "Set long paths for Windows"
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: "Checkout kie-kogito-apps"
uses: actions/checkout@v4
with:
repository: ${{ steps.version.outputs.REPOSITORY }}
ref: ${{ steps.version.outputs.REF }}
- name: "Set up Maven"
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
- name: Setup maven settings (Linux and MacOS)
if: (runner.os == 'Linux' || runner.os == 'macOS')
env:
WORKDIR_PATH: ${{ github.workspace }}
KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }}
run: |
mkdir -p ${WORKDIR_PATH}/.m2
echo "<settings>
<servers>
<server>
<id>apache.releases.https</id>
<username>${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}</username>
<password>${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}</password>
</server>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>${KOGITO_RUNTIMES_REPO}</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>" > ${WORKDIR_PATH}/.m2/settings.xml
- name: Setup maven settings (Windows)
if: runner.os == 'Windows'
env:
WORKDIR_PATH: ${{ github.workspace }}
KOGITO_RUNTIMES_REPO: ${{ github.event.inputs.kogito_runtimes_repository }}
shell: pwsh
run: |
New-Item -Name ".m2" -Path "$env:WORKDIR_PATH" -ItemType Directory
$contentToAdd = @"
<settings>
<servers>
<server>
<id>apache.releases.https</id>
<username>${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}</username>
<password>${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}</password>
</server>
<server>
<id>apache.snapshots.https</id>
<username>${{ secrets.NEXUS_USER }}</username>
<password>${{ secrets.NEXUS_PW }}</password>
</server>
</servers>
<profiles>
<profile>
<id>additional_repos</id>
<repositories>
<repository>
<id>apache-kie-kogito-runtimes-staging-repository</id>
<name>Apache KIE Kogito Runtimes Staging Repository</name>
<url>$env:KOGITO_RUNTIMES_REPO</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>additional_repos</activeProfile>
</activeProfiles>
</settings>
"@
Add-Content "$env:WORKDIR_PATH\.m2\settings.xml" $contentToAdd
- name: "Set up JDK 17"
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
overwrite-settings: false
- name: "Setup Linux"
if: runner.os == 'Linux'
run: |
sudo apt update && \
sudo apt install -y \
build-essential \
libgtk-3-dev \
libappindicator3-dev \
gir1.2-appindicator3-0.1
- name: "Setup macOS"
if: runner.os == 'macOS'
run: |
brew install make && \
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_macos-x64_bin.tar.gz && \
tar -xzf graalvm-community-jdk-17.0.9_macos-x64_bin.tar.gz && \
sudo mv graalvm-community-openjdk-17.0.9+9.1 /Library/Java/JavaVirtualMachines/graalvm-community-openjdk-17.0.9+9.1
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-community-openjdk-17.0.9+9.1/Contents/Home
export PATH=${GRAALVM_HOME}/bin:$PATH
echo "${GRAALVM_HOME}/bin" >> $GITHUB_PATH && \
echo "GRAALVM_HOME=${GRAALVM_HOME}" >> $GITHUB_ENV && \
gu install native-image
- name: "Setup MSCV"
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: "Setup MSBUILD"
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
- name: "Setup GraalVM"
if: runner.os == 'Windows'
uses: graalvm/setup-graalvm@v1
with:
java-version: "17"
components: "native-image"
- name: "Configure Pagefile"
if: runner.os == 'Windows'
uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 #v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: "Update versions (Linux and macOS)"
if: (runner.os == 'Linux' || runner.os == 'macOS') && github.event_name != 'pull_request'
shell: bash
env:
SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH}
mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH}
- name: "Update versions Windows"
if: runner.os == 'Windows' && github.event_name != 'pull_request'
shell: pwsh
env:
SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml
run: |
mvn -B -fae -ntp -N -e versions:update-parent -DparentVersion="[${{ steps.version.outputs.PROJECT_VERSION }}]" -DallowSnapshots=true -DgenerateBackupPoms=false -s ${SETTINGS_FILE_PATH}
mvn -B -fae -ntp -N -e versions:update-child-modules -DallowSnapshots=true -DgenerateBackupPoms=false -s $env:SETTINGS_FILE_PATH
- name: "Build macOS"
if: runner.os == 'macOS' && github.event_name == 'pull_request'
shell: bash
run: |
mvn clean install -B -ntp -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native
- name: "Build and publish macOS"
if: runner.os == 'macOS' && github.event_name != 'pull_request'
shell: bash
env:
SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-darwin -am -Pjitexecutor-native -Papache-release -s ${SETTINGS_FILE_PATH}
- name: "Build Linux"
if: runner.os == 'Linux' && github.event_name == 'pull_request'
shell: bash
run: |
mvn clean install -B -ntp -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native
- name: "Build and Publish Linux"
if: runner.os == 'Linux' && github.event_name != 'pull_request'
shell: bash
env:
SETTINGS_FILE_PATH: ${{ github.workspace }}/.m2/settings.xml
run: |
mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-linux -am -Pjitexecutor-native -Papache-release -s ${SETTINGS_FILE_PATH}
- name: "Build Windows"
if: runner.os == 'Windows' && github.event_name == 'pull_request'
shell: pwsh
run: |
mvn clean install -B -ntp -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native
- name: "Build and Publish Windows"
if: runner.os == 'Windows' && github.event_name != 'pull_request'
shell: pwsh
env:
SETTINGS_FILE_PATH: ${{ github.workspace }}\.m2\settings.xml
run: |
mvn clean deploy -B -ntp -DdeployAtEnd -DskipTests -pl jitexecutor-native/jitexecutor-native-win32 -am -Pjitexecutor-native -Papache-release -s $env:SETTINGS_FILE_PATH
- name: "Upload JIT Executor binary"
uses: actions/upload-artifact@v4
with:
name: jitexecutor_${{ runner.os }}
path: ./jitexecutor-native/jitexecutor-native-*/target/jitexecutor-native-*-${{ steps.version.outputs.PROJECT_VERSION }}-run*