Skip to content

Commit

Permalink
fix: ci scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Sep 24, 2019
1 parent 4083ea2 commit 55c919b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
30 changes: 13 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
10 changes: 5 additions & 5 deletions scripts/ci-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 */
Expand All @@ -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
`
}
Expand Down

0 comments on commit 55c919b

Please sign in to comment.