mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 18:34:21 +02:00
Build x86_64 AppImage
This commit is contained in:
46
.github/build.sh
vendored
46
.github/build.sh
vendored
@@ -51,6 +51,14 @@ if [[ -z ${DEBUG_ASSET_PATH-} ]]; then
|
|||||||
>&2 echo "DEBUG_ASSET_PATH not set"
|
>&2 echo "DEBUG_ASSET_PATH not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ -z ${PACKAGE_APPIMAGE-} ]]; then
|
||||||
|
>&2 echo "PACKAGE_APPIMAGE not set"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -z ${APPIMAGE_ASSET_PATH-} ]]; then
|
||||||
|
>&2 echo "APPIMAGE_ASSET_PATH not set"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
case $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC in
|
case $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC in
|
||||||
x86_64-linux-gnu-static) ;;
|
x86_64-linux-gnu-static) ;;
|
||||||
@@ -213,6 +221,14 @@ fi
|
|||||||
if [[ $RELEASE_TYPE == stable ]]; then
|
if [[ $RELEASE_TYPE == stable ]]; then
|
||||||
stable_or_beta=yes
|
stable_or_beta=yes
|
||||||
fi
|
fi
|
||||||
|
save_version=$(grep -w src/Config.template.h -e "#define SAVE_VERSION" | cut -d ' ' -f 3)
|
||||||
|
minor_version=$(grep -w src/Config.template.h -e "#define MINOR_VERSION" | cut -d ' ' -f 3)
|
||||||
|
build_num=$(grep -w src/Config.template.h -e "#define BUILD_NUM" | cut -d ' ' -f 3)
|
||||||
|
if [[ $stable_or_beta == yes ]] && [[ $MOD_ID != 0 ]]; then
|
||||||
|
save_version=$(echo $RELEASE_NAME | cut -d '.' -f 1)
|
||||||
|
minor_version=$(echo $RELEASE_NAME | cut -d '.' -f 2)
|
||||||
|
build_num=$(echo $RELEASE_NAME | cut -d '.' -f 3)
|
||||||
|
fi
|
||||||
if [[ $RELEASE_TYPE == snapshot ]]; then
|
if [[ $RELEASE_TYPE == snapshot ]]; then
|
||||||
meson_configure+=$'\t'-Dsnapshot=true
|
meson_configure+=$'\t'-Dsnapshot=true
|
||||||
meson_configure+=$'\t'-Dsnapshot_id=$(echo $RELEASE_NAME | cut -d '-' -f 2) # $RELEASE_NAME is snapshot-X
|
meson_configure+=$'\t'-Dsnapshot_id=$(echo $RELEASE_NAME | cut -d '-' -f 2) # $RELEASE_NAME is snapshot-X
|
||||||
@@ -343,3 +359,33 @@ if [[ $BSH_HOST_PLATFORM == android ]]; then
|
|||||||
ANDROID_KEYSTORE_PASS=bagelsbagels ninja android/powder.apk
|
ANDROID_KEYSTORE_PASS=bagelsbagels ninja android/powder.apk
|
||||||
mv android/powder.apk powder.apk
|
mv android/powder.apk powder.apk
|
||||||
fi
|
fi
|
||||||
|
if [[ $PACKAGE_APPIMAGE == yes ]]; then
|
||||||
|
cp resources/appdata.xml appdata.xml
|
||||||
|
sed -i "s|SUBST_DATE|$(date --iso-8601)|g" appdata.xml
|
||||||
|
sed -i "s|SUBST_SAVE_VERSION|$save_version|g" appdata.xml
|
||||||
|
sed -i "s|SUBST_MINOR_VERSION|$minor_version|g" appdata.xml
|
||||||
|
sed -i "s|SUBST_BUILD_NUM|$build_num|g" appdata.xml
|
||||||
|
case $BSH_HOST_ARCH in
|
||||||
|
aarch64) appimage_arch=aarch64;;
|
||||||
|
arm) appimage_arch=armhf ;;
|
||||||
|
x86) appimage_arch=i686 ;;
|
||||||
|
x86_64) appimage_arch=x86_64 ;;
|
||||||
|
esac
|
||||||
|
curl -fsSLo appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$appimage_arch.AppImage"
|
||||||
|
curl -fsSLo AppRun "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-$appimage_arch"
|
||||||
|
chmod +x appimagetool
|
||||||
|
chmod +x AppRun
|
||||||
|
mkdir -p ThePowderToy.AppDir/usr/bin
|
||||||
|
mkdir -p ThePowderToy.AppDir/usr/share/metainfo
|
||||||
|
mkdir -p ThePowderToy.AppDir/usr/share/applications
|
||||||
|
mkdir -p ThePowderToy.AppDir/usr/share/icons
|
||||||
|
cp powder ThePowderToy.AppDir/usr/bin/powder
|
||||||
|
mv AppRun ThePowderToy.AppDir/AppRun
|
||||||
|
cp ../resources/icon/powder-128.png ThePowderToy.AppDir/powder.png
|
||||||
|
cp resources/powder.desktop ThePowderToy.AppDir/uk.co.powdertoy.tpt.desktop
|
||||||
|
cp appdata.xml ThePowderToy.AppDir/usr/share/metainfo/uk.co.powdertoy.tpt.appdata.xml
|
||||||
|
cp ThePowderToy.AppDir/powder.png ThePowderToy.AppDir/usr/share/icons/powder.png
|
||||||
|
cp ThePowderToy.AppDir/uk.co.powdertoy.tpt.desktop ThePowderToy.AppDir/usr/share/applications/uk.co.powdertoy.tpt.desktop
|
||||||
|
./appimagetool ThePowderToy.AppDir
|
||||||
|
[[ -f $APPIMAGE_ASSET_PATH ]]
|
||||||
|
fi
|
||||||
|
44
.github/prepare.py
vendored
44
.github/prepare.py
vendored
@@ -44,25 +44,26 @@ with open('.github/mod_id.txt') as f:
|
|||||||
|
|
||||||
build_matrix = []
|
build_matrix = []
|
||||||
publish_matrix = []
|
publish_matrix = []
|
||||||
for bsh_host_arch, bsh_host_platform, bsh_host_libc, bsh_static_dynamic, bsh_build_platform, runs_on, package_suffix, publish, artifact, debug_suffix, starcatcher_suffix in [
|
# consider disabling line wrapping to edit this monstrosity
|
||||||
( 'x86_64', 'linux', 'gnu', 'static', 'linux', 'ubuntu-18.04', '', True, True, '.dbg', 'x86_64-lin-gcc-static' ),
|
for bsh_host_arch, bsh_host_platform, bsh_host_libc, bsh_static_dynamic, bsh_build_platform, runs_on, package_suffix, publish, artifact, debug_suffix, starcatcher_suffix, package_appimage in [
|
||||||
( 'x86_64', 'linux', 'gnu', 'dynamic', 'linux', 'ubuntu-18.04', '', False, False, None, '' ),
|
( 'x86_64', 'linux', 'gnu', 'static', 'linux', 'ubuntu-18.04', '', True, True, '.dbg', 'x86_64-lin-gcc-static', True ),
|
||||||
# ( 'x86_64', 'windows', 'mingw', 'static', 'linux', 'ubuntu-20.04', '', False, True, '.dbg', '' ), # ubuntu-20.04 doesn't have windows TLS headers somehow and I haven't yet figured out how to get them
|
( 'x86_64', 'linux', 'gnu', 'dynamic', 'linux', 'ubuntu-18.04', '', False, False, None, '', False ),
|
||||||
( 'x86_64', 'windows', 'mingw', 'dynamic', 'linux', 'ubuntu-20.04', '', False, False, None, '' ),
|
# ( 'x86_64', 'windows', 'mingw', 'static', 'linux', 'ubuntu-20.04', '', False, True, '.dbg', '', False ), # ubuntu-20.04 doesn't have windows TLS headers somehow and I haven't yet figured out how to get them
|
||||||
( 'x86_64', 'windows', 'mingw', 'static', 'windows', 'windows-2019', '.exe', False, True, '.dbg', '' ),
|
( 'x86_64', 'windows', 'mingw', 'dynamic', 'linux', 'ubuntu-20.04', '', False, False, None, '', False ),
|
||||||
( 'x86_64', 'windows', 'mingw', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
( 'x86_64', 'windows', 'mingw', 'static', 'windows', 'windows-2019', '.exe', False, True, '.dbg', '', False ),
|
||||||
( 'x86_64', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', 'x86_64-win-msvc-static' ),
|
( 'x86_64', 'windows', 'mingw', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '', False ),
|
||||||
( 'x86_64', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
( 'x86_64', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', 'x86_64-win-msvc-static', False ),
|
||||||
( 'x86', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', 'i686-win-msvc-static' ),
|
( 'x86_64', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '', False ),
|
||||||
( 'x86', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
( 'x86', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', 'i686-win-msvc-static', False ),
|
||||||
( 'x86_64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, 'x86_64-mac-gcc-static' ), # I have no idea how to separate debug info on macos
|
( 'x86', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '', False ),
|
||||||
( 'x86_64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '' ),
|
( 'x86_64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, 'x86_64-mac-gcc-static', False ), # I have no idea how to separate debug info on macos
|
||||||
( 'aarch64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, 'arm64-mac-gcc-static' ),
|
( 'x86_64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '', False ),
|
||||||
# ( 'aarch64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '' ), # macos-11.0 is x86_64 and I haven't yet figured out how to get homebrew to install aarch64 libs on x86_64
|
( 'aarch64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, 'arm64-mac-gcc-static', False ),
|
||||||
( 'x86', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'i686-and-gcc-static' ),
|
# ( 'aarch64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '', False ), # macos-11.0 is x86_64 and I haven't yet figured out how to get homebrew to install aarch64 libs on x86_64
|
||||||
( 'x86_64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'x86_64-and-gcc-static' ),
|
( 'x86', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'i686-and-gcc-static', False ),
|
||||||
( 'arm', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'arm-and-gcc-static' ),
|
( 'x86_64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'x86_64-and-gcc-static', False ),
|
||||||
( 'aarch64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'arm64-and-gcc-static' ),
|
( 'arm', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'arm-and-gcc-static', False ),
|
||||||
|
( 'aarch64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', 'arm64-and-gcc-static', False ),
|
||||||
]:
|
]:
|
||||||
separate_debug = True
|
separate_debug = True
|
||||||
if not debug_suffix:
|
if not debug_suffix:
|
||||||
@@ -77,6 +78,8 @@ for bsh_host_arch, bsh_host_platform, bsh_host_libc, bsh_static_dynamic, bsh_bui
|
|||||||
asset_name = f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{package_suffix}'
|
asset_name = f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{package_suffix}'
|
||||||
debug_asset_path = f'powder{debug_suffix}'
|
debug_asset_path = f'powder{debug_suffix}'
|
||||||
debug_asset_name = f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{debug_suffix}'
|
debug_asset_name = f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{debug_suffix}'
|
||||||
|
appimage_asset_path = f'The_Powder_Toy-{bsh_host_arch}.AppImage'
|
||||||
|
appimage_asset_name = f'The_Powder_Toy-{bsh_host_arch}.AppImage'
|
||||||
starcatcher_name = f'powder-{release_name}-{starcatcher_suffix}{package_suffix}'
|
starcatcher_name = f'powder-{release_name}-{starcatcher_suffix}{package_suffix}'
|
||||||
build_matrix.append({
|
build_matrix.append({
|
||||||
'bsh_build_platform': bsh_build_platform, # part of the unique portion of the matrix
|
'bsh_build_platform': bsh_build_platform, # part of the unique portion of the matrix
|
||||||
@@ -90,10 +93,13 @@ for bsh_host_arch, bsh_host_platform, bsh_host_libc, bsh_static_dynamic, bsh_bui
|
|||||||
'publish': publish_release and 'yes' or 'no',
|
'publish': publish_release and 'yes' or 'no',
|
||||||
'artifact': artifact_release and 'yes' or 'no',
|
'artifact': artifact_release and 'yes' or 'no',
|
||||||
'separate_debug': separate_debug and 'yes' or 'no',
|
'separate_debug': separate_debug and 'yes' or 'no',
|
||||||
|
'package_appimage': package_appimage and 'yes' or 'no',
|
||||||
'asset_path': asset_path,
|
'asset_path': asset_path,
|
||||||
'asset_name': asset_name,
|
'asset_name': asset_name,
|
||||||
'debug_asset_path': debug_asset_path,
|
'debug_asset_path': debug_asset_path,
|
||||||
'debug_asset_name': debug_asset_name,
|
'debug_asset_name': debug_asset_name,
|
||||||
|
'appimage_asset_path': appimage_asset_path,
|
||||||
|
'appimage_asset_name': appimage_asset_name,
|
||||||
})
|
})
|
||||||
if publish_release:
|
if publish_release:
|
||||||
publish_matrix.append({
|
publish_matrix.append({
|
||||||
|
7
.github/workflows/build.yaml
vendored
7
.github/workflows/build.yaml
vendored
@@ -80,6 +80,8 @@ jobs:
|
|||||||
ASSET_PATH: ${{ matrix.asset_path }}
|
ASSET_PATH: ${{ matrix.asset_path }}
|
||||||
DEBUG_ASSET_PATH: ${{ matrix.debug_asset_path }}
|
DEBUG_ASSET_PATH: ${{ matrix.debug_asset_path }}
|
||||||
SEPARATE_DEBUG: ${{ matrix.separate_debug }}
|
SEPARATE_DEBUG: ${{ matrix.separate_debug }}
|
||||||
|
PACKAGE_APPIMAGE: ${{ matrix.package_appimage }}
|
||||||
|
APPIMAGE_ASSET_PATH: ${{ matrix.appimage_asset_path }}
|
||||||
- uses: LBPHacker/upload-release-asset@v2 # TODO-NTL: ship licenses
|
- uses: LBPHacker/upload-release-asset@v2 # TODO-NTL: ship licenses
|
||||||
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes'
|
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes'
|
||||||
env:
|
env:
|
||||||
@@ -108,6 +110,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: build/${{ matrix.debug_asset_path }}
|
path: build/${{ matrix.debug_asset_path }}
|
||||||
name: ${{ matrix.debug_asset_name }}
|
name: ${{ matrix.debug_asset_name }}
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: matrix.artifact == 'yes' && matrix.package_appimage == 'yes'
|
||||||
|
with:
|
||||||
|
path: build/${{ matrix.appimage_asset_path }}
|
||||||
|
name: ${{ matrix.appimage_asset_name }}
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build, prepare]
|
needs: [build, prepare]
|
||||||
|
@@ -29,6 +29,6 @@
|
|||||||
<url type="bugtracker">https://github.com/The-Powder-Toy/The-Powder-Toy/issues</url>
|
<url type="bugtracker">https://github.com/The-Powder-Toy/The-Powder-Toy/issues</url>
|
||||||
<url type="help">https://powdertoy.co.uk/Wiki/W/Main_Page.html</url>
|
<url type="help">https://powdertoy.co.uk/Wiki/W/Main_Page.html</url>
|
||||||
<releases>
|
<releases>
|
||||||
<release date="@BSH_DATE@" version="@SAVE_VERSION@.@MINOR_VERSION@" />
|
<release date="SUBST_DATE" version="SUBST_SAVE_VERSION.SUBST_MINOR_VERSION.SUBST_BUILD_NUM" />
|
||||||
</releases>
|
</releases>
|
||||||
</component>
|
</component>
|
||||||
|
@@ -18,3 +18,9 @@ data_files += to_array.process(configure_file(
|
|||||||
output: 'powder.desktop',
|
output: 'powder.desktop',
|
||||||
configuration: conf_data,
|
configuration: conf_data,
|
||||||
), extra_args: 'powder_desktop')
|
), extra_args: 'powder_desktop')
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'appdata.template.xml',
|
||||||
|
output: 'appdata.xml',
|
||||||
|
configuration: conf_data,
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user