Skip to content

Commit

Permalink
Updated mac workflow script
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoroney committed Dec 9, 2024
1 parent f265ece commit 9fc38c5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
53 changes: 31 additions & 22 deletions .github/workflows/package-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ jobs:
--key "Notarization_AuthKey.p8" \
--key-id "$APPLE_NOTARIZE_ID" \
--issuer "$APPLE_ISSUER"
- name: Install Dependencies
run: |
cd AutoSubs-App
npm install
- name: Bundle Tauri App
run: |
cd AutoSubs-App
export APPLE_SIGNING_IDENTITY="Developer ID Application: ${{ secrets.APPLE_IDENTITY }}"
npm run tauri build
- name: Create Mac Package
run: |
# Create the package directory
mkdir Mac-Package/Payload
# Move the app to the package
mv AutoSubs-App/src-tauri/target/release/bundle/macos/AutoSubs.app Mac-Package/Payload
- name: Package Python Server
run: |
Expand All @@ -78,48 +97,38 @@ jobs:
- name: Move Python Server to resources folder
run: |
mv "Transcription-Server/dist/Transcription-Server" "AutoSubs-App/src-tauri/resources"
mv "Transcription-Server/dist/Transcription-Server" "Mac-Package/Payload/AutoSubs.app/Contents/Resources/resources"
- name: Code Sign Python Server
run: |
# Define variables
IDENTITY="Developer ID Application: ${{ secrets.APPLE_IDENTITY }}"
ENTITLEMENTS="$(pwd)/Signing/entitlements.plist"
APP_DIR="$(pwd)/AutoSubs-App/src-tauri/resources/Transcription-Server"
ENTITLEMENTS="$(pwd)/Signing/entitlements.plist" # Use absolute path to avoid issues
APP_DIR="$(pwd)/Mac-Package/Payload/AutoSubs.app/Contents/Resources/resources/Transcription-Server" # Use absolute path
AUTOSUBS_BINARY="$(pwd)/Mac-Package/Payload/AutoSubs.app/Contents/MacOS/autosubs" # Use absolute path
# Function to sign a single file
sign_file() {
local file="$1"
echo "Signing $file..."
codesign --force --options runtime --timestamp --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" "$file"
}
export -f sign_file # Export the function so it's available in subshells
export IDENTITY # Export IDENTITY so it's available in subshells
export ENTITLEMENTS # Export ENTITLEMENTS so it's available in subshells
# Sign the main executable
sign_file "$APP_DIR/transcription-server"
# Sign all embedded binaries and executables in the _internal directory
find "$APP_DIR/_internal" -type f \( -name "*.dylib" -o -name "*.so" -o -name "*.exe" -o -name "*.bin" -o -name "ffmpeg*" \) -exec bash -c 'sign_file "$0"' {} \;
find "$APP_DIR/_internal" -type f \( -name "*.dylib" -o -name "*.so" -o -name "*.exe" -o -name "*.bin" -o -name "ffmpeg*" -o -name "Python" \) -exec bash -c 'sign_file "$0"' {} \;
# Sign any other executables in the main app directory
find "$APP_DIR" -type f -perm +111 -exec bash -c 'sign_file "$0"' {} \;
- name: Install Dependencies
run: |
cd AutoSubs-App
npm install
- name: Bundle Tauri App
run: |
cd AutoSubs-App
export APPLE_SIGNING_IDENTITY="Developer ID Application: ${{ secrets.APPLE_IDENTITY }}"
npm run tauri build
- name: Create Mac Package
run: |
# Create the package directory
mkdir Mac-Package/Payload
# Copy the app to the package
cp -r AutoSubs-App/src-tauri/target/release/bundle/macos/AutoSubs.app Mac-Package/Payload
# Sign the main app binary
codesign --force --options runtime --timestamp --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" "$AUTOSUBS_BINARY"
- name: Create PKG Installer
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ sign.sh
/Transcription-Server/dist
/Transcription-Server/build
AutoSubs-App/package-lock.json
/Mac-Package/Payload

0 comments on commit 9fc38c5

Please sign in to comment.