Skip to content

Build latest (macOS 64 bit) #6

Build latest (macOS 64 bit)

Build latest (macOS 64 bit) #6

Workflow file for this run

name: Build latest (macOS 64 bit)
# trigger via either push to selected branches or on manual run
on:
push:
branches:
- main
- master
- AngledLighting
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-mac64
cancel-in-progress: true
jobs:
build:
timeout-minutes: 10
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- name: Compile 64 bit macOS builds
shell: bash
id: compile
env:
LIBS: "-framework Security -framework Cocoa -framework OpenGL -framework IOKit -lobjc"
SRCS: "src/*.c src/Window_cocoa.m third_party/bearssl/*.c"
FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn -fvisibility=hidden -rdynamic"
ARM64_FLAGS: "-DCC_GFX_BACKEND=CC_GFX_BACKEND_GL2 -arch arm64"
INTEL64_FLAGS: "-arch x86_64"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
MACOSX_DEPLOYMENT_TARGET=10.5 clang ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.INTEL64_FLAGS }} $LATEST_FLAG -o cc-mac64-gl1 ${{ env.LIBS }}
MACOSX_DEPLOYMENT_TARGET=10.5 clang ${{ env.SRCS }} ${{ env.FLAGS }} ${{ env.INTEL64_FLAGS }} $LATEST_FLAG -DCC_GFX_BACKEND=CC_GFX_BACKEND_GL2 -o cc-mac64-gl2 ${{ env.LIBS }}
clang ${{ env.SRCS }} ${{ env.COMMON_FLAGS }} ${{ env.ARM64_FLAGS }} $LATEST_FLAG -o cc-mac-arm64 ${{ env.LIBS }}
# https://wiki.freepascal.org/Code_Signing_for_macOS#Ad_hoc_signing
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-mac64-gl1'
DEST_NAME: 'ClassiCube-mac64-OpenGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-mac64-gl2'
DEST_NAME: 'ClassiCube-mac64-ModernGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-mac-arm64'
DEST_NAME: 'ClassiCube-mac-ARM64'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
NOTIFY_MESSAGE: 'Successfully compiled 64 bit ClassiCube macOS builds.'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/notify_failure
if: failure()
with:
NOTIFY_MESSAGE: 'Failed to produce 64 bit macOS builds'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'