1
0
Fork 0

Add macOS release CI job

The builds have all optional features turned off to avoid dealing with
static linking of additional libraries.
This commit is contained in:
Patryk Obara 2020-02-16 11:34:49 +01:00 committed by Patryk Obara
parent a5ade1ba5c
commit 69fea29f1e
4 changed files with 128 additions and 0 deletions

View file

@ -29,3 +29,79 @@ jobs:
env:
MAX_WARNINGS: ${{ matrix.conf.max_warnings }}
run: python3 ./scripts/count-warnings.py build.log
build_macos_release:
name: Release build
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install C++ compiler and libraries
run: brew install librsvg $(./scripts/list-build-dependencies.sh -m brew -c clang)
- name: Log environment
run: ./scripts/log-env.sh
- name: Inject version string
run: |
set -x
export VERSION=$(git describe --abbrev=5)
sed -i -e "s/AC_INIT(dosbox,git)/AC_INIT(dosbox,$VERSION)/" configure.ac
echo ::set-env name=VERSION::$VERSION
- name: Build
env:
FLAGS: -O3 -DNDEBUG -pipe
run: |
set -x
./autogen.sh
# FIXME temporarily disable everything aside SDL2 due to linking issues
./configure \
--enable-sdl-static \
--disable-opus-cdda \
--disable-screenshots \
--disable-network \
CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"
gmake -j "$(sysctl -n hw.physicalcpu)"
strip src/dosbox
otool -L src/dosbox
- name: Package
run: |
set -x
# Generate icon
make -C contrib/icons/ dosbox-staging.icns
dst=dist/dosbox-staging.app/Contents/
# Prepare content
install -d "$dst/MacOS/"
install -d "$dst/Resources/"
install -d "$dst/SharedSupport/"
install "src/dosbox" "$dst/MacOS/"
install -m 644 "contrib/macos/Info.plist.template" "$dst/Info.plist"
install -m 644 "contrib/macos/PkgInfo" "$dst/PkgInfo"
install -m 644 "contrib/icons/dosbox-staging.icns" "$dst/Resources/"
install -m 644 "docs/README.template" "$dst/SharedSupport/README"
install -m 644 "COPYING" "$dst/SharedSupport/COPYING"
install -m 644 "README" "$dst/SharedSupport/manual.txt"
install -m 644 "docs/README.video" "$dst/SharedSupport/video.txt"
# Fill README template file
sed -i -e "s|%VERSION%|${{ env.VERSION }}|" "$dst/Info.plist"
sed -i -e "s|%GIT_COMMIT%|$GITHUB_SHA|" "$dst/SharedSupport/README"
sed -i -e "s|%GIT_BRANCH%|${GITHUB_REF#refs/heads/}|" "$dst/SharedSupport/README"
sed -i -e "s|%GITHUB_REPO%|$GITHUB_REPOSITORY|" "$dst/SharedSupport/README"
ln -s /Applications dist/
hdiutil create \
-volname "dosbox-staging" \
-srcfolder dist \
-ov -format UDZO "dosbox-staging-macOS-${{ env.VERSION }}.dmg"
- name: Upload disk image
uses: actions/upload-artifact@master
# GitHub automatically zips the artifacts, and there's no option
# to skip it or upload a file only.
with:
name: dosbox-staging-macOS-x86_64
path: dosbox-staging-macOS-${{ env.VERSION }}.dmg

View file

@ -10,4 +10,5 @@ itself.
and .icns formats; read icons.md file for details
- **static-opus**: Compiles a static Opusfile library that can be used
by `./configure` in the absense of `pkg-config`
- **macos**: Files required for creating macOS App bundle

View file

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>dosbox-staging</string>
<key>CFBundleExecutable</key>
<string>dosbox</string>
<key>CFBundleIconFile</key>
<string>dosbox-staging.icns</string>
<!--
<key>CFBundleIdentifier</key>
<string>io.github.dosbox-staging</string>
-->
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>dosbox-staging</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.75.0</string>
<key>CFBundleVersion</key>
<string>%VERSION%</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2002-2020 The DOSBox Team</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CGDisableCoalescedUpdates</key>
<true/>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.10.0</string>
</dict>
</dict>
</plist>

1
contrib/macos/PkgInfo Normal file
View file

@ -0,0 +1 @@
APPL????