2023-05-09 10:33:21 +00:00
|
|
|
# #! /bin/zsh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Check node and yarn versions
|
|
|
|
YARN_VERSION=$(yarn --version)
|
|
|
|
if [ "$YARN_VERSION" != "1.22.18" ]; then
|
|
|
|
echo "Incorrect yarn version: $YARN_VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Source secrets
|
|
|
|
source .env.publish
|
|
|
|
|
|
|
|
# Create folder for the publish build
|
2023-05-11 07:13:28 +00:00
|
|
|
cd ../
|
2023-05-09 10:33:21 +00:00
|
|
|
rm -rf build_publish
|
|
|
|
mkdir build_publish
|
|
|
|
cd build_publish
|
|
|
|
|
|
|
|
# Clone and cd into books
|
|
|
|
git clone https://github.com/frappe/books --depth 1
|
|
|
|
cd books
|
|
|
|
|
|
|
|
# Copy creds to log_creds.txt
|
|
|
|
echo $ERR_LOG_KEY > log_creds.txt
|
|
|
|
echo $ERR_LOG_SECRET >> log_creds.txt
|
|
|
|
echo $ERR_LOG_URL >> log_creds.txt
|
|
|
|
echo $TELEMETRY_URL >> log_creds.txt
|
|
|
|
|
|
|
|
|
2023-05-10 04:05:52 +00:00
|
|
|
# Install Dependencies
|
2023-05-09 10:33:21 +00:00
|
|
|
yarn install
|
2023-05-10 04:05:52 +00:00
|
|
|
|
|
|
|
# Set .env and build
|
2023-05-11 07:13:28 +00:00
|
|
|
export GH_TOKEN=$GH_TOKEN &&
|
2023-05-10 04:05:52 +00:00
|
|
|
export CSC_IDENTITY_AUTO_DISCOVERY=true &&
|
|
|
|
export APPLE_ID=$APPLE_ID &&
|
|
|
|
export APPLE_TEAM_ID=$APPLE_TEAM_ID &&
|
|
|
|
export APPLE_APP_SPECIFIC_PASSWORD=$APPLE_APP_SPECIFIC_PASSWORD &&
|
2023-06-21 06:58:20 +00:00
|
|
|
yarn build --mac --publish=always
|
2023-05-09 10:33:21 +00:00
|
|
|
|
2023-05-11 07:13:28 +00:00
|
|
|
cd ../books
|