native-image #455
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: native-image | |
on: | |
schedule: | |
- cron: '0 8 * * *' | |
jobs: | |
build-binary-unix: | |
runs-on: ${{ matrix.os }} | |
env: | |
GRAALVM_VERSION: 22.0.0.2 | |
GRAALVM_JAVA: java17 | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
include: | |
- os: macos-latest | |
label: 'osx-x86_64' | |
- os: ubuntu-latest | |
label: 'linux' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repository: 'eclipse/lemminx' | |
- name: Cache Maven dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.m2/repository | |
~/.m2/wrapper | |
!~/.m2/repository/org/eclipse/lemminx | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Cache GraalVM | |
uses: actions/cache@v2 | |
with: | |
path: | | |
/opt/hostedtoolcache/GraalVM | |
~/hostedtoolcache/GraalVM | |
key: ${{ runner.os }}-graalvm-${{env.GRAALVM_VERSION}} | |
restore-keys: | | |
${{ runner.os }}-graalvm- | |
- uses: DeLaGuardo/setup-graalvm@48f2bf339ab7d35e31029b1822a213681fdfc42e #v5.0 | |
with: | |
graalvm: ${{env.GRAALVM_VERSION}} | |
java: ${{env.GRAALVM_JAVA}} | |
- run: ./mvnw -B package -Dnative -DskipTests $([ $(uname -s) = Linux ] && echo "-Dgraalvm.static=-H:+StaticExecutableWithDynamicLibC") -Dcbi.jarsigner.skip=true | |
- run: rm org.eclipse.lemminx/target/*.build_artifacts.txt | |
- run: mv org.eclipse.lemminx/target/lemminx-* lemminx-${{ matrix.label }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: lemminx-${{ matrix.label }} | |
path: lemminx-${{ matrix.label }} | |
if-no-files-found: error | |
build-binary-windows: | |
runs-on: windows-latest | |
env: | |
GRAALVM_VERSION: 22.0.0.2 | |
GRAALVM_JAVA: java17 | |
steps: | |
- name: Check out LemMinX | |
uses: actions/checkout@v2 | |
with: | |
repository: 'eclipse/lemminx' | |
- name: Cache Maven dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.m2/repository | |
~/.m2/wrapper | |
!~/.m2/repository/org/eclipse/lemminx | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Cache GraalVM | |
uses: actions/cache@v2 | |
with: | |
path: | | |
C:\hostedtoolcache\windows\GraalVM | |
key: ${{ runner.os }}-graalvm-${{env.GRAALVM_VERSION}} | |
restore-keys: | | |
${{ runner.os }}-graalvm- | |
- uses: ilammy/msvc-dev-cmd@7315a94840631165970262a99c72cfb48a65d25d #v1.12.0 | |
- uses: DeLaGuardo/setup-graalvm@48f2bf339ab7d35e31029b1822a213681fdfc42e #v5.0 | |
with: | |
graalvm: ${{env.GRAALVM_VERSION}} | |
java: ${{env.GRAALVM_JAVA}} | |
- run: .\mvnw.cmd -B package -Dnative -DskipTests -D "cbi.jarsigner.skip=true" | |
- run: mv org.eclipse.lemminx\target\lemminx-*.exe lemminx-win32.exe | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: lemminx-win32 | |
path: lemminx-win32.exe | |
if-no-files-found: error | |
release-binary-artifacts: | |
needs: [build-binary-unix, build-binary-windows] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repository: 'eclipse/lemminx' | |
fetch-depth: 2 | |
- run: git rev-parse HEAD^ > lastCommit | |
- name: Check New Changes To LS | |
id: cache-last-commit | |
uses: actions/cache@v2 | |
with: | |
path: lastCommit | |
key: lastCommit-${{ hashFiles('lastCommit') }} | |
- name: Retrieve Binary Artifacts | |
if: steps.cache-last-commit.outputs.cache-hit != 'true' | |
uses: actions/download-artifact@v3 | |
- name: Prepare Binary Artifacts | |
if: steps.cache-last-commit.outputs.cache-hit != 'true' | |
run: for f in lemminx-linux lemminx-osx-x86_64 lemminx-win32; do pushd ${f} && chmod u+x ${f}* && zip ../${f}.zip ${f}* && sha256sum ${f}* > ../${f}.sha256 && popd; done | |
- name: Release Binary Artifacts | |
if: steps.cache-last-commit.outputs.cache-hit != 'true' | |
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 #v1.2.1 | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
lemminx-*.zip | |
lemminx-*.sha256 |