Skip to content
49 changes: 49 additions & 0 deletions .github/workflows/release-static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release static link version

on:
push:
tags:
- 'v*'
permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
cpu: [aarch64, loongarch64, powerpc64le, riscv64, x86_64]

steps:
- name: fetch code
uses: actions/checkout@v4
- name: install dependency
run: |
sudo apt-get update
sudo apt-get install -y wget
- name: build source
run: |
wget -q https://github.com/fifbroman8/buildroot/releases/download/v1.3.0/${{ matrix.cpu }}-buildroot-linux-musl_sdk-buildroot.tar.gz
tar xf ${{ matrix.cpu }}-buildroot-linux-musl_sdk-buildroot.tar.gz
${{ matrix.cpu }}-buildroot-linux-musl_sdk-buildroot/relocate-sdk.sh
find ${{ matrix.cpu }}-buildroot-linux-musl_sdk-buildroot -type d -name "sysroot" -exec sh -c 'for d; do rm -f "$d"/usr/lib/*.so; done' _ {} +
git submodule update --init
cmake . -DCMAKE_EXE_LINKER_FLAGS="-static" -DCMAKE_TOOLCHAIN_FILE=${{ matrix.cpu }}-buildroot-linux-musl_sdk-buildroot/share/buildroot/toolchainfile.cmake
make -j4 hotspot hotspot-perfparser
- name: check
run: |
file bin/hotspot
ldd bin/hotspot || echo "🏆 Check Pass: Not a dynamic executable!"
cp bin/hotspot hotspot
cp libexec/hotspot-perfparser hotspot-perfparser
tar -czvf hotspot-${{ matrix.cpu }}.tar.gz hotspot hotspot-perfparser

- name: upload
uses: softprops/action-gh-release@v2
with:
files: |
hotspot-${{ matrix.cpu }}.tar.gz
name: "Release ${{ github.ref_name }}"
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}