Giter Site home page Giter Site logo

safari-webstore-upload's Introduction

Safari Web Extension Publisher

This module uses Apple's safari-web-extension-converter to convert a Web Extension (i.e. Chrome Extension) to a Safari Web Extension, and uploads the native bundle to the Apple App Store using Fastlane. Deployment is available for both iOS and macOS platforms. Runs on both macOS and GitHub-hosted macOS runners. This is the Safari implementation for Plasmo Browser Platform Publisher.

Feature includes:

  • TypeScript API, with type exports
  • Pure ECMAScript module
  • Frozen dependencies, updated via renovatebot
  • Support for GitHub-hosted macOS runners

Limitations:

  • Only supports Manifest V2 extensions (for now)
  • This is beta software that may require handholding and knowledge of Xcode and Fastlane

Prerequisites (macOS Big Sur 11.3+)

  • Xcode (versions 13.2.1 or newer) xcode-select -s /Applications/Xcode_13.2.app
  • Xcode Command Line Tools xcode-select --install
  • Ruby (versions 2.5 or newer) brew install ruby
  • Bundler gem install bundler

Usage

  • Create cert storage with Fastlane Match (reference CodeSigning.guide) from any Mac; you won't need to set this up more than once
  • Create appIds (bundle identifiers) in App Store Connect manually or with Fastlane Produce
    • By default, extension bundle ids will be the same bundleId with .extension appended
    • Developers can optionally create their own extension bundle id and provide it with the extensionBundleId parameter
    • For Fastlane Produce, install Fastlane to your machine, run fastlane produce, and follow the prompts to create a new App through App Store Connect
  • Integrate into your GitHub Actions with Plasmo BPP

After App Store delivery

  • Create App Store page metadata
  • Manually submit the build for App Review

Options

App/Bundle Options

key required description
bundleId true i.e. com.plasmo.mock
extensionBundleId false i.e. com.plasmo.mock.extension
appName true i.e. Plasmo Mock
appCategory true last component of LSApplicationCategoryType (i.e. business)
platforms false defaults to iOS and macOS
buildNumber false defaults to GITHUB_RUN_NUMBER

Code Signing Identity

Read about Fastlane Appfile options

key description
appleId Your Apple email address
appleDevPortalId Apple Developer Account email address
teamName i.e. Plasmo Corp.
teamId i.e. Q2CBPJ58CA
itunesConnectId App Store Connect Account email address
itcTeamName i.e. "Company Name" for Apple IDs in multiple teams
itcTeamId i.e. "18742801" for Apple IDs in multiple teams

Code Signing Options

If you want to use custom provisioning profiles that weren't generated in the pattern of Fastlane Match provisioning profiles

key required description
provisioningProfiles false array of ProvisioningProfiles

App Store Connect API Key

Read about the App Store Connect API

key required description
keyId true i.e. "D383SF739"
key true i.e. "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHknlhdlYdLu\n-----END PRIVATE KEY-----"
issuerId true i.e. "6053b7fe-68a8-4acb-89be-165aa6465141"
duration false optional (maximum 1200)

Fastlane Match Options

Read about Fastlane Match options

key description
matchPassword shared storage encryption password
matchStorageMode defaults to git
matchGitUrl for git
matchGitBranch for git
matchGitBasicAuthorization for git
matchGitBearerAuthorization for git
matchGitPrivateKey for git
matchGoogleCloudBucketName for Google Cloud
matchGoogleCloudKeysFile for Google Cloud
matchGoogleCloudProjectId for Google Cloud
matchS3Region for S3
matchS3AccessKey for S3
matchS3SecretAccessKey for S3
matchS3Bucket for S3

Debugging Options

key description
workspace non-tmp static directory to generate workspace to (for file system debugging or project exports)
verbose toggle more detailed logs

GitHub Action Workflow

jobs:
  test:
    runs-on: macos-10.15
    timeout-minutes: 15
    steps:
      - name: Git - Checkout
        uses: actions/[email protected]
        with:
          ref: ${{ github.ref }}
      - name: Setup - Xcode
        run: xcode-select -s /Applications/Xcode_13.2.app
      - name: Setup - Ruby and bundler dependencies
        uses: ruby/[email protected]
        with:
          bundler-cache: true
      - name: Safari Webstore Upload via Browser Platform Publish
        uses: PlasmoHQ/bpp@v2
        with:
          keys: ${{ secrets.BPP_KEYS }}

Node.js API

import { SafariPublisher } from "@PlasmoHQ/safari-publisher"

const client = new SafariPublisher({
  "bundleId": "com.plasmo.mock",
  "appName": "Plasmo Mock",
  "appCategory": "developer-tools",
  "platforms": ["ios", "macos"],
  "appleId": "DEVELOPER_APPLE_ID",
  "teamId": "APPLE_DEVELOPER_TEAM_ID",
  "teamName": "Plasmo Corp.",
  "keyId": "APP_STORE_CONNECT_API_KEY_ID",
  "issuerId": "APP_STORE_CONNECT_API_ISSUER_ID",
  "key": "APP_STORE_CONNECT_API_KEY",
  "matchPassword": "YOUR_MATCH_ENCRYPTION_PASSWORD",
  "matchGitUrl": "YOUR_MATCH_REPO"
})


await client.submit({
  filePath: zip
})

Future

Adopt XcodeGen to simplify project generation and schema management

We currently manually modify the generated Xcode project to suit our needs, which may be difficult to maintain:

Acknowledgment

License

MIT โญ Plasmo Corp.

safari-webstore-upload's People

Contributors

danielsinclair avatar louisgv avatar renovate-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.