Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .github/workflows/create_test_patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,15 @@ jobs:
# yarn3+ by default disables lockfile alteration in CI. We want it.
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
PACKAGE_LIST=`find packages -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | egrep -v 'template|invites'`
mkdir $HOME/packages
for PACKAGE in $PACKAGE_LIST; do
echo "Packing PR version of package $PACKAGE"
pushd packages/$PACKAGE;
yarn pack;
mv package.tgz $HOME/packages/react-native-firebase-${PACKAGE}.tgz;
ls -la $HOME/packages/*${PACKAGE}*
popd;
done
ls -la $HOME/packages/
./.github/workflows/scripts/create_npm_packages.sh ./packages $HOME/packages
cd $HOME
npx @react-native-community/cli init template --skip-install --skip-git-init
cd template
yarn
yarn add patch-package --dev
mkdir patches || true
for PACKAGE in $PACKAGE_LIST; do
PACKED_PACKAGE_LIST=`find $HOME/packages/ -maxdepth 1 -mindepth 1 -type f -exec basename -s .tgz {} \; | cut -d'-' -f4-10 | sort`
for PACKAGE in $PACKED_PACKAGE_LIST; do
echo "Installing package $PACKAGE into fresh template app, then clobbering with PR version"
yarn add @react-native-firebase/$PACKAGE || true
if [ -d node_modules/@react-native-firebase/$PACKAGE ]; then
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/scripts/create_npm_packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

SOURCE_PACKAGE_DIR="$1"
TARGET_PACKAGE_DIR="$2"

echo "Creating local npm packages from source '${SOURCE_PACKAGE_DIR}' in '${TARGET_PACKAGE_DIR}'..."

# Make sure our target directory exists and is clean from previous runs
if ! [ -d "${TARGET_PACKAGE_DIR}" ]; then
mkdir "${TARGET_PACKAGE_DIR}"
else
rm -f "${TARGET_PACKAGE_DIR}"/*.tgz
fi

if ! [ -d "${SOURCE_PACKAGE_DIR}" ]; then
echo "Source package dir '${SOURCE_PACKAGE_DIR} not found."
exit 1;
fi

# Get our full list of packages, except any we specifically ignore
IGNORED_PACKAGE_NAMES='template|invites'
PACKAGE_LIST=`find ${SOURCE_PACKAGE_DIR} -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | egrep -v "${IGNORED_PACKAGE_NAMES}"`

# Pack up each package
for PACKAGE in $PACKAGE_LIST; do
echo "Creating package for $PACKAGE from local source"
pushd "${SOURCE_PACKAGE_DIR}/${PACKAGE}";
yarn pack;
mv package.tgz "${TARGET_PACKAGE_DIR}/react-native-firebase-${PACKAGE}.tgz";
ls -la "${TARGET_PACKAGE_DIR}/react-native-firebase-${PACKAGE}.tgz"
popd;
done
ls -la "${TARGET_PACKAGE_DIR}"
Loading