[CI] Mac OS app (#6955)

* use 7z instead of dmg
* osx: use always writable paths
reviewable/pr6978/r1
Martín Fernández 3 years ago committed by GitHub
parent a0eb91d6ab
commit 4345201e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,34 @@
name: test
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- name: XCode version
run: xcode-select -p
- name: Check out Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Homebrew install dependencies
# Compared to the README, adds ccache for faster compilation times and removes sh5sum to prevent some conflict with coreutils
# Compared to the emulator, adds p7zip and removes sdl2.
run: brew install ccache nasm ragel binutils coreutils libtool autoconf automake cmake makedepend lua@5.1 luarocks gettext pkg-config wget p7zip
- name: Building in progress…
run: export MACOSX_DEPLOYMENT_TARGET=10.14 PATH="/usr/local/opt/gettext/bin:$PATH" && ./kodev release macos
- name: Uploading artifacts
uses: actions/upload-artifact@v2
with:
name: osx-artifacts
path: '*.7z'

@ -18,7 +18,8 @@ function DataStorage:getDataDir()
-- confined ubuntu app has write access to this dir -- confined ubuntu app has write access to this dir
data_dir = string.format("%s/%s", os.getenv("XDG_DATA_HOME"), package_name) data_dir = string.format("%s/%s", os.getenv("XDG_DATA_HOME"), package_name)
elseif os.getenv("APPIMAGE") or os.getenv("KO_MULTIUSER") then elseif os.getenv("APPIMAGE") or os.getenv("KO_MULTIUSER") then
data_dir = string.format("%s/%s/%s", os.getenv("HOME"), ".config", "koreader") local user_rw = jit.os == "OSX" and "Library/Application Support" or ".config"
data_dir = string.format("%s/%s/%s", os.getenv("HOME"), user_rw, "koreader")
else else
data_dir = "." data_dir = "."
end end

@ -185,15 +185,10 @@ for path in l10n/*; do
fi fi
done done
# package as DMG if create-dmg is available
# reduces size from 80MB to 40MB
mv "${APP_PATH}" "${APP_BUNDLE}.app" mv "${APP_PATH}" "${APP_BUNDLE}.app"
if command_exists "create-dmg"; then # package as 7z reduces size from 80MB to 30MB
# create KOReader-$VERSION.dmg with KOReader.app inside if command_exists "7z"; then
create-dmg "${APP_BUNDLE}.app" --overwrite 7z a -l -m0=lzma2 -mx=9 "${APP_BUNDLE}-${VERSION}.7z" "${APP_BUNDLE}.app"
rm -rf "${APP_BUNDLE}.app" rm -rfv "${APP_BUNDLE}.app"
else
# rename as KOReader-$VERSION.app
mv -v "${APP_BUNDLE}.app" "${APP_BUNDLE}-${VERSION}.app"
fi fi

Loading…
Cancel
Save