support build vmtool linux aarch64 #2226 (#2478)

This commit is contained in:
hengyunabc 2023-04-19 13:23:42 +08:00 committed by GitHub
parent 8024aca4cf
commit 9a95565ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 21 deletions

View File

@ -11,7 +11,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

View File

@ -1,13 +1,13 @@
name: build vmtool
on: [push]
on:
workflow_dispatch:
jobs:
linux:
runs-on: ubuntu-18.04
build-linux-x64:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
@ -15,16 +15,15 @@ jobs:
distribution: 'adopt'
- name: Build with Maven
run: ./mvnw package
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: lib
path: arthas-vmtool/target/lib*
mac:
path: arthas-vmtool/target/libArthasJniLibrary-x64.so
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
@ -32,16 +31,15 @@ jobs:
distribution: 'adopt'
- name: Build with Maven
run: ./mvnw package
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: lib
path: arthas-vmtool/target/lib*
windows:
path: arthas-vmtool/target/libArthas*
build-windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
@ -49,7 +47,62 @@ jobs:
distribution: 'adopt'
- name: Build with Maven
run: ./mvnw package
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: lib
path: arthas-vmtool/target/*.dll
path: arthas-vmtool/target/*.dll
build-linux-aarch64:
# The host should always be Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu20.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
run: |
apt update && apt install openjdk-8-jdk g++ -y
./mvnw package -pl common,arthas-vmtool
cp arthas-vmtool/target/libArthas* lib/
- uses: actions/upload-artifact@v3
with:
name: lib
path: arthas-vmtool/target/libArthas*
commit_vmtool_files:
runs-on: ubuntu-20.04
needs: [build-linux-x64, build-linux-aarch64, build-mac, build-windows]
steps:
- name: Checkout Upstream Repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: lib
path: tmplib
- name: Display structure of downloaded files
run: ls -R
working-directory: tmplib
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
mv tmplib/* lib/
git add lib/
git commit -m "update arthas vmtool lib"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

View File

@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:

View File

@ -9,7 +9,7 @@ jobs:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
@ -26,7 +26,7 @@ jobs:
# https://static.azul.com/zulu/bin/
java: [12, 13, 14 , 17, 18, 19]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:

View File

@ -45,6 +45,20 @@
<lib_name>libArthasJniLibrary-x64.so</lib_name>
</properties>
</profile>
<profile>
<id>linux-aarch64</id>
<activation>
<os>
<name>linux</name>
<arch>aarch64</arch>
</os>
</activation>
<properties>
<os_name>linux</os_name>
<os_arch_option>-march=armv8-a</os_arch_option>
<lib_name>libArthasJniLibrary-aarch64.so</lib_name>
</properties>
</profile>
<!-- windows -->
<profile>
@ -196,6 +210,8 @@
<compilerStartOption>-fpic</compilerStartOption>
<compilerStartOption>-shared</compilerStartOption>
<compilerStartOption>-o</compilerStartOption>
<compilerStartOption>-I${JAVA_HOME}/include</compilerStartOption>
<compilerStartOption>-I${JAVA_HOME}/include/${os_name}</compilerStartOption>
</compilerStartOptions>
<linkerOutputDirectory>target</linkerOutputDirectory>