diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23904a0..c09f08d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,8 @@ name: Packages -# Builds the .deb, .rpm, pacman, Flatpak and AppImage packages and the -# MSIX for the Microsoft Store, installs each one on a clean system and -# starts the app there. Pushing a v* tag (or running the +# Builds the .deb, .rpm, pacman, Flatpak and AppImage packages, the MSIX +# for the Microsoft Store and the macOS .dmg, installs each one on a clean +# system and starts the app there. Pushing a v* tag (or running the # workflow by hand with a tag) also publishes them as a GitHub release. on: push: @@ -11,6 +11,8 @@ on: paths: - 'packaging/**' - 'crates/cr-win/package/**' + - 'macos/Package/**' + - 'macos/scripts/**' - 'data/**' - '.github/workflows/release.yml' workflow_dispatch: @@ -370,8 +372,53 @@ jobs: name: wack-report path: wack.xml + # The Mac app for Apple Silicon, macOS 14 or newer, signed ad hoc: there + # is no Apple developer account (decision P29). + dmg: + needs: version + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: macos/scripts/make-bindings.sh + - run: macos/scripts/make-app.sh + env: + VERSION: ${{ needs.version.outputs.version }} + - uses: actions/upload-artifact@v4 + with: + name: dmg + path: target/macos/*.dmg + + # Copies the app from the .dmg into Applications as a user does, checks + # its signature and starts it: it has to keep running with its window. + test-dmg: + needs: dmg + runs-on: macos-15 + steps: + - uses: actions/download-artifact@v4 + with: + name: dmg + - name: Install from the .dmg + run: | + hdiutil attach -nobrowse -mountpoint /Volumes/CoreRules CoreRules-*.dmg + test -f "/Volumes/CoreRules/Read Me First.txt" + test -L /Volumes/CoreRules/Applications + cp -R "/Volumes/CoreRules/Core Rules.app" /Applications/ + hdiutil detach /Volumes/CoreRules + codesign --verify --strict "/Applications/Core Rules.app" + lipo -archs "/Applications/Core Rules.app/Contents/MacOS/CoreRules" | grep -qx arm64 + /usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "/Applications/Core Rules.app/Contents/Info.plist" + - name: Start the app + run: | + open "/Applications/Core Rules.app" + sleep 20 + pgrep -x CoreRules || { echo "the app is not running 20 seconds after it started"; exit 1; } + osascript -e 'tell application "System Events" to count windows of process "CoreRules"' || true + pkill -x CoreRules + release: - needs: [version, test-deb, refuse-deb, test-rpm, test-arch, test-appimage, test-flatpak, test-msix] + needs: [version, test-deb, refuse-deb, test-rpm, test-arch, test-appimage, test-flatpak, test-msix, test-dmg] if: needs.version.outputs.tag != '' runs-on: ubuntu-24.04 permissions: @@ -390,8 +437,9 @@ jobs: with: tag_name: ${{ needs.version.outputs.tag }} target_commitish: ${{ github.sha }} - # 0.x releases are betas; a -rc suffix is a release candidate. - name: Core Rules ${{ needs.version.outputs.version }}${{ contains(needs.version.outputs.version, '-rc') && ' release candidate' || startsWith(needs.version.outputs.version, '0.') && ' beta' || '' }} + # 0.x releases and a -beta suffix are betas; a -rc suffix is a + # release candidate. + name: Core Rules ${{ needs.version.outputs.version }}${{ contains(needs.version.outputs.version, '-rc') && ' release candidate' || (startsWith(needs.version.outputs.version, '0.') || contains(needs.version.outputs.version, '-beta')) && ' beta' || '' }} body_path: packaging/release-notes.md prerelease: ${{ startsWith(needs.version.outputs.version, '0.') || contains(needs.version.outputs.version, '-') }} # A final release becomes the repository's latest release, which diff --git a/README.md b/README.md index f611dd9..3c620cd 100644 --- a/README.md +++ b/README.md @@ -544,6 +544,34 @@ The app keeps its data in `Documents\Core Rules\data`, copies the rules data from the CD or its ISO image with Extract Data from CD…, and also opens an installation of the original program on the same computer. +### macOS (beta) + +The Mac version is in beta, for Apple Silicon Macs (M1 or newer) with +macOS 14 or newer: the +[1.1.0 beta](https://github.com/brahm/corerules/releases/tag/v1.1.0-beta1) +has `CoreRules-1.1.0-beta1-arm64.dmg`. Open it and drag Core Rules to +Applications. + +The app is signed without a certificate from Apple and is not notarized, +since the project has no Apple developer account, so macOS refuses it the +first time, saying it could not check it. Run this once in Terminal, and +from then on it opens as any app: + +```sh +xattr -dr com.apple.quarantine "/Applications/Core Rules.app" +``` + +Without Terminal: open Core Rules once and press Done, then in System +Settings › Privacy & Security, under Security, press **Open Anyway** next +to "Core Rules" and confirm with your password. Some Macs do not offer +Open Anyway, and a Mac managed by a company or school may not allow the +app at all. Either way is needed again after each update. + +The app keeps its data in `~/Library/Application Support/Core Rules/data`. +Macs have no CD drive, so Extract Data from CD… copies the rules data from +the CD's ISO image or from a folder the CD's files were copied into; Open +Folder… also opens an installation of the original. + ### The Flatpak repository The project has its own Flatpak repository, at diff --git a/docs/roadmap.md b/docs/roadmap.md index 066e974..e8687e2 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -623,9 +623,15 @@ The phases run in order: that folder already holds the other CD's. It is in the File menu and on the No Installation screen. With it `NOT_YET_ON_MACOS` is empty. -5. **Beta and release** on the three systems with the same tag, with an - install page on the website and in the README that shows the Open - Anyway steps. +5. **Beta and release (in progress)** on the three systems with the same + tag, with an install page on the website and in the README that shows + the Open Anyway steps. The release workflow builds the `.dmg` on Apple + Silicon, installs it into Applications as a user does, checks its + signature and starts the app, and attaches it to the release. The + 1.1.0 beta (`v1.1.0-beta1`), a pre-release, takes it to Wagner Brahm's + Mac; the README's install section and the release notes give the + Terminal command and the Open Anyway steps. After his test, 1.1.0 is + released on the three systems, with the Mac on the website. ### Step 4: new features, and independence from the original diff --git a/macos/scripts/make-app.sh b/macos/scripts/make-app.sh index 4925793..6e4179d 100755 --- a/macos/scripts/make-app.sh +++ b/macos/scripts/make-app.sh @@ -8,7 +8,10 @@ set -eu cd "$(dirname "$0")/../.." profile=${PROFILE:-release} -version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1) +# VERSION, as the release workflow gives it from the tag (1.1.0-beta1), +# names the .dmg; the bundle's version is its numbers, as macOS wants. +version=${VERSION:-$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)} +bundle_version=${version%%-*} out=target/macos app="$out/Core Rules.app" rm -rf "$out" @@ -23,7 +26,7 @@ swiftc $optimize -parse-as-library -module-name CoreRules \ "target/$profile/libcr_mac_ffi.a" \ -o "$app/Contents/MacOS/CoreRules" -sed "s/@VERSION@/$version/g" macos/Package/Info.plist > "$app/Contents/Info.plist" +sed "s/@VERSION@/$bundle_version/g" macos/Package/Info.plist > "$app/Contents/Info.plist" printf 'APPL????' > "$app/Contents/PkgInfo" # The languages the menus macOS draws follow, as the interface's catalogs. for language in en pt-BR es it fr de; do diff --git a/packaging/release-notes.md b/packaging/release-notes.md index 1e3066c..568fa1f 100644 --- a/packaging/release-notes.md +++ b/packaging/release-notes.md @@ -1,59 +1,50 @@ -**Core Rules 1.0.1, ready on Linux and Windows 11.** The Windows 11 -version has every screen of the Linux one, over the same backend and the -same data files, with the look of a Windows 11 app. It went through a beta -on the Microsoft Store without problems and is now a final release: -[get it from the Microsoft Store](https://apps.microsoft.com/detail/9nr2cgp649jm), -which signs it, installs the Windows App Runtime it needs and brings every -update. Characters and user databases move freely between the two systems -and the original programs. +**Core Rules 1.1.0 beta: macOS.** This beta adds a native Mac version, +with every screen of the Linux and Windows 11 versions, over the same +backend and the same data files. It has the look of a Mac app: the +sections, the entries and the details in three columns, every action in +the menu bar, and the sheets, the help and the generators in windows of +their own. It is a beta for testing on a Mac before 1.1.0 is released; +1.0.1 stays the stable version for Linux and Windows 11, and the Linux +packages here are the same app as 1.0.1. Characters and user databases +move freely between the three systems and the original programs. -What's new on Linux since 1.0.0: +| System | File | Install | +| --- | --- | --- | +| macOS 14 or newer, Apple Silicon (M1 or newer) | `CoreRules-1.1.0-beta1-arm64.dmg` | Open it and drag Core Rules to Applications, then see below | +| Windows 11 | [Microsoft Store](https://apps.microsoft.com/detail/9nr2cgp649jm) | Get it from the Store page | +| Linux | The `.deb`, `.rpm`, pacman package, Flatpak and AppImage below | As for [1.0.1](https://github.com/brahm/corerules/releases/tag/v1.0.1) | + +**Opening it the first time.** The Mac app is signed without a +certificate from Apple and is not notarized: the project has no Apple +developer account. So macOS refuses it the first time, saying it could +not check it for malicious software. After copying it to Applications, +run this once in Terminal, and from then on it opens as any app: + +```sh +xattr -dr com.apple.quarantine "/Applications/Core Rules.app" +``` + +Without Terminal: open Core Rules once and press Done; then in System +Settings › Privacy & Security, under Security, press **Open Anyway** next +to "Core Rules" and confirm with your password. Some Macs do not offer +Open Anyway, and a Mac managed by a company or school may not allow the +app at all. Either way is needed again after each update. The `.dmg` has +the same steps in English and Portuguese in `Read Me First.txt`. -- **Flatpak repository**: the Flatpak comes from the project's own signed - repository, so `flatpak update`, GNOME Software and Discover bring every - new version -- **Editors**: a priest's quest spell is called a quest spell instead of - "0th level", the editors' wording is clearer, and Portuguese tells the - Abilities and Skills tabs apart -- **Characters**: Edit Character shows the social class in the language - chosen, Back keeps what a creation page had, the points pages say why - they refuse a choice, and the Psionics page leaves the rogue points to - the Rogue page -- **Translations**: the app shows the chosen language throughout, and the - translations lost the original's double spaces +**The rules data.** The app opens the data package in +`~/Library/Application Support/Core Rules/data`. Macs have no CD drive, +so File › Extract Data from CD… makes it from the ISO image of a Core +Rules 2.0 or Expansion CD, or from a folder the CD's files were copied +into; File › Open Folder… also opens an installation of the original. -What the app does: it opens a Core Rules 2.0 Expansion installation (or its -CD, or a data package), creates and edits characters with the Core Rules or +What the app does: it opens a Core Rules 2.0 Expansion installation (or +a data package), creates and edits characters with the Core Rules or Player's Option, levels them up, manages parties and prints character sheets; it generates NPCs, treasure and encounters, rolls on the books' tables, edits every user database and imports and exports DM Toolkit -packages, all in files the original programs still open. A Core Rules 2.0 -installation opens read-only and is imported into the Expansion. The +packages, all in files the original programs still open. The [README](https://github.com/brahm/corerules#readme) lists every feature, where to find the disc images if yours are lost (you must own the original discs), and every difference from the original. It contains no rules -content; you need your own copy of Core Rules. - -| System | File | Install | -| --- | --- | --- | -| Ubuntu 26.04 or newer | `corerules_1.0.1_amd64.deb` | `sudo apt install ./corerules_1.0.1_amd64.deb` | -| Fedora 44 or newer | `corerules-1.0.1-1.fc44.x86_64.rpm` | `sudo dnf install ./corerules-1.0.1-1.fc44.x86_64.rpm` | -| Arch Linux, CachyOS, Omarchy | `corerules-1.0.1-1-x86_64.pkg.tar.zst` | `sudo pacman -U ./corerules-1.0.1-1-x86_64.pkg.tar.zst` | -| Any distribution with Flatpak, such as Bazzite | `CoreRules-1.0.1.flatpak` | `flatpak install --user CoreRules-1.0.1.flatpak` | -| Any distribution (glibc 2.43+) | `CoreRules-1.0.1-x86_64.AppImage` | `chmod +x CoreRules-1.0.1-x86_64.AppImage` and run it | -| Windows 11 | [Microsoft Store](https://apps.microsoft.com/detail/9nr2cgp649jm) | Get it from the Store page | - -The Flatpak needs the GNOME 51 runtime from Flathub, which `flatpak install` -offers to fetch. It also installs from the project's own Flatpak repository, -which brings every new version through `flatpak update`, GNOME Software and -Discover: -`flatpak install --user https://brahm.github.io/corerules/io.github.brahm.CoreRules.flatpakref`. -The AppImage bundles the GTK, libadwaita and other libraries of GNOME 51 -and runs on Fedora 44, Ubuntu 26.04 and newer. The pacman package needs an -up-to-date system (`sudo pacman -Syu`), and `PKGBUILD` builds it from -source with `makepkg -si`. `SHA256SUMS` lists the checksums of every file. - -The [Community Add-ons Collection](https://github.com/brahm/corerules/blob/main/addons/README.md), -672 community add-ons in one self-installing AppImage, has its own -[release](https://github.com/brahm/corerules/releases/tag/addons): -[CoreRules-Community-Addons-x86_64.AppImage](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage). +content; you need your own copy of Core Rules. `SHA256SUMS` lists the +checksums of every file.