Linux and Windows builds

Summary:
Adds windows and linux builds to Sandcastle

allow-large-files

Reviewed By: jknoxville

Differential Revision: D8379581

fbshipit-source-id: 94c80fc91c69f43b7dc0c7eb8b2ee5ace4daf888
This commit is contained in:
Daniel Büchele
2018-06-13 09:01:36 -07:00
committed by Facebook Github Bot
parent 32382b2999
commit 50490b9435
5 changed files with 23 additions and 30 deletions

View File

@@ -15,14 +15,11 @@ matrix:
script:
- yarn lint
- yarn build macOnly build-number=$TRAVIS_BUILD_NUMBER
- yarn build --mac --version=$TRAVIS_BUILD_NUMBER
- cd website
- yarn build
- cd ..
before_deploy:
- export SONAR_VERSION="v$(plutil -p $TRAVIS_BUILD_DIR/dist/mac/Sonar.app/Contents/Info.plist | awk '/CFBundleShortVersionString/ {print substr($3, 2, length($3)-2)}')"
deploy:
- provider: pages
skip-cleanup: true
@@ -32,14 +29,6 @@ matrix:
keep-history: true
on:
branch: master
- provider: releases
api_key: $GITHUB_TOKEN
file: dist/Sonar.zip
name: $SONAR_VERSION
draft: true
skip_cleanup: true
on:
branch: master
- language: objective-c

View File

@@ -51,11 +51,9 @@ yarn start
## Building the desktop app
```
yarn build [macOnly] [build-number=$buildNumber]
yarn build --mac --version $buildNumber
```
A binary for macOS is created in `dist/mac`. `macOnly` and `build-number` are optional params.
## Documentation
Find the full documentation for this project at [fbsonar.com](https://fbsonar.com/docs).

View File

@@ -13,7 +13,7 @@
"build": {
"appId": "sonar",
"productName": "Sonar",
"artifactName": "Sonar.${ext}",
"artifactName": "Sonar-${os}.${ext}",
"mac": {
"category": "public.app-category.developer-tools"
},
@@ -22,6 +22,7 @@
}
},
"devDependencies": {
"7zip-bin-mac": "^1.0.1",
"babel-eslint": "^8.2.1",
"electron": "^2.0.1",
"electron-builder": "^19.49.0",

View File

@@ -52,14 +52,11 @@ function modifyPackageManifest(buildFolder) {
manifest.dependencies = manifestStatic.dependencies;
manifest.main = 'index.js';
const BUILD_NUMBER_ARG = 'build-number=';
const buildNumber = (
process.argv.find(arg => arg.startsWith(BUILD_NUMBER_ARG)) || ''
).replace(BUILD_NUMBER_ARG, '');
if (buildNumber) {
const buildNumber = process.argv.join(' ').match(/--version=(\d+)/);
if (buildNumber && buildNumber.length > 0) {
manifest.version = [
...manifest.version.split('.').slice(0, 2),
buildNumber,
buildNumber[1],
].join('.');
}
@@ -80,14 +77,18 @@ function modifyPackageManifest(buildFolder) {
function buildDist(buildFolder) {
const targetsRaw = [];
targetsRaw.push(Platform.MAC.createTarget(['zip']));
if (process.argv.slice(2).indexOf('macOnly') === -1) {
targetsRaw.push(Platform.LINUX.createTarget(['dir']));
targetsRaw.push(Platform.WINDOWS.createTarget(['dir']));
}
if (process.argv.indexOf('--mac') > -1) {
targetsRaw.push(Platform.MAC.createTarget(['zip']));
}
if (process.argv.indexOf('--linux') > -1) {
targetsRaw.push(Platform.LINUX.createTarget(['zip']));
}
if (process.argv.indexOf('--win') > -1) {
targetsRaw.push(Platform.WINDOWS.createTarget(['zip']));
}
if (!targetsRaw.length) {
throw new Error('No targets specified. eg. --osx pkg,dmg --linux tar.gz');
throw new Error('No targets specified. eg. --mac, --win, or --linux');
}
// merge all target maps into a single map

View File

@@ -2,6 +2,10 @@
# yarn lockfile v1
"7zip-bin-mac@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/7zip-bin-mac/-/7zip-bin-mac-1.0.1.tgz#3e68778bbf0926adc68159427074505d47555c02"
"7zip-bin@~3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-3.0.0.tgz#17416dc542f41511b26a9667b92847d75ef150fe"