11name : Build executables
22
3-
43on :
54 push :
65 branches :
76 - ' master'
7+ - ' *-snapshot'
88 pull_request :
99
1010env :
@@ -16,106 +16,55 @@ jobs:
1616 runs-on : ubuntu-latest
1717 steps :
1818 - uses : actions/checkout@v3
19+ name : " Checkout"
1920 - uses : actions/setup-java@v3
21+ name : " Install Java"
2022 with :
21- java-version : ' 11'
22- distribution : ' adopt'
23- - name : " Cache Maven packages"
24- uses : actions/cache@v3
25- with :
26- path : ~/.m2
27- key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
28- restore-keys : ${{ runner.os }}-m2
29- - name : " Build with Maven"
30- run : mvn -B clean install --file pom.xml
31- - name : ' Get Version Number'
23+ java-version : ' 17'
24+ distribution : ' temurin'
25+ cache : ' maven'
26+ - name : " Build JAR"
27+ run : mvn -DskipTests -Pfatjar clean package
28+ - name : ' Get version'
3229 run : echo "::set-env name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
3330 - name : ' Upload artifact'
3431 uses : actions/upload-artifact@v3
3532 with :
3633 name : ' simplelocalize-cli-${{env.VERSION}}.jar'
3734 path : ' target/simplelocalize-cli-${{env.VERSION}}.jar'
38- build-windows :
39- needs : [ build-jar ]
40- name : " Build Windows executable"
41- runs-on : windows-latest
42- steps :
43- - uses : actions/checkout@v3
44- - name : " Download GraalVM"
45- run : |
46- Invoke-RestMethod -Uri https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-windows-amd64-20.1.0.zip -OutFile 'graal.zip'
47- - name : " Install GraalVM"
48- run : |
49- Expand-Archive -path 'graal.zip' -destinationpath '.'
50- - name : " Install Native Image"
51- run : |
52- graalvm-ce-java11-20.1.0\bin\gu.cmd install native-image
53- - name : " Set up Visual C Build Tools Workload for Visual Studio 2017 Build Tools"
54- run : |
55- choco install visualstudio2017-workload-vctools
56- - name : ' Get Version Number'
57- run : |
58- echo "::set-env name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
59- shell : bash
60- - name : ' Get JAR Artifact'
61- uses : actions/download-artifact@v3
62- with :
63- name : ' simplelocalize-cli-${{env.VERSION}}.jar'
64- - name : " Build Native Image"
65- shell : cmd
66- env :
67- JAVA_HOME : ./graalvm-ce-java11-20.1.0
68- run : |
69- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
70- ./graalvm-ce-java11-20.1.0/bin/native-image --no-server -Dmicronaut.env.deduction=false --report-unsupported-elements-at-runtime -cp simplelocalize-cli-${{env.VERSION}}.jar -H:Name="simplelocalize-cli-windows" io.simplelocalize.cli.SimplelocalizeCliCommand
71- # - name: "Optimize executable"
72- # uses: svenstaro/upx-action@v2
73- # with:
74- # file: simplelocalize-cli-windows.exe
75- # args: --best
76- - name : ' Upload artifact'
77- uses : actions/upload-artifact@v3
78- with :
79- name : simplelocalize-cli-windows
80- path : ' simplelocalize-cli-windows.exe'
81-
8235 build-unix :
83- needs : [ build-jar ]
84- name : " Build ${{ matrix.os }} executable"
36+ name : " Build ${{ matrix.label }} executable"
8537 strategy :
8638 matrix :
87- os : [ ubuntu-latest, macos-latest ]
8839 include :
8940 - os : ' ubuntu-latest'
9041 label : ' linux'
42+ filename : ' simplelocalize-cli'
9143 - os : ' macos-latest'
9244 label : ' mac'
45+ filename : ' simplelocalize-cli'
46+ - os : ' windows-latest'
47+ label : ' windows'
48+ filename : ' simplelocalize-cli.exe'
9349 runs-on : ${{ matrix.os }}
9450 steps :
9551 - uses : actions/checkout@v3
96- - name : ' Get Version Number'
97- run : |
98- echo "::set-env name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
99- - name : ' Get JAR Artifact'
100- uses : actions/download-artifact@v3
101- with :
102- name : ' simplelocalize-cli-${{env.VERSION}}.jar'
103- - name : " Setup GraalVM"
104- uses : DeLaGuardo/setup-graalvm@master
52+ name : " Checkout"
53+ - uses : graalvm/setup-graalvm@v1
54+ name : " Install GraalVM"
10555 with :
106- graalvm-version : ' 20.1.0.java11'
107- - name : " Install Native Image"
108- run : gu install native-image
109- - name : " Build Native Image"
110- run : native-image --no-server -Dmicronaut.env.deduction=false --report-unsupported-elements-at-runtime -cp simplelocalize-cli-*.jar -H:Name="simplelocalize-cli-${{matrix.label}}" io.simplelocalize.cli.SimplelocalizeCliCommand
111- # - name: "Optimize executable"
112- # if: matrix.label != 'mac'
113- # uses: svenstaro/upx-action@v2
114- # with:
115- # file: simplelocalize-cli-${{ matrix.label }}
116- # args: --best
56+ version : ' 22.3.2'
57+ java-version : ' 17.0.7'
58+ distribution : ' graalvm'
59+ components : ' native-image'
60+ github-token : ${{ secrets.GITHUB_TOKEN }}
61+ native-image-job-reports : ' true'
62+ - name : " Build executable"
63+ run : mvn -DskipTests -Pnative clean package
64+ - name : " Test executable"
65+ run : ./target/${{ matrix.filename }} --version
11766 - name : " Upload artifact"
11867 uses : actions/upload-artifact@v3
11968 with :
12069 name : simplelocalize-cli-${{ matrix.label }}
121- path : simplelocalize-cli- ${{ matrix.label }}
70+ path : ./target/ ${{ matrix.filename }}
0 commit comments