From 2d38c425d1a587c1356b6177d133314dd4be2db8 Mon Sep 17 00:00:00 2001 From: Nathan Vieira Marcelino Date: Thu, 1 Aug 2024 15:33:43 -0300 Subject: [PATCH] feature: use arm and x86 for macos --- .../workflows/build-and-release-mac-arm.yml | 49 +++++++++++++++++++ ...-mac.yml => build-and-release-mac-x86.yml} | 2 +- .github/workflows/test-build-mac-arm.yml | 36 ++++++++++++++ ...t-build-mac.yml => test-build-mac-x86.yml} | 0 electron-builder.yml | 4 +- package.json | 2 +- resources/entitlements.mac.plist | 4 +- 7 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-and-release-mac-arm.yml rename .github/workflows/{build-and-release-mac.yml => build-and-release-mac-x86.yml} (94%) create mode 100644 .github/workflows/test-build-mac-arm.yml rename .github/workflows/{test-build-mac.yml => test-build-mac-x86.yml} (100%) diff --git a/.github/workflows/build-and-release-mac-arm.yml b/.github/workflows/build-and-release-mac-arm.yml new file mode 100644 index 0000000..8440ef8 --- /dev/null +++ b/.github/workflows/build-and-release-mac-arm.yml @@ -0,0 +1,49 @@ +name: Build and Deploy — Mac +run-name: ${{ github.actor }} is building a Mac release + +on: + push: + branches: + - main + +permissions: + actions: write + contents: write + packages: write + +jobs: + deploy-on-mac: + runs-on: macos-14-arm + + defaults: + run: + shell: bash -l {0} + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - uses: apple-actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} + p12-password: ${{ secrets.MAOS_CERTIFICATE_PWD }} + + - name: Build and deploy on MacOS + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npm run build:mac -- --publish=always --arm64 diff --git a/.github/workflows/build-and-release-mac.yml b/.github/workflows/build-and-release-mac-x86.yml similarity index 94% rename from .github/workflows/build-and-release-mac.yml rename to .github/workflows/build-and-release-mac-x86.yml index 6655de4..713fafa 100644 --- a/.github/workflows/build-and-release-mac.yml +++ b/.github/workflows/build-and-release-mac-x86.yml @@ -46,4 +46,4 @@ jobs: - name: Build and deploy on MacOS env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run build:mac -- --publish=always + run: npm run build:mac -- --publish=always --universal diff --git a/.github/workflows/test-build-mac-arm.yml b/.github/workflows/test-build-mac-arm.yml new file mode 100644 index 0000000..af31f87 --- /dev/null +++ b/.github/workflows/test-build-mac-arm.yml @@ -0,0 +1,36 @@ +name: Test build — Mac +run-name: ${{ github.actor }} is building for MacOS. + +on: + pull_request: + branches: [ main ] + +jobs: + test-on-mac: + runs-on: macos-14-arm + + defaults: + run: + shell: bash -l {0} + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: install python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm install + + - name: Build and deploy on Mac + run: npm run build:mac -- --publish=never --arm64 \ No newline at end of file diff --git a/.github/workflows/test-build-mac.yml b/.github/workflows/test-build-mac-x86.yml similarity index 100% rename from .github/workflows/test-build-mac.yml rename to .github/workflows/test-build-mac-x86.yml diff --git a/electron-builder.yml b/electron-builder.yml index 553d618..420fc26 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,4 +1,4 @@ -appId: com.gladstoneinstitutes.vame-desktop +appId: com.catalystneuro.vame-desktop productName: VAME Desktop directories: buildResources: resources @@ -32,7 +32,7 @@ mac: - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. notarize: false dmg: - artifactName: ${name}-${version}-macos.${ext} + artifactName: ${name}-${version}-macos-${arch}.${ext} writeUpdateInfo: false linux: artifactName: ${name}-${version}-linux.${ext} diff --git a/package.json b/package.json index 1929429..ee56fea 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vame-desktop", "main": "./out/main/index.js", - "version": "0.3.1", + "version": "0.3.2", "description": "An open-source machine learning tool for behavioral segmentation and analyses.", "license": "GPL-3.0-only", "author": "Catalyst Neuro , Nathan Vieira , Garrett Flynn ", diff --git a/resources/entitlements.mac.plist b/resources/entitlements.mac.plist index 38c887b..938c509 100644 --- a/resources/entitlements.mac.plist +++ b/resources/entitlements.mac.plist @@ -6,7 +6,9 @@ com.apple.security.cs.allow-unsigned-executable-memory - com.apple.security.cs.allow-dyld-environment-variables + com.apple.security.files.user-selected.read-write + + com.apple.security.files.user-selected.read-only