Skip to content

Commit

Permalink
Support Windows binary (#57)
Browse files Browse the repository at this point in the history
closes gh-8
  • Loading branch information
making authored Jan 27, 2021
1 parent 37c5417 commit 3b6c7fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,34 @@ jobs:
platform: x86_64-pc-linux
classifier: linux-x86_64
move: mv
copy: cp
separator: /
extension: ""
- os: macos-latest
platform: x86_64-apple-darwin
classifier: osx-x86_64
move: mv
copy: cp
separator: /
extension: ""
- os: windows-latest
platform: x86_64-pc-win32
classifier: windows-x86_64
move: move
copy: copy
separator: \
extension: .exe
steps:
- uses: actions/checkout@v1
- uses: ayltai/setup-graalvm@v1
with:
java-version: 8
graalvm-version: 21.0.0
graalvm-version: 20.3.1
native-image: true
- uses: ilammy/[email protected]
if: runner.os == 'Windows'
- uses: microsoft/setup-msbuild@v1
if: runner.os == 'Windows'
- uses: actions/cache@v1
with:
path: ~/.m2/repository
Expand All @@ -39,14 +52,17 @@ jobs:
${{ runner.os }}-maven-
- name: native-image
run: |
set -ex
mkdir dist
mvn package -DskipTests
cp target/rsc*.jar ./dist/
mvn package -Dversion.generate.skip=true -Pnative
${{ matrix.copy }} target${{ matrix.separator }}rsc*.jar dist${{ matrix.separator }}
mvn package -Dversion-generate-skip=true -Pnative
${{ matrix.move }} target${{ matrix.separator }}classes${{ matrix.separator }}rsc-${{ matrix.classifier }}${{ matrix.extension }} dist${{ matrix.separator }}rsc-${{ matrix.platform }}${{ matrix.extension }}
- name: chmod
if: runner.os != 'Windows'
run: |
chmod +x dist${{ matrix.separator }}rsc-${{ matrix.platform }}${{ matrix.extension }}
- name: e2e-test
if: runner.os != 'Windows'
run: |
set -e
echo "📝 E2E Test for native image"
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<properties>
<java.version>1.8</java.version>
<version.generate.skip>false</version.generate.skip>
<version-generate-skip>false</version-generate-skip>
<native-build.args>
--enable-all-security-services
--enable-https
Expand Down Expand Up @@ -108,7 +108,7 @@
<goal>run</goal>
</goals>
<configuration>
<skip>${version.generate.skip}</skip>
<skip>${version-generate-skip}</skip>
<target>
<echo file="${project.build.directory}/generated-sources/java/am/ik/rsocket/Version.java">
package am.ik.rsocket;
Expand Down Expand Up @@ -174,7 +174,7 @@
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>21.0.0</version>
<version>20.3.1</version>
<configuration>
<mainClass>am.ik.rsocket.RscApplication</mainClass>
<buildArgs>${native-build.args}</buildArgs>
Expand Down

0 comments on commit 3b6c7fd

Please sign in to comment.