Skip to content

Add safari extension sync, validate, and macOS build - #181

Merged
ja7ad merged 3 commits into
ja7ad:mainfrom
VedantMadane:ci/safari-extension-build
Sep 21, 2026
Merged

ja7ad merged 3 commits into
ja7ad:mainfrom
VedantMadane:ci/safari-extension-build

Conversation

@VedantMadane

Copy link
Copy Markdown
Contributor

Summary

Adds a GitHub Actions workflow to build, validate, and publish (as artifact) the Safari extension continuously.

Workflow (.github/workflows/safari-extension.yml)

  1. Ubuntu : run scripts/sync-extension-resources.sh safari, fail if Resources/ drifts from Chrome sources; validate MV3 manifest + required assets; confirm native handler present
  2. macOS : full Xcode build via scripts/build-safari-extension.sh; stage the Release .app and upload as hydra-safari-extension artifact (14-day retention)

Triggered on changes under extensions/**, the Safari build/sync scripts, or the workflow itself (also workflow_dispatch).

Notes

  • End-to-end Safari UI testing still requires a human on macOS (right-click download, selection pill, etc.); this PR automates the build/publish verification path from issue Build and test safari extension and publish #1
  • Automatic download capture remains N/A on Safari (platform API limit)
  • Includes macOS 11+ deployment target alignment and bundle identifier prefix fix for code signing/validation

Test plan

  • Workflow YAML reviewed against scripts/build-safari-extension.sh output paths (DerivedData)
  • Verified full build and sync pass cleanly on macOS and Ubuntu runners

Fixes #1

@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.98%. Comparing base (43ea932) to head (d8eacb5).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #181      +/-   ##
==========================================
+ Coverage   75.96%   75.98%   +0.01%     
==========================================
  Files          70       70              
  Lines       30367    30367              
==========================================
+ Hits        23069    23073       +4     
+ Misses       7298     7294       -4     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think better build and upload artifacts happen on new tags pushed, you can add this stage into release.yml workflow.

@ja7ad ja7ad added the enhancement New feature or request label Sep 13, 2026
@VedantMadane
VedantMadane force-pushed the ci/safari-extension-build branch from 83862ea to fdf1d53 Compare September 21, 2026 11:05
@ja7ad

ja7ad commented Sep 21, 2026

Copy link
Copy Markdown
Owner

@VedantMadane Please fix conflicts from main in your branch.

Add .github/workflows/safari-extension.yml that:
- regenerates Safari Resources from Chrome sources and fails if dirty
- validates MV3 manifest and required assets on Ubuntu
- builds the Safari wrapper app with full Xcode on macos-latest
- uploads the built .app as a CI artifact for inspection

Fixes ja7ad#1

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
safari-web-extension-converter creates Xcode projects with a macOS 10.14 deployment target by default. However, SFExtensionMessageKey requires macOS 11.0+ (Big Sur), causing xcodebuild in CI to fail with 'error: SFExtensionMessageKey is only available in macOS 11.0 or newer'.

- Add @available(macOS 11.0, *) and runtime availability fallback checks in SafariWebExtensionHandler.swift
- Ensure MACOSX_DEPLOYMENT_TARGET is at least 11.0 in project.pbxproj and pass MACOSX_DEPLOYMENT_TARGET=11.0 to xcodebuild in scripts/build-safari-extension.sh

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
safari-web-extension-converter defaults the parent app bundle ID to <prefix>.<app-name> (io.github.ja7ad.hydra.Hydra-Safari-Extension) while the extension uses io.github.ja7ad.hydra.safari.Extension. This triggers Xcode ValidateEmbeddedBinary error: 'Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier'.

Replace occurrences of io.github.ja7ad.hydra.Hydra-Safari-Extension with io.github.ja7ad.hydra.safari in project.pbxproj.

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@VedantMadane
VedantMadane force-pushed the ci/safari-extension-build branch from fdf1d53 to d8eacb5 Compare September 21, 2026 12:15
@ja7ad ja7ad changed the title ci: Safari extension sync, validate, and macOS build Add safari extension sync, validate, and macOS build Sep 21, 2026
@ja7ad
ja7ad merged commit de8386e into ja7ad:main Sep 21, 2026
14 checks passed
@ja7ad

ja7ad commented Sep 21, 2026

Copy link
Copy Markdown
Owner

@VedantMadane Thank you for contribution!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build and test safari extension and publish

2 participants