mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
[CI] Mac OS app (#6955)
* use 7z instead of dmg * osx: use always writable paths
This commit is contained in:
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal file
@@ -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
|
||||
data_dir = string.format("%s/%s", os.getenv("XDG_DATA_HOME"), package_name)
|
||||
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
|
||||
data_dir = "."
|
||||
end
|
||||
|
||||
@@ -185,15 +185,10 @@ for path in l10n/*; do
|
||||
fi
|
||||
done
|
||||
|
||||
# package as DMG if create-dmg is available
|
||||
# reduces size from 80MB to 40MB
|
||||
mv "${APP_PATH}" "${APP_BUNDLE}.app"
|
||||
|
||||
if command_exists "create-dmg"; then
|
||||
# create KOReader-$VERSION.dmg with KOReader.app inside
|
||||
create-dmg "${APP_BUNDLE}.app" --overwrite
|
||||
rm -rf "${APP_BUNDLE}.app"
|
||||
else
|
||||
# rename as KOReader-$VERSION.app
|
||||
mv -v "${APP_BUNDLE}.app" "${APP_BUNDLE}-${VERSION}.app"
|
||||
# package as 7z reduces size from 80MB to 30MB
|
||||
if command_exists "7z"; then
|
||||
7z a -l -m0=lzma2 -mx=9 "${APP_BUNDLE}-${VERSION}.7z" "${APP_BUNDLE}.app"
|
||||
rm -rfv "${APP_BUNDLE}.app"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user