Clean up Mac build a bit
This commit is contained in:
@@ -83,8 +83,6 @@ jobs:
|
|||||||
|
|
||||||
buildMac:
|
buildMac:
|
||||||
needs: buildAssets
|
needs: buildAssets
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -109,14 +107,14 @@ jobs:
|
|||||||
- name: Upload App Zip
|
- name: Upload App Zip
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: novelWriter-${{ env.VERSION }}-macos.app.zip
|
name: novelWriter-${{ env.VERSION }}.app.zip
|
||||||
path: dist_macos/novelWriter-${{ env.VERSION }}-macos.app.zip
|
path: dist_macos/novelWriter-*.app.zip
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: Upload DMG
|
- name: Upload DMG
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: novelWriter-${{ env.VERSION }}-macos.dmg
|
name: novelWriter-${{ env.VERSION }}.dmg
|
||||||
path: dist_macos/novelWriter-${{ env.VERSION }}-macos.dmg
|
path: dist_macos/novelWriter-*.dmg
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
+11
-15
@@ -12,8 +12,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||||||
SRC_DIR="$SCRIPT_DIR/../.."
|
SRC_DIR="$SCRIPT_DIR/../.."
|
||||||
RLS_DIR="$SRC_DIR/dist_macos"
|
RLS_DIR="$SRC_DIR/dist_macos"
|
||||||
|
|
||||||
echo "Script Dir: $SCRIPT_DIR"
|
|
||||||
|
|
||||||
cleanup () {
|
cleanup () {
|
||||||
if [ -d "$BUILD_DIR" ]; then
|
if [ -d "$BUILD_DIR" ]; then
|
||||||
rm -rf "$BUILD_DIR"
|
rm -rf "$BUILD_DIR"
|
||||||
@@ -21,14 +19,14 @@ cleanup () {
|
|||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
echo "Script Dir: $SCRIPT_DIR"
|
||||||
echo "Building in: $BUILD_DIR"
|
echo "Building in: $BUILD_DIR"
|
||||||
|
|
||||||
OLD_CWD="$(pwd)"
|
# --- Prepare Files ----------------------------------------------------------------------------- #
|
||||||
VERSION="$(awk '/^__version__/{print substr($NF,2,length($NF)-2)}' $SRC_DIR/novelwriter/__init__.py)"
|
|
||||||
|
|
||||||
pushd "$SRC_DIR" || exit 1
|
pushd "$SRC_DIR" || exit 1
|
||||||
|
|
||||||
# --- Prepare Files ----------------------------------------------------------------------------- #
|
VERSION="$(python3 setup.py version)"
|
||||||
|
|
||||||
echo "Generating Info.plist"
|
echo "Generating Info.plist"
|
||||||
python3 setup.py gen-plist
|
python3 setup.py gen-plist
|
||||||
@@ -68,7 +66,6 @@ pushd "$BUILD_DIR"/ || exit 1
|
|||||||
|
|
||||||
# --- Create Miniconda Env ---------------------------------------------------------------------- #
|
# --- Create Miniconda Env ---------------------------------------------------------------------- #
|
||||||
|
|
||||||
# install Miniconda, a self-contained Python distribution
|
|
||||||
echo "Downloading Miniconda ..."
|
echo "Downloading Miniconda ..."
|
||||||
curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
|
curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
|
||||||
bash Miniconda3-latest-MacOSX-x86_64.sh -b -p ~/miniconda -f
|
bash Miniconda3-latest-MacOSX-x86_64.sh -b -p ~/miniconda -f
|
||||||
@@ -76,7 +73,7 @@ rm Miniconda3-latest-MacOSX-x86_64.sh
|
|||||||
export PATH="$HOME/miniconda/bin:$PATH"
|
export PATH="$HOME/miniconda/bin:$PATH"
|
||||||
|
|
||||||
echo "Creating conda env ..."
|
echo "Creating conda env ..."
|
||||||
# create conda env
|
|
||||||
conda create -n novelWriter -c conda-forge python=3.10 --yes
|
conda create -n novelWriter -c conda-forge python=3.10 --yes
|
||||||
source activate novelWriter
|
source activate novelWriter
|
||||||
|
|
||||||
@@ -93,7 +90,8 @@ conda deactivate
|
|||||||
# --- Build App --------------------------------------------------------------------------------- #
|
# --- Build App --------------------------------------------------------------------------------- #
|
||||||
|
|
||||||
echo "Building app bundle ..."
|
echo "Building app bundle ..."
|
||||||
# create .app Framework
|
|
||||||
|
# Create .app Framework
|
||||||
mkdir -p novelWriter.app/Contents/
|
mkdir -p novelWriter.app/Contents/
|
||||||
mkdir novelWriter.app/Contents/MacOS novelWriter.app/Contents/Resources novelWriter.app/Contents/Resources/novelWriter
|
mkdir novelWriter.app/Contents/MacOS novelWriter.app/Contents/Resources novelWriter.app/Contents/Resources/novelWriter
|
||||||
cp $SRC_DIR/setup/macos/Info.plist novelWriter.app/Contents/Info.plist
|
cp $SRC_DIR/setup/macos/Info.plist novelWriter.app/Contents/Info.plist
|
||||||
@@ -130,13 +128,12 @@ chmod a+x novelWriter.app/Contents/MacOS/novelWriter
|
|||||||
# echo "Signing bundle ..."
|
# echo "Signing bundle ..."
|
||||||
# sudo codesign --sign - --deep --force --entitlements "$SCRIPT_DIR/../macos/App.entitlements" --options runtime "novelWriter.app/Contents/MacOS/novelWriter"
|
# sudo codesign --sign - --deep --force --entitlements "$SCRIPT_DIR/../macos/App.entitlements" --options runtime "novelWriter.app/Contents/MacOS/novelWriter"
|
||||||
|
|
||||||
# Remove bloat
|
|
||||||
pushd novelWriter.app/Contents/Resources || exit 1
|
|
||||||
|
|
||||||
# --- Cleanup ----------------------------------------------------------------------------------- #
|
# --- Cleanup ----------------------------------------------------------------------------------- #
|
||||||
|
|
||||||
echo "Cleaning unused files from bundle ..."
|
echo "Cleaning unused files from bundle ..."
|
||||||
# cleanup commands HERE
|
|
||||||
|
pushd novelWriter.app/Contents/Resources || exit 1
|
||||||
find . -type d -iname '__pycache__' -print0 | xargs -0 rm -r
|
find . -type d -iname '__pycache__' -print0 | xargs -0 rm -r
|
||||||
|
|
||||||
rm -rf pkgs
|
rm -rf pkgs
|
||||||
@@ -146,7 +143,7 @@ rm -rf share/{gtk-,}doc
|
|||||||
# Remove the files from the 3.1 symlink
|
# Remove the files from the 3.1 symlink
|
||||||
rm -rf lib/python3.1
|
rm -rf lib/python3.1
|
||||||
|
|
||||||
# remove web engine
|
# Remove web engine
|
||||||
rm lib/python3.*/site-packages/PyQt5/QtWebEngine* || true
|
rm lib/python3.*/site-packages/PyQt5/QtWebEngine* || true
|
||||||
rm -r lib/python3.*/site-packages/PyQt5/Qt/translations/qtwebengine* || true
|
rm -r lib/python3.*/site-packages/PyQt5/Qt/translations/qtwebengine* || true
|
||||||
rm lib/python3.*/site-packages/PyQt5/Qt/resources/qtwebengine* || true
|
rm lib/python3.*/site-packages/PyQt5/Qt/resources/qtwebengine* || true
|
||||||
@@ -167,7 +164,7 @@ pushd $BUILD_DIR || exit 1
|
|||||||
zip -qr novelWriter.app.zip novelWriter.app
|
zip -qr novelWriter.app.zip novelWriter.app
|
||||||
popd || exit 1
|
popd || exit 1
|
||||||
|
|
||||||
mv -v $BUILD_DIR/novelWriter.app.zip $RLS_DIR/novelWriter-"${VERSION}"-macos.app.zip
|
mv -v $BUILD_DIR/novelWriter.app.zip $RLS_DIR/novelWriter-"${VERSION}".app.zip
|
||||||
|
|
||||||
# --- Create DMG -------------------------------------------------------------------------------- #
|
# --- Create DMG -------------------------------------------------------------------------------- #
|
||||||
|
|
||||||
@@ -175,8 +172,7 @@ mv -v $BUILD_DIR/novelWriter.app.zip $RLS_DIR/novelWriter-"${VERSION}"-macos.app
|
|||||||
echo "Packageing DMG ..."
|
echo "Packageing DMG ..."
|
||||||
brew install create-dmg
|
brew install create-dmg
|
||||||
|
|
||||||
# "--skip-jenkins" is a temporary workaround for https://github.com/create-dmg/create-dmg/issues/72
|
|
||||||
create-dmg --volname "novelWriter $VERSION" --volicon $SRC_DIR/setup/macos/novelwriter.icns \
|
create-dmg --volname "novelWriter $VERSION" --volicon $SRC_DIR/setup/macos/novelwriter.icns \
|
||||||
--window-pos 200 120 --window-size 800 400 --icon-size 100 \
|
--window-pos 200 120 --window-size 800 400 --icon-size 100 \
|
||||||
--icon novelWriter.app 200 190 --hide-extension novelWriter.app \
|
--icon novelWriter.app 200 190 --hide-extension novelWriter.app \
|
||||||
--app-drop-link 600 185 $RLS_DIR/novelWriter-"${VERSION}"-macos.dmg "$BUILD_DIR"/
|
--app-drop-link 600 185 $RLS_DIR/novelWriter-"${VERSION}".dmg "$BUILD_DIR"/
|
||||||
|
|||||||
Reference in New Issue
Block a user