Skip to content

Commit

Permalink
fix checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgriffin committed Dec 21, 2024
1 parent 8fa1a88 commit 56bd09e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build-mac-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ on:
workflow_dispatch:
inputs:
commitHash:
description: 'Enter the commit hash to build (leave empty for the latest commit)'
description: 'Enter the commit hash to build (leave empty to use the default branch or the branch that triggered the workflow)'
required: false
type: string
buildDMG:
description: 'Test Build DMG'
required: false
type: boolean


push:
branches: [ "main" ]
pull_request:
Expand All @@ -25,8 +24,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all branches and tags
# Checkout the provided commit hash or the latest commit from the default branch
ref: ${{ github.event.inputs.commitHash || 'refs/heads/main' }}
ref: ${{ github.event.inputs.commitHash || github.sha }}


- name: Run build script
Expand Down
18 changes: 17 additions & 1 deletion tools/build-mac/osx.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
# -*- mode: python -*-

import platform
from PyInstaller.utils.hooks import collect_data_files, collect_submodules, collect_dynamic_libs
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE

import sys, os



# Function to determine target architecture based on Python's running architecture
def get_target_arch():
arch = platform.machine()
if arch == 'x86_64':
return 'x86_64'
elif arch in ('arm', 'arm64', 'aarch64'):
return 'arm64'
else:
return 'universal2' # Defaulting to universal for other cases (as a fallback)
target_arch = get_target_arch()
print(f"Building for {target_arch=}")


PACKAGE_NAME='Bitcoin_Safe.app'
PYPKG='bitcoin_safe'
PROJECT_ROOT = os.path.abspath(".")
Expand Down Expand Up @@ -112,7 +128,7 @@ exe = EXE(
upx=True,
icon=ICONS_FILE,
console=False,
target_arch='arm64', # TODO investigate building 'universal2'
target_arch=target_arch, # TODO investigate building 'universal2'
)

app = BUNDLE(
Expand Down

0 comments on commit 56bd09e

Please sign in to comment.