-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Breaking Changes * Drop support for node pre v12 * Switch to node 14 in CI workflows * Update to Node 14 Runtime in cloud functions ## Features/Updates * react-hook-form v6 to v7 * cypress v6 to v7 * Adding preview channel to verify workflow (with associated delete preview channel workflow which removes preview channel on merge) * Update `husky` v4 to v6 * Update `yeoman-generator` from v4 to v5 * Update `yeoman-test` from v2 to v6
- Loading branch information
1 parent
44afb7c
commit 97731f3
Showing
124 changed files
with
4,236 additions
and
3,182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,10 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node 12 | ||
- name: Use Node 14 | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 12 | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Get yarn cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x] | ||
node-version: [12.x, 14.x] | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lint-staged |
107 changes: 0 additions & 107 deletions
107
examples/react-firebase-redux/src/routes/Projects/components/ProjectsList/ProjectsList.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"projects": { | ||
"default": "redux-firebasev3", | ||
"master": "redux-firebasev3", | ||
"main": "redux-firebasev3", | ||
"prod": "redux-firebasev3" | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
examples/react-firebase/.github/workflows/delete-preview-channel.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Delete Preview Channel | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [closed] | ||
|
||
jobs: | ||
check: | ||
name: remove channel | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
node-version: [14.x] | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Get Yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Cache Yarn dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ matrix.app }}-preview-remove-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Remove Preview Channel | ||
env: | ||
GCLOUD_PROJECT: redux-firebasev3 | ||
PR_NUMBER: ${{ github.event.number }} | ||
APP_NAME: ${{ matrix.app }} | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
run: | | ||
./bin/remove-preview-channel.js --pullRequest=$PR_NUMBER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
- name: Setup Node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 12 | ||
node-version: 14 | ||
|
||
- name: Get Library Versions For Binary Caching | ||
id: cache-settings | ||
|
@@ -43,70 +43,37 @@ jobs: | |
yarn install --frozen-lockfile | ||
yarn --cwd functions install --frozen-lockfile | ||
- name: Set App Environment Settings | ||
env: | ||
MASTER_SERVICE_ACCOUNT: ${{ secrets.MASTER_SERVICE_ACCOUNT }} | ||
PROD_SERVICE_ACCOUNT: ${{ secrets.PROD_SERVICE_ACCOUNT }} | ||
GITHUB_HEAD_REF: ${{ github.head_ref }} | ||
GITHUB_REF: ${{ github.ref }} | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
- name: Set environment | ||
run: | | ||
set -o pipefail | ||
# Throw a clear error if FIREBASE_TOKEN secret is not set | ||
if [ -z "$FIREBASE_TOKEN" ]; | ||
then | ||
errMsg="\"FIREBASE_TOKEN\" github secret is required to load project configuration. Visit https://github.com/${{ github.repository }}/settings/secrets to set." | ||
echo "::error ::$errMsg" | ||
exit 1 | ||
fi | ||
# Get branch name from github ref (i.e. refs/heads/master -> master) | ||
gitBranch=${GITHUB_REF##*/} | ||
# Find the config associated to the firebase project in .firebaserc (falling back to default) | ||
gcloudProject=$(cat .firebaserc | jq -r --arg alias "$gitBranch" '.projects[$alias] // .projects.default') | ||
appName=react-firebase | ||
echo "Setting environment for branch: $gitBranch, project: $gcloudProject, and app: $appName..." | ||
# Set variables to environment to be used in later steps | ||
echo "GCLOUD_PROJECT=$gcloudProject" >> $GITHUB_ENV | ||
echo "NODE_CONFIG_ENV=$branch" >> $GITHUB_ENV | ||
echo "ENV=$branch" >> $GITHUB_ENV | ||
# Get value of Service Account associated with branch (i.e. STAGE_SERVICE_ACCOUNT) | ||
branchPrefix=$(echo $gitBranch | tr a-z A-Z | tr - _) | ||
branchSaKey="${branchPrefix}_SERVICE_ACCOUNT" | ||
branchSa=$(eval echo \$${branchSaKey}) | ||
if [[ ! -z "${branchSa}" ]]; then | ||
echo Using service account with key \"$branchSaKey\" | ||
serviceAccount=$branchSa | ||
else | ||
echo Falling back to service account with key "DEVELOP_SERVICE_ACCOUNT" | ||
serviceAccount=$DEVELOP_SERVICE_ACCOUNT | ||
- name: Generate Firebase SDK config for ${{ env.GCLOUD_PROJECT }} | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
run: | | ||
set -o pipefail | ||
# Throw a clear error if FIREBASE_TOKEN secret is not set | ||
if [ -z "$FIREBASE_TOKEN" ]; | ||
then | ||
missingTokenErrMsg="\"FIREBASE_TOKEN\" github secret is required to load project configuration. Visit https://github.com/${{ github.repository }}/settings/secrets to set." | ||
echo "::error ::$missingTokenErrMsg" | ||
exit 1 | ||
fi | ||
echo "Service Account selected for projectId $(echo $serviceAccount | jq .project_id)" | ||
# Generate Service Account file required to prevent credential error during functions unit tests (jq used to format) | ||
echo "Generating Service Account File..." | ||
echo "$(echo $serviceAccount | jq .)" > $HOME/serviceAccount.json | ||
echo "GOOGLE_APPLICATION_CREDENTIALS=$HOME/serviceAccount.json" >> $GITHUB_ENV | ||
# Use Firebase SDK API to get the app's configuration and export to REACT_APP prefixed environment variables | ||
# NOTE: databaseURL is intentionally removed since it is set above | ||
firebaseConfig=$(npx firebase --project $gcloudProject apps:sdkconfig WEB \ | ||
$(npx firebase --project $gcloudProject apps:list WEB | grep $appName | awk '{ print $4}') | \ | ||
tr '\n' ' ' | \ | ||
sed 's/.*initializeApp(//g' | \ | ||
sed 's/);//g' | \ | ||
jq -r 'to_entries[] | [.key, (.value | tojson)] | join("::")' | \ | ||
sed 's/::"/=/g; s/^/echo \"REACT_APP_FB_/g' \ | ||
) | ||
# Loop through each line of config and evaluate to export env vars | ||
while IFS= read -r line; do | ||
echo Evaluating: $line | ||
eval $line >> $GITHUB_ENV | ||
done <<< "$firebaseConfig" | ||
bin/generate-firebase-sdk-config.js --file ./config/default.json | ||
- name: Verify App | ||
run: | | ||
|
@@ -140,7 +107,7 @@ jobs: | |
- name: Check if version has been updated | ||
if: github.ref == 'refs/heads/prod' | ||
id: check | ||
uses: EndBug/version-check@v1 | ||
uses: EndBug/version-check@v2.0.1 | ||
|
||
- name: Create Github Release | ||
if: github.ref == 'refs/heads/prod' && steps.check.outputs.changed == 'true' | ||
|
Oops, something went wrong.