Skip to content

Commit

Permalink
Reconcile Actions (#10)
Browse files Browse the repository at this point in the history
* Reconfigured debug and publish
  • Loading branch information
KenCorma authored Sep 4, 2024
1 parent 5820825 commit 376ed23
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 47 deletions.
22 changes: 11 additions & 11 deletions .github/actions/build/macos/comfy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ description: Download, install, and set up Comfy
runs:
using: composite
steps:
name: Install Python
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Make Standalone
shell: sh
run: |
python -m pip install --upgrade pip
pip install comfy-cli
cd assets
comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --m-series --skip-manager
comfy --workspace ./ComfyUI standalone --platform macos
comfy standalone --rehydrate
ls
- name: Make Standalone
shell: sh
run: |
python -m pip install --upgrade pip
pip install comfy-cli
cd assets
comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --m-series --skip-manager
comfy --workspace ./ComfyUI standalone --platform macos
comfy standalone --rehydrate
ls
# - name: Sign Wheels
# uses: ./.github/actions/build/macos/signwheel
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
4 changes: 2 additions & 2 deletions .github/actions/build/windows/app/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ runs:
run: |
curl -L -o comfyui-win.7z https://github.com/Comfy-Org/python-dependencies/releases/download/embedded-windows-deps-cu11.8-py11.9-5/ComfyUI_windows_portable.7z
7z x comfyui-win.7z -odist/
move dist/ComfyUI_windows_portable/ComfyUI assets/UI/
move dist/ComfyUI_windows_portable/python_embedded assets/UI/
move dist/ComfyUI_windows_portable/ComfyUI assets/
move dist/ComfyUI_windows_portable/python_embedded assets/
cd assets/UI/ComfyUI && ls
shell: cmd
- name: Make app
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/debug_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Blank
run: echo "Intentionally left blank"
- name: Github checkout
uses: actions/checkout@v4
- name: Declare some variables
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
shell: bash
- 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

22 changes: 8 additions & 14 deletions .github/workflows/publish_macos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# .github/workflows/release.yml
name: Release app
# .github/workflows/publish_macos.yml
name: Release MacOS app

on:
workflow_dispatch:
Expand All @@ -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"
uses: ./.github/actions/build/macos/comfy
- name: Sign Wheels
uses: ./.github/actions/build/macos/signwheel
- name: shim
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .github/workflows/release.yml
# .github/workflows/publish_windows.yml
name: Release Windows app

on:
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 376ed23

Please sign in to comment.