mirror-chatterino2/.CI/MacDeploy.sh
pajlada 4c23f4bcea
Allow for local macOS signed builds (#4582)
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.
2023-04-29 16:07:20 +02:00

40 lines
989 B
Bash
Executable file

#!/usr/bin/env bash
# Bundle relevant qt & system dependencies into the ./chatterino.app folder
set -eo pipefail
if [ -d bin/chatterino.app ] && [ ! -d chatterino.app ]; then
>&2 echo "Moving bin/chatterino.app down one directory"
mv bin/chatterino.app chatterino.app
fi
if [ -n "$Qt5_DIR" ]; then
echo "Using Qt DIR from Qt5_DIR: $Qt5_DIR"
_QT_DIR="$Qt5_DIR"
elif [ -n "$Qt6_DIR" ]; then
echo "Using Qt DIR from Qt6_DIR: $Qt6_DIR"
_QT_DIR="$Qt6_DIR"
fi
if [ -n "$_QT_DIR" ]; then
export PATH="${_QT_DIR}/bin:$PATH"
else
echo "No Qt environment variable set, assuming system-installed Qt"
fi
echo "Running MACDEPLOYQT"
_macdeployqt_args=()
if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
_macdeployqt_args+=("-codesign=$MACOS_CODESIGN_CERTIFICATE")
fi
macdeployqt chatterino.app "${_macdeployqt_args[@]}"
if [ -n "$MACOS_CODESIGN_CERTIFICATE" ]; then
# Validate that chatterino.app was codesigned correctly
codesign -v chatterino.app
fi