From 4ff11635958c940d0873f96c23d4e2a82698b7f9 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Tue, 5 Jan 2021 20:10:07 +0900 Subject: [PATCH] chore: release v3.2.0 --- CONTRIBUTING.md | 3 + Polyglot/Info.plist | 4 +- PolyglotSafariExtension/Info.plist | 154 ++++++++++++++--------------- Scripts/update-version.js | 58 +++++------ package.json | 4 +- 5 files changed, 110 insertions(+), 113 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index baeadc5..bee0320 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ``` diff --git a/Polyglot/Info.plist b/Polyglot/Info.plist index fb08df0..4fb7bd8 100644 --- a/Polyglot/Info.plist +++ b/Polyglot/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 3.1 + 3.2.0 CFBundleVersion - 3.1.0 + 3.2.0 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/PolyglotSafariExtension/Info.plist b/PolyglotSafariExtension/Info.plist index 675fade..7a1b400 100644 --- a/PolyglotSafariExtension/Info.plist +++ b/PolyglotSafariExtension/Info.plist @@ -1,80 +1,80 @@ - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Polyglot - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - XPC! - CFBundleShortVersionString - 3.1 - CFBundleVersion - 3.1.0 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSExtension - - NSExtensionPointIdentifier - com.apple.Safari.extension - NSExtensionPrincipalClass - $(PRODUCT_MODULE_NAME).SafariExtensionHandler - SFSafariContentScript - - - Script - content.bundle.js - - - SFSafariContextMenu - - - Command - tarnslateSelectedText - Text - Translate - - - SFSafariExtensionBundleIdentifiersToUninstall - - co.randompaper.polyglot.extension - - SFSafariStyleSheet - - - Style Sheet - content.css - - - SFSafariToolbarItem - - Action - Command - Identifier - translateButton - Image - toolbar-icon.png - Label - Translate - - SFSafariWebsiteAccess - - Level - All - - - NSHumanReadableCopyright - Copyright © 2019 Yasuaki Uechi. Apache 2.0 license. - NSHumanReadableDescription - Translate selected text into your native language. - - + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Polyglot + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + XPC! + CFBundleShortVersionString + 3.2.0 + CFBundleVersion + 3.2.0 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSExtension + + NSExtensionPointIdentifier + com.apple.Safari.extension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).SafariExtensionHandler + SFSafariContentScript + + + Script + content.bundle.js + + + SFSafariContextMenu + + + Command + tarnslateSelectedText + Text + Translate + + + SFSafariExtensionBundleIdentifiersToUninstall + + co.randompaper.polyglot.extension + + SFSafariStyleSheet + + + Style Sheet + content.css + + + SFSafariToolbarItem + + Action + Command + Identifier + translateButton + Image + toolbar-icon.png + Label + Translate + + SFSafariWebsiteAccess + + Level + All + + + NSHumanReadableCopyright + Copyright © 2019 Yasuaki Uechi. Apache 2.0 license. + NSHumanReadableDescription + Translate selected text into your native language. + + \ No newline at end of file diff --git a/Scripts/update-version.js b/Scripts/update-version.js index 22a0ea4..e8b503e 100755 --- a/Scripts/update-version.js +++ b/Scripts/update-version.js @@ -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)); diff --git a/package.json b/package.json index cd386f3..5850c52 100644 --- a/package.json +++ b/package.json @@ -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", @@ -51,4 +51,4 @@ }, "license": "Apache-2.0", "private": true -} +} \ No newline at end of file