Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest in main #122

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f4f1a54
Update README.md
AdyTech99 Nov 19, 2024
e42ba61
Update README.md
tmoroney Nov 19, 2024
817f5ff
Rename AutoSubs V1.py to auto-subs.py
tmoroney Nov 19, 2024
796c0c5
Added old auto subs light
tmoroney Nov 19, 2024
74ec80d
Update README.md
tmoroney Nov 19, 2024
6099c21
Merge pull request #110 from AdyTech99/patch-1
tmoroney Nov 20, 2024
38c381a
Add multi-language support to text template search
alb Nov 20, 2024
749c86c
Merge pull request #112 from alb/fix-missing-text-templates
tmoroney Nov 21, 2024
b53242a
Added workflow to build Mac installer
tmoroney Nov 22, 2024
379ab5b
Added fix for pip install
tmoroney Nov 22, 2024
510c108
Update README.md
AidyTheWeird Nov 23, 2024
7042227
Update README.md
AidyTheWeird Nov 23, 2024
d5e67d9
Update README.md
AidyTheWeird Nov 23, 2024
ea02376
added test workflow
tmoroney Nov 24, 2024
da11993
Update requirements.txt
tmoroney Nov 24, 2024
31ccf45
Changed python version
tmoroney Nov 24, 2024
953e1f0
Fixed Mac package workflow
tmoroney Nov 24, 2024
c086f12
Fixed issue with packaging workflow
tmoroney Nov 24, 2024
80d6a90
Update package-mac.yml
tmoroney Nov 24, 2024
891743b
Fixed "move" step in workflow
tmoroney Nov 24, 2024
2b2bc24
Update package-mac.yml
tmoroney Nov 24, 2024
8c86407
Updated to use Github access token
tmoroney Nov 24, 2024
0a226b2
Added notarization and fixed paths
tmoroney Nov 24, 2024
6ae5e0a
Update README.md
tmoroney Nov 24, 2024
aa448c6
Updated workflow to only run on pull request
tmoroney Nov 24, 2024
c5c16bc
Merge pull request #119 from AidyTheWeird/main
tmoroney Nov 24, 2024
485cb4f
Updated to stop Utility folder from locking
tmoroney Nov 25, 2024
844157c
Update package-mac.yml
tmoroney Nov 25, 2024
9fa13b0
Fixed default template import path
tmoroney Nov 26, 2024
e9ebfe9
Added noise suppression and fixed whisper v3 issues
tmoroney Nov 26, 2024
ef42893
Removed only_voice_freq param
tmoroney Nov 26, 2024
e823a0d
Updated spec file to fix ssl error
tmoroney Nov 26, 2024
58b3733
Removed force order and added ssl env
tmoroney Nov 26, 2024
5352632
Updated Lua server to kill any other instance
tmoroney Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions .github/workflows/package-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Package AutoSubs for MacOS
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
build:
runs-on: macos-14

steps:
- name: Checkout AutoSubs Repo Code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 23

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.7'

- name: Import Apple Certificates
env:
APP_CERTIFICATE_BASE64: ${{ secrets.APPLE_SIGNING_CERTIFICATE }}
APP_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
INSTALLER_CERTIFICATE_BASE64: ${{ secrets.APPLE_INSTALLER_CERTIFICATE }}
INSTALLER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_NOTARIZE_KEY: ${{ secrets.APPLE_NOTARIZE_KEY }}
APPLE_NOTARIZE_ID: ${{ secrets.APPLE_NOTARIZE_ID }}
APPLE_ISSUER: ${{ secrets.APPLE_ISSUER }}

run: |
# Define paths
APP_CERT_PATH=$RUNNER_TEMP/app_certificate.p12
INSTALLER_CERT_PATH=$RUNNER_TEMP/installer_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

# Decode and save certificates
echo "$APP_CERTIFICATE_BASE64" | base64 --decode > $APP_CERT_PATH
echo "$INSTALLER_CERTIFICATE_BASE64" | base64 --decode > $INSTALLER_CERT_PATH

# Create and configure temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychains -s $KEYCHAIN_PATH

# Import Application certificate
security import $APP_CERT_PATH -P "$APP_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# Import Installer certificate
security import $INSTALLER_CERT_PATH -P "$INSTALLER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# Import Notarization credentials
echo "$APPLE_NOTARIZE_KEY" | base64 --decode > Notarization_AuthKey.p8
xcrun notarytool store-credentials "AC_PASSWORD" \
--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 -- --bundles app

- name: Package Python Server
run: |
cd Mac-Server
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pyinstaller transcription-server.spec --noconfirm
deactivate

- name: Code Sign Python Server
run: |
# Define variables
IDENTITY="Developer ID Application: ${{ secrets.APPLE_IDENTITY }}"
ENTITLEMENTS="$(pwd)/Mac-Server/entitlements.plist"
APP_DIR="$(pwd)/Mac-Server/dist/Transcription-Server"

# 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"' {} \;

# Sign any other executables in the main app directory
find "$APP_DIR" -type f -perm +111 -exec bash -c 'sign_file "$0"' {} \;

- name: Move Python Server and App to Output Folder
run: |
mv "AutoSubs-App/src-tauri/target/release/bundle/macos/AutoSubs.app" "Output"
mv "Mac-Server/dist/Transcription-Server" "Output"

- name: Create PKG Installer
run: |
# Give permissions to the scripts
chmod +x ./scripts

# Create the package
pkgbuild --root "Output" \
--identifier "com.tom-moroney.autosubs" \
--version "2.0" \
--install-location "/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/AutoSubs" \
--scripts ./scripts \
"AutoSubs-unsigned.pkg"

- name: Sign PKG Installer
run: |
productsign --sign "Developer ID Installer: ${{ secrets.APPLE_IDENTITY }}" \
--timestamp \
"AutoSubs-unsigned.pkg" \
"AutoSubs-Installer-Mac-ARM.pkg"

- name: Notarize PKG Installer
run: |
# Submit for notarization
xcrun notarytool submit "AutoSubs-Installer-Mac-ARM.pkg" \
--keychain-profile "AC_PASSWORD" \
--wait

# Staple the ticket to the installer
xcrun stapler staple "AutoSubs-Installer-Mac-ARM.pkg"

- name: Get Latest Release Tag
id: get_latest_release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
latest_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName')
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV

- name: Upload Asset to Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.LATEST_TAG }}
files: AutoSubs-Installer-Mac-ARM.pkg
token: ${{ secrets.GH_TOKEN }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions AutoSubs/package-lock.json → AutoSubs-App/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function GlobalProvider({ children }: React.PropsWithChildren<{}>) {
const [translate, setTranslate] = useState(false);
const [diarize, setDiarize] = useState(false);
const [maxWords, setMaxWords] = useState(6);
const [maxChars, setMaxChars] = useState(30);
const [maxChars, setMaxChars] = useState(25);
const [markIn, setMarkIn] = useState(0);

async function getFullTranscriptPath() {
Expand Down Expand Up @@ -149,7 +149,7 @@ export function GlobalProvider({ children }: React.PropsWithChildren<{}>) {
setTranslate(result.storedTranslate || false);
setDiarize(result.storedDiarize || false);
setMaxWords(result.storedMaxWords || 6);
setMaxChars(result.storedMaxChars || 30);
setMaxChars(result.storedMaxChars || 25);
}).catch((error) => {
console.error("Error initializing state:", error);
});
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion AutoSubs/src-tauri/gen/schemas/acl-manifests.json

This file was deleted.

1 change: 0 additions & 1 deletion AutoSubs/src-tauri/gen/schemas/capabilities.json

This file was deleted.

Loading