diff --git a/.github/actions/build-serverless-adapter/action.yml b/.github/actions/build-serverless-adapter/action.yml index 034161b3b2c..081f0d32c37 100644 --- a/.github/actions/build-serverless-adapter/action.yml +++ b/.github/actions/build-serverless-adapter/action.yml @@ -91,6 +91,45 @@ runs: cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so shell: bash + - name: 'Get latest criu release' + id: get_criu_release + uses: actions/github-script@v6 + with: + script: | + const repoOwner = 'dragonwell-project'; + const repoName = 'criu'; + const { data: release } = await github.rest.repos.getLatestRelease({ + owner: repoOwner, + repo: repoName, + }); + return release; + + - name: 'Download asset and copy into jdk' + run: | + if [ "${{ inputs.platform }}" = "linux-aarch64" ];then + keyword=arm64 + elif [ "${{ inputs.platform }}" = "linux-x64" ];then + keyword=x64 + else + echo "unsupport platform ${{ inputs.platform }}" + exit 1 + fi + url="" + echo "${{ steps.get_criu_release.outputs.assets }}" | jq -c '.[]' | while read asset; do + name="$(echo ${asset} | jq -r '.name')" + if [ -n "$(echo ${name} | grep ${keyword})" ];then + url="$(echo ${asset} | jq -r '.url')" + break + fi + done + if [ -n "${url}" ];then + curl -OLSk -C - --retry 5 ${url} -o criu.tar.gz + tar zxvf criu.tar.gz + chmod +x criu + mv criu ${{ steps.bundle_decompress.outputs.java_home }}/lib/ + fi + shell: bash + - name: 'Regenerate bundle' run: | cd ${{ steps.bundle_decompress.outputs.bundle_home }} diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d063eacef29..0e380fede07 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -115,7 +115,7 @@ jobs: else extra_packages= fi - sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages + sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages jq sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }} if: inputs.platform != 'linux-aarch64'