-
Notifications
You must be signed in to change notification settings - Fork 22
62 lines (62 loc) · 2.06 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
name: Native Image
on:
push:
branches:
- master
- main
pull_request:
release:
types: [published]
jobs:
native-image:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
include:
# Replace "example" with the name your binary
- os: macOS-latest
uploaded_filename: example-x86_64-apple-darwin
local_path: example/target/native-image/example
- os: ubuntu-latest
uploaded_filename: example-x86_64-pc-linux
local_path: example/target/native-image/example
- os: windows-latest
uploaded_filename: example-x86_64-pc-win32.exe
local_path: example\target\native-image\example.exe
env:
# define Java options for both official sbt and sbt-extras
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: sbt
- run: git fetch --tags || true
- name: Setup Windows C++ toolchain
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-latest' }}
- name: Build
shell: bash
run: |
echo $(pwd)
sbt clean example/nativeImage
- uses: actions/upload-artifact@v2
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