Skip to content

Commit

Permalink
Reconfigured debug and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Sep 4, 2024
1 parent 5820825 commit 6f58992
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 30 deletions.
Empty file.
24 changes: 24 additions & 0 deletions .github/actions/build/macos/signing/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Apple Signing
description: Setup everything to sign and notarize
inputes:
CERTIFICATE_OSX_APPLICATION:
required: true
type: string
CERTIFICATE_PASSWORD:
required: true
type: string
runs:
using: composite
steps:
- name: Add MacOS certs
shell: sh
run: cd scripts && chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ inputs.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ inputs.CERTIFICATE_PASSWORD }}
- name: Set ID
shell: sh
run: |
SIGN_ID=$(security find-identity -p codesigning -v | grep -E "Developer ID" | sed -n -e 's/.* "/"/p' | tr -d '""')
echo "SIGN_ID=$SIGN_ID" >> $GITHUB_ENV
21 changes: 19 additions & 2 deletions .github/workflows/debug_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Blank
run: echo "Intentionally left blank"
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i
- name: Build Comfy
uses: ./.github/actions/build/macos/comfy
- name: Publish app
env:
PUBLISH: false
DEBUG: electron-forge*
run: npm run make -- --arch="arm64"
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: comfyui-electron-debug-build-${{env.sha_short}}
path: out/make/zip/darwin/arm64/*.zip

16 changes: 5 additions & 11 deletions .github/workflows/publish_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,18 @@ jobs:
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Output xcode version
run: xcodebuild -version
- name: Add MacOS certs
run: cd scripts && chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm i
- name: Set Up signing
uses: ./.github/actions/build/macos/signing
with:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Make Comfy
uses: ./.github/actions/build/macos/comfy
- run: |
SIGN_ID=$(security find-identity -p codesigning -v | grep -E "Developer ID" | sed -n -e 's/.* "/"/p' | tr -d '""')
echo "SIGN_ID=$SIGN_ID" >> $GITHUB_ENV
sed -i '' 's/packageOpts.quiet = true/packageOpts.quiet = false/g' "node_modules/@electron-forge/core/dist/api/package.js"
- name: Sign Wheels
uses: ./.github/actions/build/macos/signwheel
- name: shim
Expand Down
36 changes: 19 additions & 17 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ import { FuseV1Options, FuseVersion } from '@electron/fuses';
const config: ForgeConfig = {
packagerConfig: {
asar: true,
...process.env.PUBLISH == 'true' && {windowsSign: {
debug:true,
hookFunction: (filePath) => {
if (!filePath.endsWith("ComfyUI.exe")) return; // For now just ignore any file that isnt the main exe will need to change when building with installers/auto updates / a compiled python servesr
import("child_process").then(cp => cp.execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`));
...process.env.PUBLISH == 'true' && {
windowsSign: {
debug:true,
hookFunction: (filePath) => {
if (!filePath.endsWith("ComfyUI.exe")) return; // For now just ignore any file that isnt the main exe will need to change when building with installers/auto updates / a compiled python servesr
import("child_process").then(cp => cp.execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`));
},
},
osxSign: {
identity: process.env.SIGN_ID,
optionsForFile: (filepath) => {
return { entitlements: './assets/entitlements.mac.plist' };
}
},
osxNotarize: {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID
},
}},
osxSign: {
identity: process.env.SIGN_ID,
optionsForFile: (filepath) => {
console.log('~');
return { entitlements: './assets/entitlements.mac.plist' };
}
},
extraResource: ['./assets/UI', './assets/ComfyUI', process.platform === 'darwin' ? './assets/python' : './assets/python.tgz'],
osxNotarize: {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID
},

},
rebuildConfig: {},
hooks: {
Expand Down
2 changes: 2 additions & 0 deletions scripts/shim.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
cp -f scripts/shims/utils.js node_modules/@electron/osx-sign/dist/cjs/util.js

sed -i '' 's/packageOpts.quiet = true/packageOpts.quiet = false/g' "node_modules/@electron-forge/core/dist/api/package.js"

0 comments on commit 6f58992

Please sign in to comment.