-
Notifications
You must be signed in to change notification settings - Fork 65
84 lines (84 loc) · 2.78 KB
/
cli-continuous-integration.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
name: ⌨️ CLI - Continuous Integration
on:
push:
branches:
- main
paths:
- 'cli/**'
- '.github/workflows/cli-continuous-integration.yml'
pull_request:
branches:
- main
paths:
- 'cli/**'
- '.github/workflows/cli-continuous-integration.yml'
jobs:
build-jar:
name: 'Build JAR package'
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ${{ github.workspace }}/cli
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
check-latest: false
cache: 'maven'
- name: Build with Maven
run: './mvnw package'
- name: Temporarily save package
uses: actions/upload-artifact@v4
with:
name: java-binary
path: |
${{ github.workspace }}/cli/target/*.jar
!${{ github.workspace }}/cli/target/original-*.jar
retention-days: 30
build-native-image:
name: Native image build on ${{ matrix.os }} and Java ${{ matrix.jdk-version }}
needs: [ build-jar ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
jdk-version: ['21']
os:
- ubuntu-22.04
- macos-latest # Intel x64
- macos-latest-xlarge # Apple Silicon arm64
- windows-latest
steps:
- name: Download application package
uses: actions/download-artifact@v4
with:
name: java-binary
- uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm'
java-version: ${{ matrix.jdk-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build native image on Linux
run: native-image --enable-url-protocols=https --static -jar nubesgen-cli-*.jar nubesgen-cli-linux
if: runner.os == 'Linux'
- name: Build native image on Mac OS X (Intel x64)
run: native-image --enable-url-protocols=https -jar nubesgen-cli-*.jar nubesgen-cli-macos
if: runner.os == 'macOS' && runner.arch == 'X64'
- name: Build native image on Mac OS X (Apple Silicon arm64)
run: native-image --enable-url-protocols=https -jar nubesgen-cli-*.jar nubesgen-cli-macos-arm64
if: runner.os == 'macOS' && runner.arch == 'ARM64'
- name: Build native image on Windows
run: native-image --enable-url-protocols=https -jar nubesgen-cli-*.jar nubesgen-cli-windows
if: runner.os == 'Windows'
- name: Temporarily save package
uses: actions/upload-artifact@v4
with:
name: nubesgen-cli-${{ matrix.os }}-java-${{ matrix.jdk-version }}
path: |
nubesgen-cli-*
!*.txt
!*.jar
retention-days: 30