8000 Add a release script by cspiegel · Pull Request #936 · garglk/garglk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a release script #936

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

Merged
merged 1 commit into from
Jun 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 0 additions & 18 deletions all_windows.sh

This file was deleted.

7 changes: 6 additions & 1 deletion gargoyle-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ set -ex

frankendrift="OFF"

while getopts "f" o
while getopts "cf" o
do
case "${o}" in
c)
clean=1
;;
f)
frankendrift="ON"
;;
Expand All @@ -20,6 +23,8 @@ do
esac
done

[[ -n "${clean}" ]] && rm -rf build-appimage build/dist

mkdir build-appimage
cd build-appimage
xargs -n 1 -P 0 wget -q <<EOF
Expand Down
19 changes: 16 additions & 3 deletions gargoyle_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ fatal() {
exit 1
}

GARGOYLE_CLEAN=
GARGOYLE_FRANKENDRIFT="OFF"
GARGOYLE_NO_DMG=
GARGOYLE_CMAKE_EXTRAS=""

while getopts "f" o
while getopts "cfn" o
do
case "${o}" in
c)
GARGOYLE_CLEAN=1
;;
f)
GARGOYLE_FRANKENDRIFT="ON"
;;
n)
GARGOYLE_NO_DMG=1
;;
*)
fatal "Usage: $0 [-f]"
;;
Expand Down Expand Up @@ -113,6 +121,8 @@ mkdir -p "$BUNDLE/Resources/Fonts"
mkdir -p "$BUNDLE/Resources/themes"
mkdir -p "$BUNDLE/PlugIns"

[[ -n "${GARGOYLE_CLEAN}" ]] && rm -rf build-osx build/dist

rm -rf $GARGDIST
mkdir -p build-osx
cd build-osx
Expand Down Expand Up @@ -201,7 +211,10 @@ cp themes/*.json $BUNDLE/Resources/themes

codesign -s - -f --deep Gargoyle.app

echo "Creating DMG..."
hdiutil create -fs "HFS+J" -ov -srcfolder Gargoyle.app/ "gargoyle-$GARVERSION-$TARGET_ARCH.dmg"
if [[ -z "${GARGOYLE_NO_DMG}" ]]
then
echo "Creating DMG..."
hdiutil create -fs "HFS+J" -ov -srcfolder Gargoyle.app/ "gargoyle-$GARVERSION-$TARGET_ARCH.dmg"
fi

echo "Done."
92 changes: 92 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash

set -eux

# Simplify the building of releases.
#
# Options:
#
# -a: Build an AppImage (x86_64) on Linux.
# -m: Build both x86_64 and ARM DMG on Mac.
# -n: Notarize the resulting binary (Mac only).
# -w: Build i686 and x86_64 Windows installers and standalone ZIPs,
# and aarch64 and armv7 Windows standalone ZIPs via MinGW.

fatal() {
echo "${@}" >&2
exit 1
}

build_appimage=
build_mac=
build_windows=
notarize=

while getopts "amnw" o
do
case "${o}" in
a)
build_appimage=1
;;
m)
build_mac=1
;;
n)
notarize=1
;;
w)
build_windows=1
;;
*)
fatal "Usage: $0 [-amnw]"
;;
esac
done

if [[ "${build_appimage}" ]]
then
./gargoyle-appimage.sh -c
fi

if [[ "${build_mac}" ]]
then
if ! security show-keychain-info login.keychain > /dev/null 2>&1
then
echo "Keychain is locked; unlock before continuing"
security unlock-keychain login.keychain
fi

rm -rf Gargoyle.app Gargoyle-x86_64.app
PATH=/usr/local/bin:$PATH ./gargoyle_osx.sh -c -n
mv Gargoyle.app Gargoyle-x86_64.app
PATH=/opt/homebrew/bin:$PATH ./gargoyle_osx.sh -c -n

binaries=(Gargoyle.app/Contents/Frameworks/*.dylib Gargoyle.app/Contents/PlugIns/* Gargoyle.app/Contents/MacOS/Gargoyle)

for binary in "${binaries[@]}"
do
src="Gargoyle-x86_64.app/${binary#Gargoyle.app/}"
lipo -create "${binary}" "${src}" -output "${binary}"
done

codesign -f -o runtime --sign "${APPLE_CERT_NAME}" "${binaries[@]}" Gargoyle.app
ditto -c -k --keepParent Gargoyle.app Gargoyle.zip

if [[ "${notarize}" ]]
then
xcrun notarytool submit Gargoyle.zip --apple-id "${APPLE_ID}" --team-id "${APPLE_TEAM_ID}" --wait
xcrun stapler staple Gargoyle.app
fi

dmg_filename="Gargoyle-$(<VERSION).dmg"
rm -f "${dmg_filename}"
hdiutil create -fs "HFS+J" -ov -srcfolder Gargoyle.app/ "${dmg_filename}"
fi

if [[ "${build_windows}" ]]
then
for arch in i686 x86_64 aarch64 armv7
do
./windows.sh -cq -a "${arch}"
done
fi
7 changes: 6 additions & 1 deletion windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fatal() {
QT_VERSION="5"
GARGOYLE_SOUND="SDL"

while getopts "6a:bgq" o
while getopts "6a:bcgq" o
do
case "${o}" in
6)
Expand All @@ -41,6 +41,9 @@ do
b)
GARGOYLE_BUILD_ONLY=1
;;
c)
GARGOYLE_CLEAN=1
;;
g)
GARGOYLE_MINGW_GCC=1
;;
Expand Down Expand Up @@ -69,6 +72,8 @@ esac

target="${GARGOYLE_ARCH}-w64-mingw32"

[[ -n "${GARGOYLE_CLEAN}" ]] && rm -rf build-mingw build/dist

[[ -e build/dist ]] && exit 1

if [[ -n "${GARGOYLE_MINGW_GCC}" ]]
Expand Down
Loading
0