-
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (147 loc) · 5.59 KB
/
native-image-snapshot.yml
File metadata and controls
175 lines (147 loc) · 5.59 KB
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
name: Native Image - Snapshot
on:
workflow_dispatch:
workflow_call:
jobs:
clean_release:
name: 'Clean the snapshot-native pre-release'
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Clean release and tag
run: |
gh release delete snapshot-native --cleanup-tag -y || true
echo "::notice title=release snapshot-native::snapshot - Native Image at ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/snapshot-native"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_linux_amd64:
name: 'Build Native Image linux-amd64'
needs: clean_release
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
distribution: liberica
cache: gradle
- name: Prepare env and build GPLv2 native image
shell: bash
run: |
./gradlew :plantuml-gplv2:nativeFullCompile :plantuml-gplv2:nativeHeadlessCompile -x test
- name: Archive Linux builds
shell: bash
run: |
zip -r plantuml-full-linux-amd64-SNAPSHOT.zip plantuml-gplv2/build/native/nativeFullCompile/
zip -r plantuml-headless-linux-amd64-SNAPSHOT.zip plantuml-gplv2/build/native/nativeHeadlessCompile/
- name: Upload build artifacts (Linux)
uses: actions/upload-artifact@v6
with:
name: linux-amd64
path: |
plantuml-full-linux-amd64-SNAPSHOT.zip
plantuml-headless-linux-amd64-SNAPSHOT.zip
build_windows_amd64:
name: 'Build Native Image windows-amd64'
needs: clean_release
runs-on: windows-latest
timeout-minutes: 90
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: liberica
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: gradle
- name: Force tmp dir on D for Java
shell: pwsh
run: |
echo "JAVA_TOOL_OPTIONS=-Djava.io.tmpdir=$env:RUNNER_TEMP" >> $env:GITHUB_ENV
- name: Build GPLv2 native image
shell: pwsh
run: ./gradlew :plantuml-gplv2:nativeFullCompile :plantuml-gplv2:nativeHeadlessCompile -x test
- name: Archive Windows builds
shell: pwsh
run: |
Compress-Archive -Path "plantuml-gplv2/build/native/nativeFullCompile/*" -DestinationPath "plantuml-full-windows-amd64-SNAPSHOT.zip"
Compress-Archive -Path "plantuml-gplv2/build/native/nativeHeadlessCompile/*" -DestinationPath "plantuml-headless-windows-amd64-SNAPSHOT.zip"
- name: Upload build artifacts (Windows)
uses: actions/upload-artifact@v6
with:
name: windows-amd64
path: |
plantuml-full-windows-amd64-SNAPSHOT.zip
plantuml-headless-windows-amd64-SNAPSHOT.zip
build_macos_arm64:
name: 'Build Native Image darwin-arm64'
needs: clean_release
runs-on: macos-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
distribution: liberica
cache: gradle
- name: Build GPLv2 native image
shell: bash
run: |
./gradlew :plantuml-gplv2:nativeFullCompile :plantuml-gplv2:nativeHeadlessCompile -x test
- name: Archive macOS builds
shell: bash
run: |
zip -r plantuml-full-darwin-arm64-SNAPSHOT.zip plantuml-gplv2/build/native/nativeFullCompile/
zip -r plantuml-headless-darwin-arm64-SNAPSHOT.zip plantuml-gplv2/build/native/nativeHeadlessCompile/
- name: Upload build artifacts (macOS)
uses: actions/upload-artifact@v6
with:
name: darwin-arm64
path: |
plantuml-full-darwin-arm64-SNAPSHOT.zip
plantuml-headless-darwin-arm64-SNAPSHOT.zip
publish_release:
name: Publish combined release
needs:
- build_linux_amd64
- build_windows_amd64
- build_macos_arm64
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- uses: actions/download-artifact@v8
with:
merge-multiple: true
path: artifacts/
- name: List artifacts
run: ls -lh artifacts/
- name: Prepare env
shell: bash
run: |
VERSION=$(grep 'version =' gradle.properties | cut -d' ' -f 3)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DATETIME=$(date -u +'%F at %T (UTC)')" >> $GITHUB_ENV
echo "Resolved VERSION=$VERSION"
- name: Upload all binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "artifacts/*.zip"
file_glob: true
tag: snapshot-native
release_name: snapshot - Native Image (~v${{ env.VERSION }})
overwrite: true
make_latest: false
prerelease: true
body: |
## Version ~v${{ env.VERSION }} of the ${{ env.DATETIME }}
This is a [Native Image](https://www.graalvm.org/latest/reference-manual/native-image/) pre-release of [the latest development work](https://github.com/plantuml/plantuml/commits/).
⚠️ **It is not ready for general use** ⚠️
⏱ _Snapshot taken the ${{ env.DATETIME }}_