-
-
Notifications
You must be signed in to change notification settings - Fork 24
Add support for Safari #681
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
Open
Siedlerchr
wants to merge
23
commits into
main
Choose a base branch
from
safari
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
67588a4
Adapt config to use
Siedlerchr a131530
warnigns
Siedlerchr 42ca35c
Add safari support
Siedlerchr a9ddea7
prepare native messaging support
Siedlerchr 72fd466
native messaging works for safari as well
Siedlerchr cf51a7b
use oxt publisher
Siedlerchr c08fdbd
use wxt safari
Siedlerchr a230de8
run scripts
Siedlerchr 31bd780
patch project again
Siedlerchr 27f80c9
reduce timeout
Siedlerchr ecd9a19
revert config changes fix build on ci
Siedlerchr 3445e4b
remove al urls
Siedlerchr 1acd263
fix commands
Siedlerchr d87f557
safari needs background html, patch it into the xcode bundle
Siedlerchr d7650eb
add manual test
Siedlerchr ca2a184
Add workflow for maual tests
Siedlerchr 02fbfc4
Merge pull request #684 from JabRef/signingWorfklow
Siedlerchr 05a3e10
Merge remote-tracking branch 'origin/main' into safari
Siedlerchr b9e9425
set unique safari build number
Siedlerchr 251b02b
set unique safari build number
Siedlerchr a3a3dd4
Merge pull request #685 from JabRef/pathBuildNr
Siedlerchr 01acfdb
Merge remote-tracking branch 'origin/main' into safari
Siedlerchr 4d9af13
run linter
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| name: Safari Signing Test | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| run_safari_signing_test: | ||
| description: Run the Safari signing and publish step | ||
| type: boolean | ||
| required: true | ||
| default: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| safari-publish: | ||
| name: Safari Publish | ||
| runs-on: macos-26 | ||
| if: ${{ inputs.run_safari_signing_test }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 24.16.0 | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Build Safari project | ||
| run: make safari | ||
|
|
||
| - name: Set unique build number | ||
| shell: bash | ||
| run: | | ||
| build_number="$(date -u +%Y%m%d%H%M%S)${GITHUB_RUN_ATTEMPT}" | ||
| project_pbxproj='dist/safari/JabRef Browser Extension.xcodeproj/project.pbxproj' | ||
| perl -0pi -e "s/CURRENT_PROJECT_VERSION = [0-9]+;/CURRENT_PROJECT_VERSION = ${build_number};/g" "$project_pbxproj" | ||
|
|
||
| for plist in \ | ||
| 'dist/safari/JabRef Browser Extension/Info.plist' \ | ||
| 'dist/safari/JabRef Browser Extension Extension/Info.plist' \ | ||
| 'dist/safari/JabRef Browser Extension.app/Contents/Info.plist' \ | ||
| 'dist/safari/JabRef Browser Extension.app/Contents/PlugIns/JabRef Browser Extension Extension.appex/Contents/Info.plist' | ||
| do | ||
| if [ -f "$plist" ]; then | ||
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${build_number}" "$plist" >/dev/null 2>&1 || \ | ||
| /usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${build_number}" "$plist" | ||
| fi | ||
| done | ||
|
|
||
| - name: Upload Safari to App Store Connect | ||
| uses: rxliuli/safari-webext-publish-action@624701331ecbeb38464a09d3cac6d246b6efb006 | ||
| with: | ||
| project-path: "dist/safari" | ||
| bundle-identifier: "org.jabref.JabRef-Browser-Extension" | ||
| team-id: ${{ secrets.APPLE_TEAM_ID }} | ||
| app-signing-identity: ${{ secrets.SAFARI_APP_SIGNING_IDENTITY }} | ||
| installer-signing-identity: ${{ secrets.SAFARI_INSTALLER_SIGNING_IDENTITY }} | ||
| env: | ||
| APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| APPLE_MACOS_PROVISIONING_PROFILE_BASE64: ${{ secrets.APPLE_MACOS_PROVISIONING_PROFILE_BASE64 }} | ||
| APPLE_MACOS_EXTENSION_PROVISIONING_PROFILE_BASE64: ${{ secrets.APPLE_MACOS_EXTENSION_PROVISIONING_PROFILE_BASE64 }} | ||
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | ||
| APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | ||
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,27 @@ jobs: | |
|
|
||
| - name: Run tests | ||
| run: pnpm test | ||
|
|
||
| safari-build: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, this duplication is not easy to maintain. |
||
| name: Safari Build | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 24.16.0 | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Build Safari app | ||
| run: make safari | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| DIST := dist | ||
| SAFARI_DIR := $(DIST)/safari | ||
| SAFARI_PROJECT := $(SAFARI_DIR)/JabRef Browser Extension.xcodeproj | ||
| SAFARI_BUNDLE := $(DIST)/safari-mv3 | ||
| SAFARI_APP := $(SAFARI_DIR)/JabRef Browser Extension.app | ||
| SAFARI_DERIVED_DATA := $(SAFARI_DIR)/build | ||
|
|
||
| .PHONY: safari sign-safari-local notarize-safari-local clean-safari | ||
|
|
||
| safari: | ||
| rm -rf "$(SAFARI_DIR)" | ||
| rm -rf "$(SAFARI_BUNDLE)" | ||
| mkdir -p "$(DIST)" | ||
| pnpm build:safari | ||
| mkdir -p "$(SAFARI_DIR)" | ||
| node scripts/prepare_safari_bundle.mjs | ||
| node scripts/patch_safari_project.mjs | ||
| xcodebuild -project "$(SAFARI_PROJECT)" \ | ||
| -scheme "JabRef Browser Extension" \ | ||
| -configuration Release \ | ||
| -derivedDataPath "$(SAFARI_DERIVED_DATA)" \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGNING_ALLOWED=NO \ | ||
| build | ||
| ditto "$(SAFARI_DERIVED_DATA)/Build/Products/Release/JabRef Browser Extension.app" "$(SAFARI_APP)" | ||
|
|
||
| sign-safari-local: | ||
| chmod +x scripts/sign_safari_local.sh | ||
| ./scripts/sign_safari_local.sh "$(IDENTITY)" | ||
|
|
||
| notarize-safari-local: | ||
| chmod +x scripts/notarize_safari_local.sh | ||
| ./scripts/notarize_safari_local.sh "$(PROFILE)" | ||
|
|
||
| clean-safari: | ||
| rm -rf "$(SAFARI_DIR)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not merge this below with the
publishworkflow?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also instead of maintaining our version of publish/notarize/sign/whatever apple wants, can we reuse existing scripts please. Say https://github.com/rxliuli/safari-webext-publish-action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still unresolved. It should be just another matrix-option for macos/safari in the existing publish workflow.