From 55c919b09131fb697e885e7fe0fb50e5828ad3b3 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Tue, 24 Sep 2019 14:58:12 +0800 Subject: [PATCH] fix: ci scripts --- .circleci/config.yml | 30 +++++++++++++----------------- package.json | 4 +--- scripts/ci-build.js | 10 +++++----- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0542dd4443df..e34cb84dcb88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,32 +23,28 @@ jobs: - node_modules key: v1-maskbook-{{ .Branch }}-{{ checksum "yarn.lock" }} - store_artifacts: - path: Maskbook.zip - destination: /Maskbook.zip + path: Maskbook.base.zip + destination: /Maskbook.base.zip - store_artifacts: - path: Maskbook.WKWebview.zip - destination: /Maskbook.WKWebview.zip + path: Maskbook.iOS.zip + destination: /Maskbook.iOS.zip - store_artifacts: path: Maskbook.chromium.zip destination: /Maskbook.chromium.zip - store_artifacts: - path: Maskbook.firefoxDesktop.zip - destination: /Maskbook.firefoxDesktop.zip + path: Maskbook.firefox.zip + destination: /Maskbook.firefox.zip - store_artifacts: - path: Maskbook.firefoxGeckoview.zip - destination: /Maskbook.firefoxGeckoview.zip - - store_artifacts: - path: Maskbook.firefoxAndroid.zip - destination: /Maskbook.firefoxAndroid.zip + path: Maskbook.gecko.zip + destination: /Maskbook.gecko.zip - persist_to_workspace: root: ~/repo/ paths: - - Maskbook.zip - - Maskbook.WKWebview.zip + - Maskbook.base.zip + - Maskbook.iOS.zip - Maskbook.chromium.zip - - Maskbook.firefoxDesktop.zip - - Maskbook.firefoxGeckoview.zip - - Maskbook.firefoxAndroid.zip + - Maskbook.firefox.zip + - Maskbook.gecko.zip publish-github-release: docker: - image: cibuilds/github:0.10 @@ -70,7 +66,7 @@ jobs: 🐛 Bug Fixes - 👩‍💻 Miscellaneous" -replace -draft -prerelease $(git describe HEAD) ~/repo/Maskbook.zip + 👩‍💻 Miscellaneous" -replace -draft $(git describe HEAD) ~/repo/Maskbook.base.zip # -b BODY \ # Set text describing the contents of the release # -delete \ # Delete release and its git tag in advance if it exists (same as -recreate) # -n TITLE \ # Set release title diff --git a/package.json b/package.json index 567ad5d25f79..819d57a3b9cc 100644 --- a/package.json +++ b/package.json @@ -15,15 +15,13 @@ "start:gecko": "react-app-rewired start --firefox-gecko", "start:ios": "react-app-rewired start --wk-webview", - "prepare:firefox": "firefox -CreateProfile ./.firefox", - "build": "react-app-rewired build", "build:base": "react-app-rewired build", "build:debugging": "node --inspect-brk node_modules/react-app-rewired/scripts/build.js", "build:gecko": "react-app-rewired build --firefox-gecko", "build:firefox": "react-app-rewired build --firefox", "build:chromium": "react-app-rewired build --chromium", - "build:ios": "react-app-rewired start --wk-webview", + "build:ios": "react-app-rewired build --wk-webview", "test": "react-app-rewired test", diff --git a/scripts/ci-build.js b/scripts/ci-build.js index a17f2d987a87..a1b214164048 100644 --- a/scripts/ci-build.js +++ b/scripts/ci-build.js @@ -19,8 +19,10 @@ async function main() { } const currentBranch = (await getCurrentGITBranchName()).toLowerCase() for (const [first, ...args] of getCommands(buildTypes(currentBranch))) { + console.log('executing', first, ...args) await spawn(first, args) } + process.exit(0) } main().catch(e => { console.error(e) @@ -43,7 +45,6 @@ function buildTypes(branchName) { function getBuildCommand(platforms) { return platforms .sort() - .map(x => x.toLowerCase()) .map(generateCommand) .join('\n') /** @param {('base' | 'iOS' | 'chromium' | 'firefox' | 'gecko')} type */ @@ -56,10 +57,9 @@ function getBuildCommand(platforms) { ` } return ` - yarn build:${type} - cd build - zip -r ../Maskbook.${type}.zip ./* - cd .. + echo "Building for target ${type}" + yarn build:${type.toLowerCase()} + bash -c "cd build && zip -r ../Maskbook.${type}.zip ./* && cd .." rm -rf build ` }