Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prompt for oauth credentials during build #2783

Merged
merged 2 commits into from
Oct 2, 2023
Merged
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
35 changes: 34 additions & 1 deletion create-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@

# Extract version from package.json
VERSION=$(node -pe "require('./package.json').version")
NODE_ENV=production

if [ -z ${ALBY_OAUTH_CLIENT_ID_CHROME+x} ];
then
echo "OAuth client id for Chrome:"
read ALBY_OAUTH_CLIENT_ID_CHROME
fi

if [ -z ${ALBY_OAUTH_CLIENT_SECRET_CHROME+x} ];
then
echo "OAuth client secret for Chrome:"
read ALBY_OAUTH_CLIENT_SECRET_CHROME
fi

if [ -z ${ALBY_OAUTH_CLIENT_ID_FIREFOX+x} ];
then
echo "OAuth client id for Firefox:"
read ALBY_OAUTH_CLIENT_ID_FIREFOX
fi

if [ -z ${ALBY_OAUTH_CLIENT_SECRET_FIREFOX+x} ];
then
echo "OAuth client secret for Firefox:"
read ALBY_OAUTH_CLIENT_SECRET_FIREFOX
fi

if [ -z ${ALBY_API_URL+x} ];
then
ALBY_API_URL="https://api.getalby.com"
fi

echo "Creating the build for v$VERSION"
yarn build

echo "Creating zip packages for v$VERSION"
cd dist/production
Expand Down Expand Up @@ -38,4 +71,4 @@ echo "Created alby-opera-v$VERSION.crx (SHA512: $SHA)"

echo "done!"

cd ../../../
cd ../../../
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build:firefox": "NODE_ENV=production TARGET_BROWSER=firefox webpack",
"build:opera": "NODE_ENV=production TARGET_BROWSER=opera webpack",
"build": "yarn build:chrome && yarn build:firefox && yarn build:opera",
"package": "yarn build && ./create-packages.sh",
"package": "./create-packages.sh",
"lint": "yarn lint:js && yarn tsc:compile && yarn format:fix",
"lint:js": "eslint src --ext .js,.jsx,.ts,.tsx --max-warnings 0",
"lint:js:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
Expand Down
Loading