-
Notifications
You must be signed in to change notification settings - Fork 9
181 lines (162 loc) · 7.09 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
name: Build
on:
schedule:
- cron: '0 18 * * *'
workflow_dispatch:
inputs:
release:
description: 'Set to True if are running a release'
required: true
type: boolean
default: false
releaseTag:
description: 'Set the release tag'
required: true
default: '9.1.0-SNAPSHOT'
checkoutRef:
description: 'JMC Checkout reference'
required: true
default: 'master'
version:
description: 'If running a release, set the version e.g (9.1.0-SNAPSHOT)'
required: true
default: '9.1.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'
permissions:
contents: write
jobs:
release:
name: Update release
runs-on: ubuntu-latest
outputs:
release: ${{ github.event.inputs.release || true }}
releaseTag: ${{ github.event.inputs.releaseTag || '9.1.0-SNAPSHOT' }}
checkoutRef: ${{ github.event.inputs.checkoutRef || 'master' }}
version: ${{ github.event.inputs.version || '9.1.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: openjdk/jmc
ref: ${{ needs.release.outputs.checkoutRef }}
- name: Create release.txt
run: git rev-parse HEAD > release-${{ needs.release.outputs.version }}.txt
- name: Checkout JMC Overrides
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.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
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
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: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: mvn verify
- name: Run UI Tests
# Ignore UI failures for now
continue-on-error: true
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1
with:
run: mvn verify -P uitests
- name: Deploy update sites
if: needs.release.outputs.release
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
name: Delete old linux assets from ${{ needs.release.outputs.releaseTag }}
uses: mknejp/delete-release-assets@ea7ff12c30ef2589fe4311264f3a336d01325030 # v1
with:
token: ${{ secrets.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
- name: Deploy release assets
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v0.1.15
if: needs.release.outputs.release
with:
files: |
release-${{ needs.release.outputs.version }}.txt
agent/target/agent-${{ needs.release.outputs.agentVersion }}.jar
application/org.openjdk.jmc.updatesite.ide/target/org.openjdk.jmc.updatesite.ide-${{ needs.release.outputs.version }}.zip
target/products/org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.x86_64.tar.gz
target/products/org.openjdk.jmc-${{ needs.release.outputs.version }}-linux.gtk.aarch64.tar.gz
target/products/org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.x86_64.tar.gz
target/products/org.openjdk.jmc-${{ needs.release.outputs.version }}-macosx.cocoa.aarch64.tar.gz
target/products/org.openjdk.jmc-${{ needs.release.outputs.version }}-win32.win32.x86_64.zip
tag_name: ${{ needs.release.outputs.releaseTag }}
token: ${{ secrets.GITHUB_TOKEN }}