Skip to content

Forward and back disasm view #420

Forward and back disasm view

Forward and back disasm view #420

name: Build macOS
permissions:
contents: write
packages: write
on:
push:
branches: [ master, test-ci ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build: ${{ matrix.archname }}"
runs-on: macos-14
env:
VCPKG_FEATURE_FLAGS: manifests,binarycaching
VCPKG_BINARY_SOURCES: ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
VCPKG_NUGET_REPOSITORY: https://github.com/${{ github.repository }}.git
VCPKG_DOWNLOADS: ${{ github.workspace }}/.vcpkg-downloads
VCPKG_FORCE_DOWNLOADED_BINARIES: "1"
SCCACHE_GHA_ENABLED: "true"
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_CLEANUP: "1"
strategy:
fail-fast: false
matrix:
archname: [intel, arm]
config: [Release]
include:
- archname: "intel"
arch: x64
- archname: "arm"
arch: arm64
steps:
- name: Checkout Git Repo
uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Remove windows-only qt version override in vcpkg.json
run: |
sed -i '' '/For Windows only/d' ${{ github.workspace }}/gui/qt/vcpkg.json
- name: Install dependencies
run: |
set -e
brew install automake autoconf autoconf-archive libtool mono
- name: Install latest CMake
uses: lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
- name: Ensure vcpkg downloads directory exists
run: |
mkdir -p "$VCPKG_DOWNLOADS"
- name: Cache vcpkg downloads
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_DOWNLOADS }}
key: ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-downloads-
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
with:
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
- name: Download nuget.exe and export to env
shell: bash
run: |
set -euo pipefail
curl -sSL -o "$RUNNER_TEMP/nuget.exe" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
echo "NUGET=$RUNNER_TEMP/nuget.exe" >> "$GITHUB_ENV"
- name: Provide working 'nuget' on PATH
shell: bash
run: |
set -euo pipefail
printf '#!/usr/bin/env bash\nexec mono "$NUGET" "$@"\n' > "$RUNNER_TEMP/nuget"
chmod +x "$RUNNER_TEMP/nuget"
echo "PATH=$RUNNER_TEMP:$PATH" >> "$GITHUB_ENV"
- name: Configure vcpkg NuGet source
shell: bash
run: |
set -euo pipefail
mono "$NUGET" sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" || true
mono "$NUGET" sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-Username "${{ github.repository_owner }}" \
-Password "${{ secrets.GITHUB_TOKEN }}" \
-StorePasswordInClearText
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
mono "$NUGET" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
fi
- name: Start sccache
uses: mozilla-actions/[email protected]
- name: Build CEmu ${{ matrix.config }} on macOS ${{ matrix.arch }}
uses: lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
with:
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
configurePreset: 'Mac-${{ matrix.arch }}'
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
buildPreset: 'Mac-${{ matrix.arch }}-${{ matrix.config }}'
env:
VCPKG_DEFAULT_HOST_TRIPLET: arm64-osx-release
- name: Move to temp folder
run: |
mkdir -p /tmp/CEmu-nightly_mac_${{matrix.archname}}/
mv ${{ github.workspace }}/gui/qt/CEmu.build/Mac-${{ matrix.arch }}/${{ matrix.config }}/CEmu.app /tmp/CEmu-nightly_mac_${{matrix.archname}}/
- name: "Codesign CEmu.app"
env:
HAVE_SECRETS: ${{ secrets.MACOS_CERTIFICATE_PWD != '' }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
MACOS_CODESIGN_IDENT: ${{ secrets.MACOS_CODESIGN_IDENT }}
if: ${{ runner.os == 'macOS' && github.repository == 'CE-Programming/CEmu' && env.HAVE_SECRETS == 'true' }}
run: |
echo $MACOS_CERTIFICATE | base64 -d > certificate.p12
security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
/usr/bin/codesign --deep --force --verify --verbose --sign "$MACOS_CODESIGN_IDENT" --timestamp --options runtime /tmp/CEmu-nightly_mac_${{matrix.archname}}/CEmu.app
- name: "Create the DMG"
run: |
brew install create-dmg || brew install create-dmg; # we try twice because sometimes it fails...
# The codesign variable may be empty (for forks) but that's fine, create-dmg only does code-signing if it's not empty.
createDmgArgs="--codesign '${{ secrets.MACOS_CODESIGN_IDENT }}' \
--volname 'CEmu-nightly ${{matrix.archname}}' \
--window-pos 200 120 \
--window-size 600 400 \
--icon-size 64 \
--icon 'CEmu.app' 125 200 \
--app-drop-link 400 200 \
'CEmu-nightly_mac_${{matrix.archname}}.dmg' \
'/tmp/CEmu-nightly_mac_${{matrix.archname}}/'"
eval "create-dmg $createDmgArgs" || eval "create-dmg $createDmgArgs" # We also retry just in case...
- name: "[macOS] Notarize and staple DMG"
if: ${{ runner.os == 'macOS' && github.repository == 'CE-Programming/CEmu' && env.HAVE_SECRETS == 'true' }}
env:
HAVE_SECRETS: ${{ secrets.APPLE_NOTARIZATION_PASSWORD != '' }}
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
APPLE_NOTARIZATION_TEAMID: ${{ secrets.APPLE_NOTARIZATION_TEAMID }}
run: |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_NOTARIZATION_USERNAME" --team-id "$APPLE_NOTARIZATION_TEAMID" --password "$APPLE_NOTARIZATION_PASSWORD"
xcrun notarytool submit "CEmu-nightly_mac_${{matrix.archname}}.dmg" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple "CEmu-nightly_mac_${{matrix.archname}}.dmg"
- name: Upload dmg as artifact
uses: actions/upload-artifact@v4
with:
name: CEmu-nightly_mac_${{matrix.archname}}
path: CEmu-nightly_mac_${{matrix.archname}}.dmg
- name: Update nightly release
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
uses: softprops/action-gh-release@62c96d0c4e8a889135c1f3a25910db8dbe0e85f7 # latest as of 2025-10-04
with:
tag_name: nightly
prerelease: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
CEmu-nightly_mac_${{matrix.archname}}.dmg