Use Adoptium JREs
This commit is contained in:
parent
92a5b12bd9
commit
e61e827eb9
49
.github/scripts/prepare_JREs.sh
vendored
Executable file
49
.github/scripts/prepare_JREs.sh
vendored
Executable file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
URL_JDK8="https://api.adoptium.net/v3/binary/latest/8/ga/linux/x64/jre/hotspot/normal/eclipse"
|
||||
URL_JDK17="https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jre/hotspot/normal/eclipse"
|
||||
|
||||
mkdir -p JREs
|
||||
pushd JREs
|
||||
|
||||
wget --content-disposition "$URL_JDK8"
|
||||
wget --content-disposition "$URL_JDK17"
|
||||
|
||||
for file in *;
|
||||
do
|
||||
mkdir temp
|
||||
|
||||
# Handle OpenJDK17 archive
|
||||
re='(OpenJDK17U-jre_x64_linux_hotspot_17.(.*).tar.gz)'
|
||||
if [[ $file =~ $re ]];
|
||||
then
|
||||
version=${BASH_REMATCH[2]}
|
||||
version_edit=$(echo $version | sed -e 's/_/+/g')
|
||||
dir_name=jdk-17.$version_edit-jre
|
||||
echo $dir_name
|
||||
mkdir jre17
|
||||
tar -xzf $file -C temp
|
||||
pushd temp/$dir_name
|
||||
cp -r . ../../jre17
|
||||
popd
|
||||
|
||||
fi
|
||||
|
||||
# Handle OpenJDK8 archive
|
||||
re='(OpenJDK8U-jre_x64_linux_hotspot_8(.*).tar.gz)'
|
||||
if [[ $file =~ $re ]];
|
||||
then
|
||||
version=${BASH_REMATCH[2]}
|
||||
version_edit=$(echo $version | sed -e 's/b/-b/g')
|
||||
dir_name=jdk8$version_edit-jre
|
||||
mkdir jre8
|
||||
tar -xzf $file -C temp
|
||||
pushd temp/$dir_name
|
||||
cp -r . ../../jre8
|
||||
popd
|
||||
fi
|
||||
|
||||
rm -rf temp
|
||||
done
|
||||
|
||||
popd
|
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@ -43,11 +43,6 @@ jobs:
|
||||
with:
|
||||
submodules: 'true'
|
||||
|
||||
- name: Install OpenJDK
|
||||
uses: AdoptOpenJDK/install-jdk@v1
|
||||
with:
|
||||
version: '8'
|
||||
|
||||
- name: Install OpenJDK
|
||||
uses: AdoptOpenJDK/install-jdk@v1
|
||||
with:
|
||||
@ -103,6 +98,12 @@ jobs:
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage"
|
||||
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
|
||||
|
||||
- name: Download JREs for AppImage
|
||||
if: matrix.app_image == true
|
||||
shell: bash
|
||||
run: |
|
||||
${{ github.workspace }}/.github/scripts/prepare_JREs.sh
|
||||
|
||||
- name: AppImage magic
|
||||
if: matrix.app_image == true
|
||||
shell: bash
|
||||
@ -110,8 +111,8 @@ jobs:
|
||||
export OUTPUT="PolyMC-${{ github.sha }}-x86_64.AppImage"
|
||||
chmod +x linuxdeploy-*.AppImage
|
||||
mkdir -p ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-{8,17}-openjdk
|
||||
cp -r /opt/hostedtoolcache/jdk-8-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk
|
||||
cp -r /opt/hostedtoolcache/jdk-17-hotspot/1.0.0/x64/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk
|
||||
cp -r ${{ github.workspace }}/JREs/jre8/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk
|
||||
cp -r ${{ github.workspace }}/JREs/jre17/* ${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk
|
||||
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_DIR }}/usr/lib:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-8-openjdk/jre/lib/amd64:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib/server:${{ env.INSTALL_DIR }}/usr/lib/jvm/java-17-openjdk/lib" \
|
||||
./linuxdeploy-x86_64.AppImage --appdir ${{ env.INSTALL_DIR }} --output appimage --plugin qt -d ${{ env.INSTALL_DIR }}/usr/share/applications/org.polymc.polymc.desktop -i ${{ env.INSTALL_DIR }}/usr/share/icons/hicolor/scalable/apps/org.polymc.PolyMC.svg
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user