Skip to content

Commit

Permalink
Merge pull request #8 from spn21/master
Browse files Browse the repository at this point in the history
🐛 fix macos builds
  • Loading branch information
Reverier-Xu authored May 28, 2024
2 parents d78af55 + 106b51b commit 5e64a38
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
APP_NAME: "WebSocketReflectorX"
APP_VERSION: "0.2.9"
APP_VERSION: "0.2.10"

#-------------------------------------------------------------------------------
# Workflow jobs
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr.yaml → .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
paths-ignore:
- '**/README.md'
branches:
- 'master'
pull_request:
workflow_dispatch:

Expand All @@ -16,7 +18,7 @@ on:

env:
APP_NAME: "WebSocketReflectorX"
APP_VERSION: "0.2.9"
APP_VERSION: "0.2.10"
QT_VERSION: "6.7.1"

#-------------------------------------------------------------------------------
Expand Down
26 changes: 1 addition & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
APP_NAME: "WebSocketReflectorX"
APP_VERSION: "0.2.9"
APP_VERSION: "0.2.10"
QT_VERSION: "6.7.1"

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -111,13 +111,6 @@ jobs:
- name: Deploy application
run: ./deploy_macos.sh -c -p

# Upload application ZIP
- name: Upload application ZIP
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-x86_64.zip
path: ${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-x86_64.zip

# Upload application DMG
- name: Upload application DMG
uses: actions/upload-artifact@v4
Expand All @@ -130,7 +123,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-x86_64.zip
${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-x86_64.dmg
## macOS build ###############################################################
Expand Down Expand Up @@ -171,13 +163,6 @@ jobs:
- name: Deploy application
run: ./deploy_macos.sh -c -p

# Upload application ZIP
- name: Upload application ZIP
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-arm64.zip
path: ${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-arm64.zip

# Upload application DMG
- name: Upload application DMG
uses: actions/upload-artifact@v4
Expand All @@ -190,7 +175,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-arm64.zip
${{env.APP_NAME}}-${{env.APP_VERSION}}-macOS-arm64.dmg
## Windows build #############################################################
Expand Down Expand Up @@ -240,13 +224,6 @@ jobs:
- name: Deploy application
run: sh deploy_windows.sh -c -p

# Upload application ZIP
- name: Upload application ZIP
uses: actions/upload-artifact@v4
with:
name: ${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.zip
path: ${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.zip

# Upload NSIS installer
- name: Upload NSIS installer
uses: actions/upload-artifact@v4
Expand All @@ -260,4 +237,3 @@ jobs:
with:
files: |
${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.exe
${{env.APP_NAME}}-${{env.APP_VERSION}}-win64.zip
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20)

set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 9)
set(VERSION_PATCH 10)

execute_process(
COMMAND git describe --always --dirty
Expand Down
62 changes: 6 additions & 56 deletions deploy_linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env bash

export APP_NAME="WebSocketReflectorX"
export APP_VERSION=0.2.9
export APP_VERSION=0.2.10
export GIT_VERSION=$(git rev-parse --short HEAD)

echo "> $APP_NAME packager (Linux x86_64) [v$APP_VERSION]"

## CHECKS ######################################################################

if [ "$(id -u)" == "0" ]; then
echo "This script MUST NOT be run as root" 1>&2
exit 1
Expand All @@ -18,51 +16,15 @@ if [ ${PWD##*/} != $APP_NAME ]; then
exit 1
fi

## SETTINGS ####################################################################

use_contribs=false
make_install=false
create_package=false
upload_package=false

while [[ $# -gt 0 ]]
do
case $1 in
-c|--contribs)
use_contribs=true
;;
-i|--install)
make_install=true
;;
-p|--package)
create_package=true
;;
-u|--upload)
upload_package=true
;;
*)
echo "> Unknown argument '$1'"
;;
esac
shift # skip argument or value
done

## COPY FILES ##################################################################

mkdir -p dist
APP_ROOT=dist
strip ./build/bin/wsrx
install -D ./build/bin/wsrx "${APP_ROOT}/usr/bin/wsrx"
install -D ./build/bin/wsrx-desktop "${APP_ROOT}/usr/bin/wsrx-desktop"
install -Dm644 "./freedesktop/tech.woooo.wsrx.desktop" "$APP_ROOT"/usr/share/applications/tech.woooo.wsrx.desktop
install -Dm644 "./freedesktop/tech.woooo.wsrx.svg" "$APP_ROOT"/usr/share/icons/hicolor/scalable/apps/tech.woooo.wsrx.svg

## DEPLOY ######################################################################

if [[ $use_contribs = true ]] ; then
export LD_LIBRARY_PATH=$(pwd)/contribs/src/env/linux_x86_64/usr/lib/:/usr/lib
else
export LD_LIBRARY_PATH=/usr/lib/
fi
export LD_LIBRARY_PATH=$(pwd)/contribs/src/env/linux_x86_64/usr/lib/:/usr/lib

echo '---- Prepare linuxdeploy + plugins'

Expand All @@ -85,22 +47,10 @@ chmod a+x contribs/deploy/linuxdeploy-x86_64.AppImage
chmod a+x contribs/deploy/linuxdeploy-plugin-appimage-x86_64.AppImage
chmod a+x contribs/deploy/linuxdeploy-plugin-qt-x86_64.AppImage

# linuxdeploy settings
export EXTRA_QT_PLUGINS="svg;"
export EXTRA_PLATFORM_PLUGINS="libqxcb.so;libqwayland-egl.so;libqwayland-generic.so"
export QML_SOURCES_PATHS="desktop/ui:desktop/components"
## PACKAGE (AppImage) ##########################################################

if [[ $create_package = true ]] ; then
echo '---- Running AppImage packager'
./contribs/deploy/linuxdeploy-x86_64.AppImage --appdir $APP_ROOT --plugin qt --output appimage
mv $APP_NAME-x86_64.AppImage $APP_NAME-$APP_VERSION-linux64.AppImage
fi

## UPLOAD ######################################################################

if [[ $upload_package = true ]] ; then
printf "---- Uploading to transfer.sh"
curl --upload-file $APP_NAME*.AppImage https://transfer.sh/$APP_NAME-$APP_VERSION-git$GIT_VERSION-linux64.AppImage
printf "\n"
fi
echo '---- Running AppImage packager'
./contribs/deploy/linuxdeploy-x86_64.AppImage --appdir $APP_ROOT --plugin qt --output appimage
mv $APP_NAME-x86_64.AppImage $APP_NAME-$APP_VERSION-linux64.AppImage
70 changes: 9 additions & 61 deletions deploy_macos.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env bash

export APP_NAME="WebSocketReflectorX"
export APP_VERSION=0.2.9
export APP_VERSION=0.2.10
export GIT_VERSION=$(git rev-parse --short HEAD)

echo "> $APP_NAME packager (macOS x86_64) [v$APP_VERSION]"

## CHECKS ######################################################################

if [ "$(id -u)" == "0" ]; then
echo "This script MUST NOT be run as root" 1>&2
exit 1
Expand All @@ -17,67 +15,17 @@ if [ ${PWD##*/} != $APP_NAME ]; then
echo "This script MUST be run from the $APP_NAME/ directory"
exit 1
fi

## SETTINGS ####################################################################

use_contribs=false
make_install=false
create_package=false
upload_package=false

while [[ $# -gt 0 ]]
do
case $1 in
-c|--contribs)
use_contribs=true
;;
-i|--install)
make_install=true
;;
-p|--package)
create_package=true
;;
-u|--upload)
upload_package=true
;;
*)
echo "> Unknown argument '$1'"
;;
esac
shift # skip argument or value
done

## DEPLOY ######################################################################

CPU_ARCH=$(uname -m)

if [[ $use_contribs = true ]] ; then
export LD_LIBRARY_PATH=$(pwd)/contribs/src/env/macOS_x86_64/usr/lib/
else
export LD_LIBRARY_PATH=/usr/local/lib/
fi
export LD_LIBRARY_PATH=$(pwd)/contribs/src/env/macOS_x86_64/usr/lib/

echo '---- Running macdeployqt'
strip build/bin/wsrx
cp build/bin/wsrx build/bin/wsrx-desktop.app/Contents/MacOS/wsrx
cp -r build/bin/wsrx-desktop.app $APP_NAME.app
macdeployqt $APP_NAME.app -qmldir=./desktop/components -qmldir=./desktop/ui -hardened-runtime -timestamp -appstore-compliant -dmg

#echo '---- Installation directory content recap (after macdeployqt):'
#find bin/

## PACKAGE (zip) ###############################################################

if [[ $create_package = true ]] ; then
echo '---- Compressing package'
zip -r -y -X $APP_NAME-$APP_VERSION-macOS-$CPU_ARCH.zip $APP_NAME.app
mv $APP_NAME.dmg $APP_NAME-$APP_VERSION-macOS-$CPU_ARCH.dmg
fi

## UPLOAD ######################################################################

if [[ $upload_package = true ]] ; then
printf "---- Uploading to transfer.sh"
curl --upload-file $APP_NAME*.zip https://transfer.sh/$APP_NAME.$APP_VERSION-git$GIT_VERSION-macOS-$CPU_ARCH.zip
curl --upload-file $APP_NAME*.dmg https://transfer.sh/$APP_NAME.$APP_VERSION-git$GIT_VERSION-macOS-$CPU_ARCH.dmg
printf "\n"
fi
macdeployqt $APP_NAME.app -qmldir=./desktop/components -qmldir=./desktop/ui -hardened-runtime -timestamp
find $APP_NAME.app/ -name "*.dSYM" | xargs rm -rf
sleep 3
hdiutil create $APP_NAME-tmp.dmg -ov -volname $APP_NAME -fs HFS+ -srcfolder ./$APP_NAME.app
hdiutil convert $APP_NAME-tmp.dmg -format UDZO -o $APP_NAME.dmg
mv $APP_NAME.dmg $APP_NAME-$APP_VERSION-macOS-$CPU_ARCH.dmg
70 changes: 7 additions & 63 deletions deploy_windows.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

export APP_NAME="WebSocketReflectorX"
export APP_VERSION=0.2.9
export APP_VERSION=0.2.10
export GIT_VERSION=$(git rev-parse --short HEAD)

echo "> $APP_NAME packager (Windows x86_64) [v$APP_VERSION]"
Expand All @@ -13,77 +13,21 @@ if [ ${PWD##*/} != $APP_NAME ]; then
exit 1
fi

## SETTINGS ####################################################################

use_contribs=false
make_install=false
create_package=false
upload_package=false

while [[ $# -gt 0 ]]
do
case $1 in
-c|--contribs)
use_contribs=true
;;
-i|--install)
make_install=true
;;
-p|--package)
create_package=true
;;
-u|--upload)
upload_package=true
;;
*)
echo "> Unknown argument '$1'"
;;
esac
shift # skip argument or value
done

## APP INSTALL #################################################################

echo '---- Running make install'
mkdir -p dist
APP_ROOT=dist
cp ./build/bin/wsrx.exe "${APP_ROOT}/wsrx.exe"
cp ./build/bin/wsrx-desktop.exe "${APP_ROOT}/wsrx-desktop.exe"
#echo '---- Installation directory content recap (after make install):'
#find bin/

## DEPLOY ######################################################################

echo '---- Running windeployqt'
windeployqt $APP_ROOT/ --qmldir ./desktop/ui --qmldir ./desktop/components

#echo '---- Installation directory content recap (after windeployqt):'
#find bin/

mv $APP_ROOT $APP_NAME

## PACKAGE (zip) ###############################################################
echo '---- Compressing package'
7z a $APP_NAME-$APP_VERSION-win64.zip $APP_NAME

if [[ $create_package = true ]] ; then
echo '---- Compressing package'
7z a $APP_NAME-$APP_VERSION-win64.zip $APP_NAME
fi

## PACKAGE (NSIS) ##############################################################

if [[ $create_package = true ]] ; then
echo '---- Creating installer'
mv $APP_NAME windows/$APP_NAME
makensis windows/setup.nsi
mv windows/*.exe $APP_NAME-$APP_VERSION-win64.exe
fi

## UPLOAD ######################################################################

if [[ $upload_package = true ]] ; then
printf "---- Uploading to transfer.sh"
curl --upload-file $APP_NAME*.zip https://transfer.sh/$APP_NAME-$APP_VERSION-git$GIT_VERSION-win64.zip
printf "\n"
curl --upload-file $APP_NAME*.exe https://transfer.sh/$APP_NAME-$APP_VERSION-git$GIT_VERSION-win64.exe
printf "\n"
fi
echo '---- Creating installer'
mv $APP_NAME windows/$APP_NAME
makensis windows/setup.nsi
mv windows/*.exe $APP_NAME-$APP_VERSION-win64.exe
Loading

0 comments on commit 5e64a38

Please sign in to comment.