diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..39ad65981 --- /dev/null +++ b/.npmignore @@ -0,0 +1,6 @@ +** +!src/**/* +__tests__ +.DS_Store +src/plugins/**/* +src/fb/**/* diff --git a/package.json b/package.json index 090ce57d1..d5f98882c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "flipper", - "private": true, "version": "0.23.4", "versionDate": "2018-4-12", "description": "Mobile development tool", diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh new file mode 100755 index 000000000..7c3dc5fc6 --- /dev/null +++ b/scripts/npm-publish.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the LICENSE file +# in the root directory of this source tree. + +set -e + +THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) +cd "$THIS_DIR/.." + +# remove scripts section from package.json, because we don't want post-install scripts executed for plugin developers +jq 'del(.scripts)' package.json > package2.json +rm package.json +mv package2.json package.json + +echo "//registry.yarnpkg.com/:_authToken=$(secrets_tool get FLIPPER_NPM_TOKEN)" > ~/.npmrc +../third-party/yarn/yarn publish --proxy http://fwdproxy:8080 --https-proxy http://fwdproxy:8080 --new-version "$1" +rm -rf ~/.npmrc diff --git a/scripts/public-build.json b/scripts/public-build.json index 5776695da..ebe77ee64 100644 --- a/scripts/public-build.json +++ b/scripts/public-build.json @@ -46,6 +46,11 @@ "shell": "curl -x fwdproxy:8080 $(cat RELEASE.json | jq -r '.upload_url' | sed -e 's#{?name,label}##')'?access_token='$(secrets_tool get SONAR_GITHUB_TOKEN)'&name=Flipper.zip' --header 'Content-Type: application/zip' --upload-file $SANDCASTLE_NEXUS'/Flipper-mac.zip' -X POST", "shell_type": "SandcastleLocalShell" + }, + { + "name": "NPM publish", + "required": true, + "shell": "cd ../xplat/sonar-public/scripts/ && ./npm-publish.sh __VERSION__" } ] },