From 69fea29f1e144404c6bcad25929d92e9e470ad93 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Sun, 16 Feb 2020 11:34:49 +0100 Subject: [PATCH] Add macOS release CI job The builds have all optional features turned off to avoid dealing with static linking of additional libraries. --- .github/workflows/macos.yml | 76 +++++++++++++++++++++++++++++++ contrib/README.md | 1 + contrib/macos/Info.plist.template | 50 ++++++++++++++++++++ contrib/macos/PkgInfo | 1 + 4 files changed, 128 insertions(+) create mode 100644 contrib/macos/Info.plist.template create mode 100644 contrib/macos/PkgInfo diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 795fadbb..0e003107 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 diff --git a/contrib/README.md b/contrib/README.md index 73b62c58..f8213711 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -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 diff --git a/contrib/macos/Info.plist.template b/contrib/macos/Info.plist.template new file mode 100644 index 00000000..d7df164c --- /dev/null +++ b/contrib/macos/Info.plist.template @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + en + + CFBundleDisplayName + dosbox-staging + + CFBundleExecutable + dosbox + + CFBundleIconFile + dosbox-staging.icns + + CFBundleInfoDictionaryVersion + 6.0 + + CFBundleName + dosbox-staging + + CFBundlePackageType + APPL + + CFBundleShortVersionString + 0.75.0 + + CFBundleVersion + %VERSION% + + NSHumanReadableCopyright + Copyright 2002-2020 The DOSBox Team + + NSPrincipalClass + NSApplication + + CGDisableCoalescedUpdates + + + LSMinimumSystemVersionByArchitecture + + x86_64 + 10.10.0 + + + diff --git a/contrib/macos/PkgInfo b/contrib/macos/PkgInfo new file mode 100644 index 00000000..6f749b0f --- /dev/null +++ b/contrib/macos/PkgInfo @@ -0,0 +1 @@ +APPL????