-
Notifications
You must be signed in to change notification settings - Fork 4
166 lines (148 loc) · 6.27 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
name: build-all
on:
push:
branches:
- main
- dev
tags:
- "v**"
pull_request:
branches:
- main
- dev
workflow_dispatch:
permissions:
contents: write
jobs:
build_linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
if: github.event.pull_request.draft == false
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- run: chmod +x gradlew
- run: ./gradlew nativeImage --info
- run: chmod +x build/graal/xlite-daemon
- run: mv build/graal/xlite-daemon build/graal/xlite-daemon-linux64
- uses: actions/upload-artifact@v3
with:
name: artifacts-linux
path: |
build/graal/xlite-daemon-linux64
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
name: XLite Daemon ${{ github.ref_name}}
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
generate_release_notes: true
files: |
build/graal/xlite-daemon-linux64
build_mac:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
if: github.event.pull_request.draft == false
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- run: chmod +x gradlew
- run: ./gradlew nativeImage --info
- run: chmod +x build/graal/xlite-daemon
- run: mv build/graal/xlite-daemon build/graal/xlite-daemon-osx64
- uses: actions/upload-artifact@v3
with:
name: artifacts-mac
path: |
build/graal/xlite-daemon-osx64
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
name: XLite Daemon ${{ github.ref_name}}
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
generate_release_notes: true
files: |
build/graal/xlite-daemon-osx64
build_win:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
if: github.event.pull_request.draft == false
- uses: graalvm/setup-graalvm@v1
with:
version: "22.3.1"
java-version: "17"
components: "native-image"
github-token: ${{ github.token }}
- run: choco install -y windows-sdk-10
- run: choco install -y visualstudio2019-workload-vctools
- run: ./gradlew.bat build
- run: |
$currentDir = Get-Location
$pattern = "xlite-daemon-*-all.jar"
$CC_PACKAGED_JAR = Get-ChildItem -Path "$currentDir\build\libs\" -Filter $pattern | Select-Object -First 1
Write-Host "CC_PACKAGED_JAR=$CC_PACKAGED_JAR"
& native-image -jar ${CC_PACKAGED_JAR} `
-H:Name=xlite-daemon `
-H:Class=io.cloudchains.app.App `
-H:+JNI `
-H:+UseServiceLoaderFeature `
-H:-UseServiceLoaderFeature `
-H:ReflectionConfigurationFiles=contrib/netty-reflection.json `
-H:ResourceConfigurationFiles=contrib/resource-config.json `
-H:IncludeResources='.*/wordlist/english.txt$' `
-H:Log=registerResource `
--no-fallback `
--no-server `
-da `
--enable-url-protocols=http,https `
--initialize-at-build-time=io.netty `
--initialize-at-build-time=com.google.common `
--initialize-at-build-time=org.apache.commons.logging `
--initialize-at-build-time=org.slf4j.LoggerFactory `
--initialize-at-build-time=org.slf4j.impl.StaticLoggerBinder `
--initialize-at-build-time=org.slf4j.helpers.NOPLogger `
--initialize-at-build-time=org.slf4j.helpers.SubstituteLoggerFactory `
--initialize-at-build-time=org.slf4j.helpers.Util `
--initialize-at-build-time=org.bitcoinj.core.Utils `
--initialize-at-build-time=org.bitcoinj.core.Sha256Hash `
--initialize-at-build-time=org.bitcoinj.crypto.MnemonicCode `
--initialize-at-run-time=io.netty.util.internal.logging.Log4JLogger `
--initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder `
--initialize-at-run-time=io.netty.handler.codec.http2.DefaultHttp2FrameWriter `
--initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil `
--initialize-at-run-time=io.netty.buffer.PooledByteBufAllocator `
--initialize-at-run-time=io.netty.buffer.ByteBufAllocator `
--initialize-at-run-time=io.netty.buffer.ByteBufUtil `
--initialize-at-run-time=io.netty.buffer.AbstractReferenceCountedByteBuf `
--initialize-at-run-time=io.netty.handler.codec.http2.Http2CodecUtil `
--initialize-at-run-time=io.netty.handler.codec.http2.Http2ClientUpgradeCodec `
--initialize-at-run-time=io.netty.handler.codec.http2.Http2ConnectionHandler `
--initialize-at-run-time=io.netty.handler.codec.http2.DefaultHttp2FrameWriter `
--initialize-at-run-time=io.netty.util.AbstractReferenceCounted `
--initialize-at-run-time=io.netty.handler.codec.http.HttpObjectEncoder `
--initialize-at-run-time=io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder `
--initialize-at-run-time=io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder `
--initialize-at-run-time=io.netty.handler.ssl.util.ThreadLocalInsecureRandom `
--allow-incomplete-classpath `
--verbose `
-H:+ReportExceptionStackTraces
- run: ren xlite-daemon.exe xlite-daemon-win64.exe
- uses: actions/upload-artifact@v3
with:
name: artifacts-win
path: |
xlite-daemon-win64.exe
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
name: XLite Daemon ${{ github.ref_name}}
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
generate_release_notes: true
files: |
xlite-daemon-win64.exe