Files
react-native/scripts/__tests__/create_github_release_test.sh
T
Héctor Ramos cd8dbd15ff Circle CI: Create GiHub Release draft when bumping version
Summary:
Automatically create a GitHub Release draft when a new React Native release is created.

The GitHub Release will be created by the same Circle CI job that publishes the package to npm.

This job will also upload the built Hermes binaries to the GitHub release.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D36646696

fbshipit-source-id: 0a863dc4e3215fc95f7852f8dc43858cdd852aaa
2022-07-14 13:42:08 -07:00

46 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Add your own Personal Access Token here.
# Create it at https://github.com/settings/tokens
GITHUB_TOKEN=""
# Setup Circle CI envvars
CIRCLE_TAG=""
CIRCLE_PROJECT_USERNAME=""
CIRCLE_PROJECT_REPONAME=""
if [ -z "$GITHUB_TOKEN" ]
then
echo "\$GITHUB_TOKEN is empty"
exit 1
fi
if [ -z "$CIRCLE_TAG" ]
then
echo "\$CIRCLE_TAG is empty"
exit 1
fi
if [ -z "$CIRCLE_PROJECT_USERNAME" ]
then
echo "\$CIRCLE_PROJECT_USERNAME is empty"
exit 1
fi
if [ -z "$CIRCLE_PROJECT_REPONAME" ]
then
echo "\$CIRCLE_PROJECT_REPONAME is empty"
exit 1
fi
# Dummy artifacts to upload
ARTIFACTS=("hermes-runtime-darwin-$CIRCLE_TAG.tar.gz")
for ARTIFACT_PATH in "${ARTIFACTS[@]}"
do
:
head -c 1024 </dev/urandom >"$ARTIFACT_PATH"
done
../circleci/create_github_release.sh "$CIRCLE_TAG" "$CIRCLE_PROJECT_USERNAME" "$CIRCLE_PROJECT_REPONAME" "$GITHUB_TOKEN" "${ARTIFACTS[@]}"