forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 5
213 lines (206 loc) · 7.73 KB
/
gluon-release.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
# Builds GraalVM 24-ea for Linux (x86_64), Windows (x86_64) and macOS (amd64/aarch64), with JDK 21
name: Gluon Release
on:
push:
tags:
- '*'
env:
LANG: en_US.UTF-8
jobs:
determine-version:
runs-on: ubuntu-latest
outputs:
simpleTag: ${{ steps.fetchSimpleTag.outputs.tag }}
version: ${{ steps.fetchVersion.outputs.version }}
steps:
- id: fetchSimpleTag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- id: fetchVersion
run: echo ::set-output name=version::$(echo $GITHUB_REF | sed -E "s/.*(gluon-.*-(dev|Final)).*/\1/g")
build-graalvm-gluon:
needs:
- determine-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-latest, ubuntu-latest]
include:
- os: ubuntu-latest
ARCH: "amd64"
HOME: ""
NAME: "linux"
- os: macos-13
ARCH: "amd64"
HOME: "/Contents/Home"
NAME: "darwin"
- os: macos-latest
ARCH: "aarch64"
HOME: "/Contents/Home"
NAME: "darwin"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: python3.9
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }}
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Set up Python
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Get LabsJDK
run: |
wget ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -O labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
echo "JAVA_HOME=${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}" >> ${GITHUB_ENV}
- name: Build GraalVM
run: |
cd substratevm
${MX_PATH}/mx --dy /substratevm --native-images=lib:native-image-agent build
echo "GRAALVM_HOME=`${MX_PATH}/mx --native-images=lib:native-image-agent graalvm-home`" >> ${GITHUB_ENV}
cd ..
- name: Create distribution
working-directory: ./vm
run: |
cd ${{ env.GRAALVM_HOME}}/..
if [[ ${{ matrix.os }} != 'ubuntu-latest' ]]
then
cd ../..
fi
mv `ls -1 | head -n1` ${{ env.GRAALVM_SVM }}
echo >> ${{ env.GRAALVM_SVM }}${{ matrix.HOME }}/release && echo "VENDOR=Gluon" >> ${{ env.GRAALVM_SVM }}${{ matrix.HOME }}/release
tar -czvf ${{ github.workspace }}/vm/${{ env.GRAALVM_SVM }}.tar.gz ${{ env.GRAALVM_SVM }}
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.tar.gz
build-graalvm-gluon-windows:
needs:
- determine-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
ARCH: "amd64"
HOME: ""
NAME: "windows"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: 'python'
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }}
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get LabsJDK (windows)
run: |
Invoke-WebRequest ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -OutFile labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf .\labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
- name: Build GraalVM (windows)
env:
JAVA_HOME: ${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call ${{ env.MX_PATH }}\mx.cmd -p substratevm --dy /substratevm --native-images=lib:native-image-agent build
call ${{ env.MX_PATH }}\mx.cmd -p substratevm --native-images=lib:native-image-agent graalvm-home > graalvm-home-with-forward-slashes.txt
set /p GRAALVM_HOME=<graalvm-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "GRAALVM_HOME=%GRAALVM_HOME:/=\%"
echo GRAALVM_HOME=%GRAALVM_HOME% >> %GITHUB_ENV%
- name: Create distribution
working-directory: ./vm
run: |
move ${{ env.GRAALVM_HOME}} ${{ env.GRAALVM_SVM }}
echo '' >> ${{ env.GRAALVM_SVM }}/release && echo VENDOR=Gluon >> ${{ env.GRAALVM_SVM }}/release
Compress-Archive -Path ${{ env.GRAALVM_SVM }} -DestinationPath ${{ env.GRAALVM_SVM }}.zip
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.zip
create-release:
runs-on: ubuntu-latest
needs:
- determine-version
- build-graalvm-gluon
- build-graalvm-gluon-windows
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-linux-amd64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-darwin-amd64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-darwin-aarch64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-windows-amd64
path: ./dist/vm
- name: Check files
run: |
ls -R ./dist/vm
- name: Create release name
id: create-release-name
run: echo ::set-output name=releaseName::$(echo ${{ needs.determine-version.outputs.simpleTag }} | sed "s/gluon-/Gluon /g")
- name: Release
uses: softprops/action-gh-release@v2
with:
name: GraalVM CE ${{ steps.create-release-name.outputs.releaseName }}
body: |
This is a Gluon build of GraalVM.
Based on Gluon Graal commit: ${{ github.sha }}
files: |
./dist/vm/*.zip
./dist/vm/*.tar.gz