mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
4c23f4bcea
Split up the CreateDMG.sh macos script to two scripts: MacDeploy.sh - this calls macdeployqt on the built app CreateDMG.sh - this calls dmgbuild on the built & deployed app Add a `SKIP_VENV` environment variable to CreateDMG.sh, this can be used to use the system version of dmgbuild Add the ability to codesign the created dmg and its contents using the `MACOS_CODESIGN_CERTIFICATE` environment variable Moved the output name logic from CreateDMG to the `OUTPUT_DMG_PATH` environment variable The nightly release create job also doesn't remove artifacts now, it only replaces artifacts that are conflicting. The downside to this is that if we change the name of an artifact, we need to manually delete the old artifact. The upside to this is that we can now upload artifacts that are not handled in the same CI job.
38 lines
1.1 KiB
Bash
Executable file
38 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
if [ ! -d chatterino.app ]; then
|
|
echo "ERROR: No 'chatterino.app' dir found in the build directory. Make sure you've run ./CI/MacDeploy.sh"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$OUTPUT_DMG_PATH" ]; then
|
|
echo "ERROR: Must specify the path for where to save the final .dmg. Make sure you've set the OUTPUT_DMG_PATH environment variable."
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$SKIP_VENV" ]; then
|
|
echo "Creating python3 virtual environment"
|
|
python3 -m venv venv
|
|
echo "Entering python3 virtual environment"
|
|
. venv/bin/activate
|
|
echo "Installing dmgbuild"
|
|
python3 -m pip install dmgbuild
|
|
fi
|
|
|
|
if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
|
|
echo "Codesigning force deep inside the app"
|
|
codesign -s "$MACOS_CODESIGN_CERTIFICATE" --deep --force chatterino.app
|
|
echo "Done!"
|
|
fi
|
|
|
|
echo "Running dmgbuild.."
|
|
dmgbuild --settings ./../.CI/dmg-settings.py -D app=./chatterino.app Chatterino2 "$OUTPUT_DMG_PATH"
|
|
echo "Done!"
|
|
|
|
if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
|
|
echo "Codesigning the dmg"
|
|
codesign -s "$MACOS_CODESIGN_CERTIFICATE" --deep --force "$OUTPUT_DMG_PATH"
|
|
echo "Done!"
|
|
fi
|