-
Notifications
You must be signed in to change notification settings - Fork 8
179 lines (174 loc) · 5.94 KB
/
native.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
name: Native Image
on:
push:
branches:
- develop
pull_request:
release:
types: [published]
jobs:
native-image:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
uploaded_filename: sbtn-x86_64-pc-linux
local_path: client/target/bin/sbtn
- os: windows-2019
uploaded_filename: sbtn-x86_64-pc-win32.exe
local_path: client\target\bin\sbtn.exe
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
steps:
- name: Checkout sbt/sbt
uses: actions/checkout@v3
with:
repository: sbt/sbt
# Make sure the native-image-macos and native-image-aarch64-pc-linux-linux also updated
ref: 1.9.x
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- run: git fetch --tags || true
- name: Setup Windows C++ toolchain
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-2019' }}
- name: Build
shell: bash
run: |
echo $(pwd)
sbt clean nativeImage
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}
- name: Upload release
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.local_path }}
asset_name: ${{ matrix.uploaded_filename }}
asset_content_type: application/zip
native-image-macos:
needs: native-image
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macOS-latest
uploaded_filename: sbtn-x86_64-apple-darwin
local_path: target/bin/sbtn
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
steps:
- name: Checkout sbt/sbt
uses: actions/checkout@v3
with:
repository: sbt/sbt
ref: 1.9.x
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- run: git fetch --tags || true
- name: Build
if: github.event_name == 'release'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo $(pwd)
curl -L "https://github.com/sbt/sbtn-dist/releases/download/${{ github.event.release.tag_name }}/sbtn-aarch64-apple-darwin" \
--header "Authorization: token $GITHUB_TOKEN" \
--output sbtn-aarch64-apple-darwin \
--fail
sbt clean nativeImage
mkdir -p target/bin
lipo -create -o target/bin/sbtn "client/target/bin/sbtn" "sbtn-aarch64-apple-darwin"
- name: Build
if: github.event_name != 'release'
shell: bash
run: |
echo $(pwd)
sbt clean nativeImage
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}
- name: Upload release
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.local_path }}
asset_name: ${{ matrix.uploaded_filename }}
asset_content_type: application/zip
native-image-aarch64-pc-linux-linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
uploaded_filename: sbtn-aarch64-pc-linux
local_path: client/target/bin/sbtn
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M
steps:
- name: Checkout sbt/sbt
uses: actions/checkout@v3
with:
repository: sbt/sbt
ref: 1.9.x
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- name: Build Linux aarch64
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu20.04
# Speeds up builds per the run-on-arch-action README
githubToken: ${{ github.token }}
# The shell to run commands with in the container
shell: /bin/bash
# build-essential and libz-dev are required to build native images.
install: |
apt-get update -q -y
apt-get install -q -y curl openjdk-8-jdk build-essential libz-dev
# Does not work, see https://github.com/sbt/sbt/issues/6614
#echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
#curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
#apt-get update -q && apt-get install -q -y sbt
# Workaround:
curl -Ls https://scala.jfrog.io/artifactory/debian/sbt-1.8.0.deb -o sbt-1.8.0.deb
apt install -y ./sbt-1.8.0.deb
run: |
sbt clean nativeImage
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.local_path }}
name: ${{ matrix.uploaded_filename }}
- name: Upload release
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.local_path }}
asset_name: ${{ matrix.uploaded_filename }}
asset_content_type: application/zip