Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for local macOS signed builds #4582

Merged
merged 77 commits into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e8efd4e
Test
pajlada Apr 22, 2023
4d89861
test
pajlada Apr 22, 2023
d83e320
add skip_venv option to this
pajlada Apr 23, 2023
5d63e4b
test ffb8a395
pajlada Apr 23, 2023
12dd517
test 2dd909ec
pajlada Apr 23, 2023
77f7b4a
test 3749d665
pajlada Apr 23, 2023
5aa2228
test 23ee1ff2
pajlada Apr 23, 2023
b62f63a
test 6362fd68
pajlada Apr 23, 2023
3d374d9
test 090d50ff
pajlada Apr 23, 2023
2a56107
test a3d6acc0
pajlada Apr 23, 2023
2cba26d
test 3766597e
pajlada Apr 23, 2023
ca41b42
test 291f2dfe
pajlada Apr 23, 2023
449c69c
test 4a4e839b
pajlada Apr 23, 2023
48d0f10
test 8de289dc
pajlada Apr 23, 2023
7b04579
test d62c2f62
pajlada Apr 23, 2023
9af65a8
test 6cb669fa
pajlada Apr 23, 2023
530a421
test 7b3c0a7c
pajlada Apr 23, 2023
59c0251
test d31b8bd9
pajlada Apr 23, 2023
a5e47a0
test 8f3b9746
pajlada Apr 23, 2023
6df09ae
test 75dd94ac
pajlada Apr 23, 2023
7891002
test 39efee6b
pajlada Apr 23, 2023
d346f50
test e35a6579
pajlada Apr 23, 2023
c3cd37a
test 47e1a628
pajlada Apr 23, 2023
985bafa
test 3d4b85b3
pajlada Apr 23, 2023
8ed6676
test f94831f0
pajlada Apr 23, 2023
1d19e39
test 063296ae
pajlada Apr 23, 2023
db4dea1
test 2d078436
pajlada Apr 23, 2023
e6abc07
test 9d122c4e
pajlada Apr 23, 2023
135ec28
test 3ab03f68
pajlada Apr 23, 2023
90e219b
test 28ffdc52
pajlada Apr 23, 2023
246163c
test cea79245
pajlada Apr 23, 2023
bde7f58
test 00d601c2
pajlada Apr 23, 2023
3e0f943
test 1a521de5
pajlada Apr 23, 2023
056e67f
test 4514b39d
pajlada Apr 23, 2023
401d4ac
test 40529e9e
pajlada Apr 23, 2023
b2669c9
test 016ef2b0
pajlada Apr 23, 2023
ddd15db
test ae02ae39
pajlada Apr 23, 2023
a5a5751
test 4d9e7354
pajlada Apr 23, 2023
1a0db72
Add ability to codesign the app
pajlada Apr 23, 2023
5f9acef
Enable set -e in createdmg script
pajlada Apr 23, 2023
1ff1040
codesign DEEP
pajlada Apr 23, 2023
bd3a6d4
test f31982ea
pajlada Apr 23, 2023
de3c088
asd
pajlada Apr 23, 2023
deabc40
test c55d933a
pajlada Apr 23, 2023
197621a
test
pajlada Apr 24, 2023
2e44a89
test
pajlada Apr 24, 2023
ef459b3
DMG output path now specified as an env variable for CreateDMG.sh
pajlada Apr 27, 2023
463f016
test
pajlada Apr 27, 2023
f1e64f5
test
pajlada Apr 27, 2023
efd62b8
test
pajlada Apr 27, 2023
10a22ce
test
pajlada Apr 27, 2023
69cf3c1
test
pajlada Apr 27, 2023
8ba802f
test
pajlada Apr 27, 2023
d255de8
test
pajlada Apr 27, 2023
a6e97fa
test
pajlada Apr 27, 2023
8b62beb
test 04d35ba3
pajlada Apr 28, 2023
d6fb68b
Only replace artifacts, don't remove them
pajlada Apr 28, 2023
fc04945
test f809f44f
pajlada Apr 28, 2023
ec31dc6
Split up CreateDMG.sh script
pajlada Apr 28, 2023
31a8f33
test d7f0429b
pajlada Apr 28, 2023
b36a4a9
test 58608f7f
pajlada Apr 28, 2023
8fb6169
test e095f4f7
pajlada Apr 29, 2023
e1c6750
test e8c7862b
pajlada Apr 29, 2023
91714c1
test 53dfdae6
pajlada Apr 29, 2023
a8a8e41
force sign
pajlada Apr 29, 2023
61edade
Codesign the chatterino.app before dmgbuilding
pajlada Apr 29, 2023
7ff6c8b
test f65d2379
pajlada Apr 29, 2023
0f1b50f
test 5bfe1956
pajlada Apr 29, 2023
f36f5b6
test 9e58441b
pajlada Apr 29, 2023
e2eb47c
test d4e629bb
pajlada Apr 29, 2023
2bfa9e5
test c383c907
pajlada Apr 29, 2023
3248e34
test 7b9565a4
pajlada Apr 29, 2023
ade2d73
test 34c2eed7
pajlada Apr 29, 2023
948c6b2
Don't call the shellscripts with the `sh` command
pajlada Apr 29, 2023
8878c75
Undo change to Version.cpp
pajlada Apr 29, 2023
04dd8c4
Fix dmg path output filename to match old name
pajlada Apr 29, 2023
4ae6bbb
Update error on missing OUTPUT_DMG_PATH environment variable
pajlada Apr 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions .CI/CreateDMG.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
#!/bin/sh
#!/usr/bin/env bash

if [ -d bin/chatterino.app ] && [ ! -d chatterino.app ]; then
>&2 echo "Moving bin/chatterino.app down one directory"
mv bin/chatterino.app chatterino.app
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 [ -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"
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 "$_QT_DIR" ]; then
export PATH="${_QT_DIR}/bin:$PATH"
else
echo "No Qt environment variable set, assuming system-installed Qt"
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 MACDEPLOYQT"
macdeployqt chatterino.app
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
echo "Running dmgbuild.."
dmgbuild --settings ./../.CI/dmg-settings.py -D app=./chatterino.app Chatterino2 chatterino-macos-Qt-$1.dmg
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
39 changes: 39 additions & 0 deletions .CI/MacDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/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
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,15 @@ jobs:

- name: Package (MacOS)
if: startsWith(matrix.os, 'macos')
env:
OUTPUT_DMG_PATH: chatterino-macos-Qt-${{ matrix.qt-version}}.dmg
run: |
ls -la
pwd
ls -la build || true
cd build
sh ./../.CI/CreateDMG.sh ${{ matrix.qt-version }}
./../.CI/MacDeploy.sh
./../.CI/CreateDMG.sh
shell: bash

- name: Upload artifact (MacOS)
Expand Down Expand Up @@ -439,7 +442,7 @@ jobs:
- name: Create release
uses: ncipollo/release-action@v1.12.0
with:
removeArtifacts: true
replacesArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "release-artifacts/*"
Expand Down