Skip to content

Commit

Permalink
chore: release v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
uetchy committed Jan 5, 2021
1 parent fb92877 commit 4ff1163
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 113 deletions.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ yarn format # => format code with SwiftFormat
## Release (Maintainers only)

```bash
VERSION=3.2.0 node Scripts/update-version.js
git add .
git commit -m 'chore: release v3.2.0'
yarn ship:mas # for Mac App Store
```
4 changes: 2 additions & 2 deletions Polyglot/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1</string>
<string>3.2.0</string>
<key>CFBundleVersion</key>
<string>3.1.0</string>
<string>3.2.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down
154 changes: 77 additions & 77 deletions PolyglotSafariExtension/Info.plist
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Polyglot</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.1</string>
<key>CFBundleVersion</key>
<string>3.1.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariExtensionHandler</string>
<key>SFSafariContentScript</key>
<array>
<dict>
<key>Script</key>
<string>content.bundle.js</string>
</dict>
</array>
<key>SFSafariContextMenu</key>
<array>
<dict>
<key>Command</key>
<string>tarnslateSelectedText</string>
<key>Text</key>
<string>Translate</string>
</dict>
</array>
<key>SFSafariExtensionBundleIdentifiersToUninstall</key>
<array>
<string>co.randompaper.polyglot.extension</string>
</array>
<key>SFSafariStyleSheet</key>
<array>
<dict>
<key>Style Sheet</key>
<string>content.css</string>
</dict>
</array>
<key>SFSafariToolbarItem</key>
<dict>
<key>Action</key>
<string>Command</string>
<key>Identifier</key>
<string>translateButton</string>
<key>Image</key>
<string>toolbar-icon.png</string>
<key>Label</key>
<string>Translate</string>
</dict>
<key>SFSafariWebsiteAccess</key>
<dict>
<key>Level</key>
<string>All</string>
</dict>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Yasuaki Uechi. Apache 2.0 license.</string>
<key>NSHumanReadableDescription</key>
<string>Translate selected text into your native language.</string>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Polyglot</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>3.2.0</string>
<key>CFBundleVersion</key>
<string>3.2.0</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariExtensionHandler</string>
<key>SFSafariContentScript</key>
<array>
<dict>
<key>Script</key>
<string>content.bundle.js</string>
</dict>
</array>
<key>SFSafariContextMenu</key>
<array>
<dict>
<key>Command</key>
<string>tarnslateSelectedText</string>
<key>Text</key>
<string>Translate</string>
</dict>
</array>
<key>SFSafariExtensionBundleIdentifiersToUninstall</key>
<array>
<string>co.randompaper.polyglot.extension</string>
</array>
<key>SFSafariStyleSheet</key>
<array>
<dict>
<key>Style Sheet</key>
<string>content.css</string>
</dict>
</array>
<key>SFSafariToolbarItem</key>
<dict>
<key>Action</key>
<string>Command</string>
<key>Identifier</key>
<string>translateButton</string>
<key>Image</key>
<string>toolbar-icon.png</string>
<key>Label</key>
<string>Translate</string>
</dict>
<key>SFSafariWebsiteAccess</key>
<dict>
<key>Level</key>
<string>All</string>
</dict>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Yasuaki Uechi. Apache 2.0 license.</string>
<key>NSHumanReadableDescription</key>
<string>Translate selected text into your native language.</string>
</dict>
</plist>
58 changes: 26 additions & 32 deletions Scripts/update-version.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
#!/usr/bin/env node

const path = require('path')
const fs = require('fs')
const assert = require('assert')
const { execSync } = require('child_process')
const plist = require('plist')
const path = require("path");
const fs = require("fs");
const assert = require("assert");
const plist = require("plist");

const shortVersion = process.env.VERSION
assert(shortVersion, 'specify VERSION envvar')
const bundleVersion = process.env.VERSION;
assert(bundleVersion, "specify VERSION envvar");

const buildId = process.env.BUILD
assert(buildId, 'specify BUILD envvar')

const bundleVersion = shortVersion + '.' + buildId

console.log(`CFBundleShortVersionString: ${shortVersion}`)
console.log(`CFBundleVersion: ${bundleVersion}`)
console.log(`CFBundleShortVersionString: ${bundleVersion}`);
console.log(`CFBundleVersion: ${bundleVersion}`);

// rewrite `Polyglot/Info.plist`
const appInfoPath = path.resolve(__dirname, '../Polyglot/Info.plist')
console.log(`rewriting '${appInfoPath}'`)
const appInfo = plist.parse(fs.readFileSync(appInfoPath, 'utf8'))
appInfo['CFBundleShortVersionString'] = shortVersion
appInfo['CFBundleVersion'] = bundleVersion
fs.writeFileSync(appInfoPath, plist.build(appInfo))
const appInfoPath = path.resolve(__dirname, "../Polyglot/Info.plist");
console.log(`rewriting '${appInfoPath}'`);
const appInfo = plist.parse(fs.readFileSync(appInfoPath, "utf8"));
appInfo["CFBundleShortVersionString"] = bundleVersion;
appInfo["CFBundleVersion"] = bundleVersion;
fs.writeFileSync(appInfoPath, plist.build(appInfo));

// rewrite `PolyglotSafariExtension/Info.plist`
const extInfoPath = path.resolve(
__dirname,
'../PolyglotSafariExtension/Info.plist'
)
console.log(`rewriting '${extInfoPath}'`)
const extInfo = plist.parse(fs.readFileSync(extInfoPath, 'utf8'))
extInfo['CFBundleShortVersionString'] = shortVersion
extInfo['CFBundleVersion'] = bundleVersion
fs.writeFileSync(extInfoPath, plist.build(extInfo))
"../PolyglotSafariExtension/Info.plist"
);
console.log(`rewriting '${extInfoPath}'`);
const extInfo = plist.parse(fs.readFileSync(extInfoPath, "utf8"));
extInfo["CFBundleShortVersionString"] = bundleVersion;
extInfo["CFBundleVersion"] = bundleVersion;
fs.writeFileSync(extInfoPath, plist.build(extInfo));

// rewrite `package.json`
const packagePath = path.resolve(__dirname, '../package.json')
console.log(`rewriting '${packagePath}'`)
const package = require(packagePath)
package.version = bundleVersion
fs.writeFileSync(packagePath, JSON.stringify(package, null, 2))
const packagePath = path.resolve(__dirname, "../package.json");
console.log(`rewriting '${packagePath}'`);
const package = require(packagePath);
package.version = bundleVersion;
fs.writeFileSync(packagePath, JSON.stringify(package, null, 2));
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polyglot",
"description": "A Safari extension that translates selected text into your native language.",
"version": "3.1.0",
"version": "3.2.0",
"scripts": {
"build": "yarn build:script && yarn build:app",
"build:app": "xcodebuild clean build archive -scheme Polyglot -archivePath ./Artifacts/Polyglot.xcarchive",
Expand Down Expand Up @@ -51,4 +51,4 @@
},
"license": "Apache-2.0",
"private": true
}
}

0 comments on commit 4ff1163

Please sign in to comment.