Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 119 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,124 @@ jobs:
name: PollyMC-Continued-Linux-AppImage
path: PollyMC-Continued-Linux-x86_64.AppImage

build-macos:
name: macOS (Universal)
runs-on: macos-26
permissions:
contents: read
env:
ARTIFACT_NAME: macOS-universal
ARTIFACT_ARCH: universal
BUILD_PLATFORM: macOS-universal
BUILD_TYPE: Release
EXPECTED_ARCHS: arm64 x86_64
EXPECTED_MIN_MACOS: "12.0"
MACOSX_DEPLOYMENT_TARGET: "12.0"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install build tools
run: |
brew update
brew install ninja extra-cmake-modules temurin@17 mono
echo "JAVA_HOME=$(/usr/libexec/java_home -v 17)" >> "$GITHUB_ENV"
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> "$GITHUB_ENV"

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
aqtversion: "==3.1.*"
version: 6.9.3
modules: qtimageformats qtnetworkauth
cache: true

- name: Configure
run: |
cmake --preset macos_universal \
-DCMAKE_OSX_DEPLOYMENT_TARGET="$MACOSX_DEPLOYMENT_TARGET" \
-DLauncher_BUILD_RELEASE=ON

- name: Read and validate version
id: version
run: |
VERSION=$(cmake -N -LA build | sed -n 's/^Launcher_VERSION:STRING=//p')
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid Launcher_VERSION: $VERSION" >&2
exit 1
fi
if [[ "$GITHUB_REF" == refs/tags/v* && "v$VERSION" != "$GITHUB_REF_NAME" ]]; then
echo "Tag $GITHUB_REF_NAME does not match launcher version $VERSION" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Build
run: cmake --build --preset macos_universal --config "$BUILD_TYPE"

- name: Test
run: ctest --test-dir build --build-config "$BUILD_TYPE" --output-on-failure

- name: Import signing certificate
env:
APPLE_CODESIGN_CERT: ${{ secrets.APPLE_CODESIGN_CERT }}
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
APPLE_CODESIGN_PASSWORD: ${{ secrets.APPLE_CODESIGN_PASSWORD }}
run: |
if [[ -z "$APPLE_CODESIGN_CERT" && -z "$APPLE_CODESIGN_ID" ]]; then
echo "No Apple signing certificate configured; the artifact will be ad-hoc signed."
exit 0
fi
if [[ -z "$APPLE_CODESIGN_CERT" || -z "$APPLE_CODESIGN_ID" || -z "$APPLE_CODESIGN_PASSWORD" ]]; then
echo "Apple signing secrets are only partially configured." >&2
exit 1
fi
KEYCHAIN_PATH="$RUNNER_TEMP/pollymc-build.keychain-db"
CERTIFICATE_PATH="$RUNNER_TEMP/pollymc-codesign.p12"
printf '%s' "$APPLE_CODESIGN_CERT" | base64 --decode > "$CERTIFICATE_PATH"
security create-keychain -p "$APPLE_CODESIGN_PASSWORD" "$KEYCHAIN_PATH"
security default-keychain -s "$KEYCHAIN_PATH"
security unlock-keychain -p "$APPLE_CODESIGN_PASSWORD" "$KEYCHAIN_PATH"
security import "$CERTIFICATE_PATH" -k "$KEYCHAIN_PATH" -P "$APPLE_CODESIGN_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$APPLE_CODESIGN_PASSWORD" "$KEYCHAIN_PATH"
echo "KEYCHAIN_PATH=$KEYCHAIN_PATH" >> "$GITHUB_ENV"

- name: Package app, ZIP, and DMG
env:
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
APPLE_NOTARIZE_APPLE_ID: ${{ secrets.APPLE_NOTARIZE_APPLE_ID }}
APPLE_NOTARIZE_TEAM_ID: ${{ secrets.APPLE_NOTARIZE_TEAM_ID }}
APPLE_NOTARIZE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
run: |
packaging/macos/package.sh \
build \
install-macos \
dist-macos \
"${{ steps.version.outputs.version }}" \
"$BUILD_TYPE"

- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: PollyMC-Continued-macOS-${{ steps.version.outputs.version }}
path: |
dist-macos/PollyMC-Continued-${{ steps.version.outputs.version }}-macOS-universal.zip
dist-macos/PollyMC-Continued-${{ steps.version.outputs.version }}-macOS-universal.dmg
dist-macos/PollyMC-Continued-${{ steps.version.outputs.version }}-macOS-universal.sha256
if-no-files-found: error

- name: Remove temporary signing keychain
if: ${{ always() }}
run: |
if [[ -n "${KEYCHAIN_PATH:-}" && -f "$KEYCHAIN_PATH" ]]; then
security delete-keychain "$KEYCHAIN_PATH"
fi

release:
name: Publish Release
needs: [build-windows, build-linux]
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
permissions:
Expand Down Expand Up @@ -425,3 +540,6 @@ jobs:
PollyMC-Continued-*-Setup.exe
PollyMC-Continued-*-Windows-portable.zip
PollyMC-Continued-Linux-x86_64.AppImage
PollyMC-Continued-*-macOS-universal.zip
PollyMC-Continued-*-macOS-universal.dmg
PollyMC-Continued-*-macOS-universal.sha256
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ build
# Install dirs
install
/install-*
/dist-*

# Ctags File
tags
Expand Down
36 changes: 24 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cmake_minimum_required(VERSION 3.25) # Required for features like `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`

project(Launcher LANGUAGES C CXX)
set(Launcher_VERSION "9.0.8" CACHE STRING "Launcher version in MAJOR.MINOR.PATCH format")
if(Launcher_VERSION STREQUAL "")
set(Launcher_VERSION "9.0.8" CACHE STRING "Launcher version in MAJOR.MINOR.PATCH format" FORCE)
endif()
if(NOT Launcher_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
message(FATAL_ERROR "Launcher_VERSION must use MAJOR.MINOR.PATCH format (got '${Launcher_VERSION}')")
endif()

project(Launcher VERSION "${Launcher_VERSION}" LANGUAGES C CXX)
if(APPLE)
enable_language(OBJC OBJCXX)
endif()
Expand Down Expand Up @@ -157,6 +165,7 @@ if(ENABLE_LTO)
endif()

option(BUILD_TESTING "Build the testing tree." ON)
option(Launcher_BUILD_RELEASE "Hide Git branch metadata from public release artifacts." OFF)

find_package(ECM NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH};${CMAKE_MODULE_PATH}")
Expand All @@ -178,10 +187,6 @@ set(Launcher_LOGIN_CALLBACK_URL "https://login.live.com/oauth20_desktop.srf" CAC
set(Launcher_LEGACY_FMLLIBS_BASE_URL "https://files.prismlauncher.org/fmllibs/" CACHE STRING "URL for legacy (<=1.5.2) FML Libraries.")

######## Set version numbers ########
set(Launcher_VERSION_MAJOR 9)
set(Launcher_VERSION_MINOR 0)
set(Launcher_VERSION_PATCH 0)

set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}")
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.${Launcher_VERSION_PATCH}.0")
set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_MINOR},${Launcher_VERSION_PATCH},0")
Expand Down Expand Up @@ -275,6 +280,12 @@ include(GetGitRevisionDescription)
git_get_exact_tag(Launcher_GIT_TAG)
get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT)

if(Launcher_BUILD_RELEASE)
# Use stable metadata in packaged builds.
set(Launcher_GIT_REFSPEC "refs/heads/stable")
set(Launcher_GIT_TAG "${Launcher_VERSION_NAME}")
endif()

message(STATUS "Git commit: ${Launcher_GIT_COMMIT}")
message(STATUS "Git tag: ${Launcher_GIT_TAG}")
message(STATUS "Git refspec: ${Launcher_GIT_REFSPEC}")
Expand All @@ -287,7 +298,7 @@ set(Launcher_BUILD_TIMESTAMP "${TODAY}")
# Find the required Qt parts
if(Launcher_QT_VERSION_MAJOR EQUAL 6)
set(QT_VERSION_MAJOR 6)
find_package(Qt6 6.4 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml NetworkAuth OpenGL WebSockets)
find_package(Qt6 6.4 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml NetworkAuth OpenGL Svg WebSockets)
find_package(Qt6 COMPONENTS DBus)
list(APPEND Launcher_QT_DBUS Qt6::DBus)
else()
Expand Down Expand Up @@ -360,11 +371,11 @@ endif()

if(UNIX AND APPLE)
set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(LIBRARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(PLUGIN_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")
set(LIBRARY_DEST_DIR "${Launcher_Name}.app/Contents/Frameworks")
set(PLUGIN_DEST_DIR "${Launcher_Name}.app/Contents/PlugIns")
set(FRAMEWORK_DEST_DIR "${Launcher_Name}.app/Contents/Frameworks")
set(RESOURCES_DEST_DIR "${Launcher_Name}.app/Contents/Resources")
set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/MacOS/jars")
set(JARS_DEST_DIR "${Launcher_Name}.app/Contents/Resources/jars")

# Mac bundle settings
set(MACOSX_BUNDLE_BUNDLE_NAME "${Launcher_DisplayName}")
Expand All @@ -390,7 +401,8 @@ if(UNIX AND APPLE)
install(FILES ${Launcher_Branding_ICNS} DESTINATION ${RESOURCES_DEST_DIR} RENAME ${Launcher_Name}.icns)

find_program(ACTOOL_EXE actool DOC "Path to the apple asset catalog compiler")
if(ACTOOL_EXE)
set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_MAC_ICON}")
if(ACTOOL_EXE AND EXISTS "${ICON_SOURCE}")
execute_process(
COMMAND xcodebuild -version
OUTPUT_VARIABLE XCODE_VERSION_OUTPUT
Expand All @@ -407,7 +419,6 @@ if(UNIX AND APPLE)
if(XCODE_VERSION VERSION_GREATER_EQUAL 26.0)
set(ASSETS_OUT_DIR "${CMAKE_BINARY_DIR}/program_info")
set(GENERATED_ASSETS_CAR "${ASSETS_OUT_DIR}/Assets.car")
set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_MAC_ICON}")

add_custom_command(
OUTPUT "${GENERATED_ASSETS_CAR}"
Expand All @@ -428,7 +439,8 @@ if(UNIX AND APPLE)
else()
message(WARNING "Xcode ${XCODE_VERSION} is too old. Minimum required version is 26.0. Not compiling liquid glass icons.")
endif()

elseif(NOT EXISTS "${ICON_SOURCE}")
message(STATUS "Modern macOS icon source '${ICON_SOURCE}' is not present; using the bundled ICNS icon")
else()
message(WARNING "actool not found. Cannot compile macOS app icons.\n"
"Install Xcode command line tools: 'xcode-select --install'")
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PollyMC-Continued lets you play Minecraft **without needing a Microsoft account*

## Download

Grab the latest release from the [Releases](https://github.com/SharathGames1/PollyMC/releases) page.
Grab the latest release from the [Releases](https://github.com/corecommit/PollyMC-Continued/releases) page.

## Building

Expand Down Expand Up @@ -49,6 +49,31 @@ cmake --install . --prefix C:/pollymc_build
"/c/Program Files (x86)/NSIS/makensis.exe" pollymc_installer.nsi
```

### macOS

Install the dependencies:

```bash
brew install cmake ninja qt extra-cmake-modules cmark qrencode libarchive tomlplusplus
brew install --cask temurin@17
```

Build, test and package the native version for the current Mac:

```bash
bash packaging/macos/build-local.sh
```

The script uses the current macOS major version as the default deployment target, avoiding invalid or incompatible local bundles built against Homebrew libraries. Override it when needed:

```bash
MACOSX_DEPLOYMENT_TARGET=15.0 bash packaging/macos/build-local.sh
```

The resulting `dist-macos` directory contains a ready-to-run `PollyMC.app`, ZIP, DMG and SHA-256 checksums. The locally generated DMG file receives the same Finder icon as the application. The DMG also contains `PollyMC.app` and an `Applications` shortcut for normal drag-and-drop installation.

The custom icon attached to the local DMG file is stored in a macOS resource fork. Release hosting services may discard that metadata, while the icon of the mounted DMG volume remains embedded in the disk image.

## Credits

- [Prism Launcher](https://github.com/PrismLauncher/PrismLauncher) — the base launcher
Expand Down
8 changes: 5 additions & 3 deletions cmake/MacOSXBundleInfo.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleDisplayName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
Expand All @@ -42,8 +44,8 @@
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>NSHumanReadableCopyright</key>
Expand Down
3 changes: 3 additions & 0 deletions launcher/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,9 @@ QString Application::getJarPath(QString jarFile)
QStringList potentialPaths = {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
#endif
#if defined(Q_OS_MACOS)
FS::PathCombine(applicationDirPath(), "..", "Resources", "jars"),
#endif
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
Expand Down
Loading