npm publish
Reviewed By: jknoxville Differential Revision: D17161868 fbshipit-source-id: 65be618c6e231eec2d680906e80599889401ced7
This commit is contained in:
committed by
Facebook Github Bot
parent
9202e96018
commit
631b743643
@@ -1,19 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
{
|
|
||||||
"command": "SandcastleUniversalCommand",
|
|
||||||
"user": "__USER__",
|
|
||||||
"args": {
|
|
||||||
"name": "Release public Flipper build",
|
|
||||||
"oncall": "danielbuechele",
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"name": "Clone from GitHub",
|
|
||||||
"required": true,
|
|
||||||
"shell":
|
|
||||||
"git -c http.proxy=fwdproxy:8080 -c https.proxy=fwdproxy:8080 clone https://github.com/facebook/flipper.git ../xplat/sonar-public"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Copy Sandcastle script",
|
|
||||||
"required": true,
|
|
||||||
"shell": "cp -r ../xplat/sonar/scripts/facebook/ ../xplat/sonar-public/scripts/facebook"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Create build",
|
|
||||||
"required": true,
|
|
||||||
"shell": "cd ../xplat/sonar-public/scripts/facebook && ./sandcastle-build.sh __VERSION__"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Copy artifacts for syncing",
|
|
||||||
"required": true,
|
|
||||||
"shell": "cp -R ../xplat/sonar-public/dist/ $SANDCASTLE_NEXUS/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Sync to local",
|
|
||||||
"step_type": "sync_step",
|
|
||||||
"from": "remote",
|
|
||||||
"to": "local",
|
|
||||||
"paths": ["Flipper-mac.zip", "manifest.json"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Publish to github",
|
|
||||||
"required": true,
|
|
||||||
"shell":
|
|
||||||
"curl -o RELEASE.json -x fwdproxy:8080 --silent --data '{ \"tag_name\": \"v'$(cat $SANDCASTLE_NEXUS/manifest.json | jq -r .version_name)'\", \"target_commitish\": \"master\", \"name\": \"v'$(cat $SANDCASTLE_NEXUS/manifest.json | jq -r .version_name)'\", \"body\": \"\", \"draft\": false, \"prerelease\": false}' https://api.github.com/repos/facebook/flipper/releases?access_token=$(secrets_tool get SONAR_GITHUB_TOKEN)",
|
|
||||||
"shell_type": "SandcastleLocalShell"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Upload",
|
|
||||||
"required": true,
|
|
||||||
"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__"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"alias": "flipper_release_public_build",
|
|
||||||
"capabilities": {
|
|
||||||
"vcs": "fbcode-fbsource",
|
|
||||||
"type": "lego-mac"
|
|
||||||
},
|
|
||||||
"hash": "master",
|
|
||||||
"report": [
|
|
||||||
{
|
|
||||||
"type": "email",
|
|
||||||
"report_to_owner": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/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.
|
|
||||||
|
|
||||||
echo "✨ Creating new Flipper release on GitHub..."
|
|
||||||
MAJOR=$(curl -x fwdproxy:8080 --silent https://raw.githubusercontent.com/facebook/flipper/master/package.json | jq -r '.version' | sed -E 's/[0-9]+$//g')
|
|
||||||
|
|
||||||
echo "What should the patch version of the next release be? (v${MAJOR}_)"
|
|
||||||
|
|
||||||
read -r VERSION
|
|
||||||
if ! [[ $VERSION =~ ^[0-9]+$ ]] ; then
|
|
||||||
echo "error: Version needs to be a number" >&2; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Creating version $MAJOR$VERSION and releasing to GitHub..."
|
|
||||||
TMP_DIR=$(mktemp -d)
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
||||||
JSON=$(cat "$DIR/public-build.json")
|
|
||||||
JSON=${JSON/__VERSION__/$VERSION}
|
|
||||||
JSON=${JSON/__USER__/$USER}
|
|
||||||
echo "$JSON" > "$TMP_DIR/job.json"
|
|
||||||
|
|
||||||
scutil create "$TMP_DIR/job.json"
|
|
||||||
echo "✅ GitHub release will be automatically created once the Sandcastle job finishes."
|
|
||||||
|
|
||||||
rm -rf "$TMP_DIR"
|
|
||||||
Reference in New Issue
Block a user