-
Notifications
You must be signed in to change notification settings - Fork 9
242 lines (216 loc) · 10.1 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
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
name: Build
on:
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
inputs:
release:
description: 'Set to True if are running a release'
required: true
default: 'False'
releaseTag:
description: 'Set the release tag'
required: true
default: '9.0.0-SNAPSHOT'
checkoutRef:
description: 'JMC Checkout reference'
required: true
default: 'master'
version:
description: 'If running a release, set the version e.g (9.0.0-SNAPSHOT)'
required: true
default: '9.0.0-SNAPSHOT'
agentVersion:
description: 'If running a release, set the agent version e.g (1.0.1-SNAPSHOT)'
required: true
default: '1.0.1-SNAPSHOT'
jobs:
release:
name: Update release
runs-on: ubuntu-latest
outputs:
release: ${{ github.event.inputs.release || 'True' }}
releaseTag: ${{ github.event.inputs.releaseTag || '9.0.0-SNAPSHOT' }}
checkoutRef: ${{ github.event.inputs.checkoutRef || 'master' }}
version: ${{ github.event.inputs.version || '9.0.0-SNAPSHOT' }}
agentVersion: ${{ github.event.inputs.agentVersion || '1.0.1-SNAPSHOT' }}
steps:
- name: info
run: echo Initialize outputs...
build:
if: always()
needs: release
name: Build
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2048m -Declipse.p2.mirrors=false
steps:
- name: Checkout JMC
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: openjdk/jmc
ref: ${{ needs.release.outputs.checkoutRef }}
- name: Create release.txt
run: git rev-parse HEAD > release.txt
- name: Checkout JMC Overrides
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: workspace
- name: Create .m2/settings.xml
run: |
mkdir .m2
cp workspace/.github/workflows/settings.xml .m2/settings.xml
- name: Apply overrides
run: cp workspace/overrides/* . -rvf
- name: Change to final version
if: ${{ ! endsWith(needs.release.outputs.version, '-SNAPSHOT') }}
run: |
find . ! -path "*/.git/**" -type f -name "pom.xml" -exec sed -i s/"${{ needs.release.outputs.version }}-SNAPSHOT"/"${{ needs.release.outputs.version }}"/ {} \;
find . ! -path "*/.git/**" -type f \( -name "feature.xml" -o -name "MANIFEST.MF" \) -exec sed -i s/"${{ needs.release.outputs.version }}.qualifier"/"${{ needs.release.outputs.version }}"/ {} \;
echo "MAVEN_OPTS=$MAVEN_OPTS -DskipNexusStagingDeployMojo=true -Dchangelist=" >> $GITHUB_ENV
- name: Set up JDK 17
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: 17
distribution: temurin
cache: 'maven'
mvn-toolchain-id: 'JavaSE-17'
- name: Build & test core libraries
run: |
mvn verify
mvn install
working-directory: core
- name: Deploy core libraries
if: needs.release.outputs.release == 'True'
run: |
mvn deploy --settings $GITHUB_WORKSPACE/.m2/settings.xml -Dpublish.user=$USERNAME -Dpublish.password=$PASSWORD -Drelease.repo=https://adoptium.jfrog.io/artifactory/jmc-libs -Dsnapshot.repo=https://adoptium.jfrog.io/artifactory/jmc-libs-snapshots -Dgpg.skip=true -DskipTests=true
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: core
- name: Build & test agent
run: |
mvn verify
mvn install
working-directory: agent
- name: Deploy agent libraries
if: needs.release.outputs.release == 'True'
run: |
mvn deploy --settings $GITHUB_WORKSPACE/.m2/settings.xml -Dpublish.user=$USERNAME -Dpublish.password=$PASSWORD -Drelease.repo=https://adoptium.jfrog.io/artifactory/jmc-libs -Dsnapshot.repo=https://adoptium.jfrog.io/artifactory/jmc-libs-snapshots -Dgpg.skip=true -DskipTests=true
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: agent
- name: Build
run: |
mvn clean
mvn p2:site
mvn jetty:run &
cd ../../
mvn package
working-directory: releng/third-party
- name: Run Unit Tests
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: mvn verify
- name: Run UI Tests
# Ignore UI failures for now
continue-on-error: true
uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d # v1.6
with:
run: mvn verify -P uitests
- name: Deploy update sites
if: needs.release.outputs.release == 'True'
run: |
curl -X DELETE -u "$USERNAME:$PASSWORD" https://adoptium.jfrog.io/artifactory/jmc-snapshots/ide
find . -type f -exec curl -o /dev/null -s -u "$USERNAME:$PASSWORD" -T \'{}\' https://adoptium.jfrog.io/artifactory/jmc-snapshots/ide/\'{}\' \;
env:
USERNAME: ${{ secrets.ARTIFACTORY_USER }}
PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: application/org.openjdk.jmc.updatesite.ide/target/repository
- if: needs.release.outputs.release == 'True'
name: Delete old linux assets from ${{ needs.release.outputs.releaseTag }}
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ needs.release.outputs.releaseTag }}
assets: |
release*
agent-*
org.openjdk.jmc.updatesite.ide-*
org.openjdk.jmc-*.x86_64.*
org.openjdk.jmc-*.aarch64.*
fail-if-no-assets: false
fail-if-no-release: false
- if: needs.release.outputs.release == 'True'
name: Upload release-${{ needs.release.outputs.agentVersion }}.txt
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: release.txt
asset_name: release-${{ needs.release.outputs.version }}.txt
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload agent-${{ needs.release.outputs.agentVersion }}.jar
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: agent/target/agent-${{ needs.release.outputs.agentVersion }}.jar
asset_name: agent-${{ needs.release.outputs.agentVersion }}.jar
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: application/org.openjdk.jmc.updatesite.ide/target/org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
asset_name: org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-linux.gtk.x86_64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-linux.gtk.x86_64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.x86_64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-linux.gtk.aarch64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-linux.gtk.aarch64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.aarch64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-macosx.cocoa.x86_64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-macosx.cocoa.x86_64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.x86_64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-macosx.cocoa.aarch64.tar.gz
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-macosx.cocoa.aarch64.tar.gz
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.aarch64.tar.gz
overwrite: true
- if: needs.release.outputs.release == 'True'
name: Upload org.openjdk.jmc-win32.win32.x86_64.zip
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.releaseTag }}
file: target/products/org.openjdk.jmc-win32.win32.x86_64.zip
asset_name: org.openjdk.jmc-${{ needs.release.outputs.version }}-win32.win32.x86_64.zip
overwrite: true