Skip to content

Safari: Automate setting the current version in manifest.json #5250

Closed

Description

@sindresorhus

I currently have to manually set the version in

"version": "0.0.0",

when I archive a build for Safari in Xcode.

It would be nice to have a Xcode run script that sets it automatically in the built app during archive.

Related to the discussion in #5203 about automating stuff.

Activity

  1. fregante commented on Dec 28, 2021

    @fregante
    Member

    Suggested solution: a prepare:safari script that:

    1. reads the version from the latest git tag
    2. rm -rf distribution
    3. npm run build
    4. sets the version in distribution/manifest.json and LocalOverrides.xcconfig file

    This can be a macOS-only sh file in the build folder.

    Thoughts?

    Edit: And/or the script suggested by Sindre in my PR

  2. sindresorhus commented on Dec 28, 2021

    @sindresorhus
    MemberAuthor

    Sounds good.

    It would be slightly cleaner to do the version setting of distribution/manifest.json in the archived build (using Xcode run script) as it wouldn't cause a dirty Git tree (since the source file would not be modified).

  3. sindresorhus commented on Dec 28, 2021

    @sindresorhus
    MemberAuthor

    3. should also npm install.

  4. fregante commented on Dec 29, 2021

    @fregante
    Member

    I forget that that file isn't built. Hopefully I'll be able to use Parcel soon enough for that to stop being a problem. In the meanwhile we can restore CopyWebpackPlugin to move those files. I think it's more difficult to change the version in the archived extension

  5. sindresorhus commented on Dec 29, 2021

    @sindresorhus
    MemberAuthor

    The path would be something like this in a run script:

    "${BUILT_PRODUCTS_DIR}/[FIND EXACT PATH]/manifest.json"
    
  6. added
    safari
    meta
    and removed on Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedmetasafari

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions