Skip to content

Commit

Permalink
Added persist-credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolad committed Feb 9, 2021
1 parent b390e20 commit f835264
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 64 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,21 @@ jobs:
- name: Setup Playwright
uses: microsoft/playwright-github-action@v1

- name: Check out event-espresso-core
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
with:
repository: eventespresso/event-espresso-core
path: event-espresso-core
ref: dev
token: ${{ secrets.GH_ACTIONS_ACCESS_TOKEN }}
# - name: Check out event-espresso-core
# uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
# env:
# GIT_TRACE: 1
# GIT_CURL_VERBOSE: 1
# with:
# repository: eventespresso/event-espresso-core
# path: event-espresso-core
# persist-credentials: true
# ref: dev
# token: ${{ secrets.GH_ACTIONS_ACCESS_TOKEN }}

# Deploy the built assets to core repo's assets/dist
- name: Deploy to event-espresso-core
run: source tools/deploy-test.sh "event-espresso-core" "dev"

- name: Running the tests
run: yarn test:e2e
Expand Down
2 changes: 1 addition & 1 deletion domains/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-select": "^4.0.2"
},
"devDependencies": {
"@types/react-select": "^3.1.2",
"@types/react-select": "^4.0.13",
"@types/wordpress__block-editor": "^2.2.9",
"@types/wordpress__components": "^9.8.6",
"@types/wordpress__i18n": "^3.11.0"
Expand Down
88 changes: 88 additions & 0 deletions tools/deploy-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash

################################### INSTRUCTIONS ########################################
# This script accepts upto 5 arguments #
#---------------------------------------------------------------------------------------#
# # | Description | REQUIRED | DEFAULT #
#---------------------------------------------------------------------------------------#
# 1 | target repository name e.g. "event-espresso-core" | YES | - #
# 2 | branch to deploy at, in the target repository | NO | "dev" #
# 3 | username of the target repository | NO | "eventespresso" #
# 4 | build path on the current/this repository | NO | "build" #
# 5 | path to assets folder on the target repository | NO | "assets" #
#########################################################################################

##################################### EXAMPLES ##########################################
# ./deploy.sh "event-espresso-core" #
# ./deploy.sh "event-espresso-core" "dev" #
# ./deploy.sh "event-espresso-core" "dev" "eventespresso" #
# ./deploy.sh "event-espresso-core" "dev" "eventespresso" "build" #
# ./deploy.sh "event-espresso-core" "dev" "eventespresso" "build" "assets/dist" #
#########################################################################################

##################### ENV VARIABLES THAT SHOULD ALREADY BE SET ########################
#-------------------------------------------------------------------------------------#
# Name | Description #
#-------------------------------------------------------------------------------------#
# API_TOKEN_GITHUB | Github access token #
# GIT_USER_EMAIL | Email of the git user to use for commits #
# GIT_USER_NAME | Name of the git user to use for commits #
#######################################################################################

####################### DEFAULT ENV VARIABLES SET BY GITHUB ###########################
# @link https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
# 1. GITHUB_REPOSITORY
# 2. GITHUB_SHA

set -e

# name of the repo e.g. "event-espresso-core"
REPO=$1
# The target repo branch
BRANCH="${2:-dev}"
# Convert "refs/heads/dev" to "dev"
BRANCH="${BRANCH#refs/heads/}"
# GitHub account username
USERNAME="${3:-eventespresso}"
# Default path to build folder
BUILD_PATH="${4:-build}"
# Default path to assets folder (on target repo)
ASSETS_PATH="${5:-assets}"
# This repo
THIS="${5:-assets/dist}"

BASE=$(pwd)

# the source commit SHA with repo URL
SOURCE_COMMIT="${GITHUB_REPOSITORY}@${GITHUB_SHA}"

git config --global user.email "$GIT_USER_EMAIL"
git config --global user.name "$GIT_USER_NAME"

echo " Repo: $REPO"
CLONE_DIR="__${REPO}__clone__"
echo " Clone dir: $CLONE_DIR"

# make sure the directory is empty
rm -rf $CLONE_DIR/*

# clone the repo branch
git clone -b $BRANCH https://$API_TOKEN_GITHUB@github.com/$USERNAME/$REPO.git $CLONE_DIR

# goto the repo directory
cd $CLONE_DIR

# clean the assets path.
echo "Clean up assets path..."
rm -rf $ASSETS_PATH/static/*
rm -f $ASSETS_PATH/asset-manifest.json

# Make sure the directory exists
mkdir -p $ASSETS_PATH

# copy files from build folder to target assets folder
echo "Copy build files to assets path..."
cp -r $BASE/$BUILD_PATH/* $ASSETS_PATH/

# go back to base directory
cd $BASE
112 changes: 56 additions & 56 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4786,11 +4786,12 @@
"@types/draft-js" "*"
"@types/react" "*"

"@types/react-select@^3.1.2":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@types/react-select/-/react-select-3.1.2.tgz#38627df4b49be9b28f800ed72b35d830369a624b"
integrity sha512-ygvR/2FL87R2OLObEWFootYzkvm67LRA+URYEAcBuvKk7IXmdsnIwSGm60cVXGaqkJQHozb2Cy1t94tCYb6rJA==
"@types/react-select@^4.0.13":
version "4.0.13"
resolved "https://registry.yarnpkg.com/@types/react-select/-/react-select-4.0.13.tgz#8d2c41a0df7fbf67ab0b995797b0e9b4e6b38cde"
integrity sha512-rXYEc565IzzjgQzs9C0YCFxV/QajMZnCHG5QwRQ5BZMfH0Lj90VI/xohawemRkD46IvpaLRbO6xzSquJlgBGUA==
dependencies:
"@emotion/serialize" "^1.0.0"
"@types/react" "*"
"@types/react-dom" "*"
"@types/react-transition-group" "*"
Expand Down Expand Up @@ -5059,28 +5060,28 @@
integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg==

"@typescript-eslint/eslint-plugin@^4.14.0":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.2.tgz#47a15803cfab89580b96933d348c2721f3d2f6fe"
integrity sha512-uMGfG7GFYK/nYutK/iqYJv6K/Xuog/vrRRZX9aEP4Zv1jsYXuvFUMDFLhUnc8WFv3D2R5QhNQL3VYKmvLS5zsQ==
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.0.tgz#13a5a07cf30d0d5781e43480aa2a8d38d308b084"
integrity sha512-DJgdGZW+8CFUTz5C/dnn4ONcUm2h2T0itWD85Ob5/V27Ndie8hUoX5HKyGssvR8sUMkAIlUc/AMK67Lqa3kBIQ==
dependencies:
"@typescript-eslint/experimental-utils" "4.14.2"
"@typescript-eslint/scope-manager" "4.14.2"
"@typescript-eslint/experimental-utils" "4.15.0"
"@typescript-eslint/scope-manager" "4.15.0"
debug "^4.1.1"
functional-red-black-tree "^1.0.1"
lodash "^4.17.15"
regexpp "^3.0.0"
semver "^7.3.2"
tsutils "^3.17.1"

"@typescript-eslint/experimental-utils@4.14.2", "@typescript-eslint/experimental-utils@^4.0.1":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.2.tgz#9df35049d1d36b6cbaba534d703648b9e1f05cbb"
integrity sha512-mV9pmET4C2y2WlyHmD+Iun8SAEqkLahHGBkGqDVslHkmoj3VnxnGP4ANlwuxxfq1BsKdl/MPieDbohCEQgKrwA==
"@typescript-eslint/experimental-utils@4.15.0", "@typescript-eslint/experimental-utils@^4.0.1":
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.0.tgz#b87c36410a9b23f637689427be85007a2ec1a9c6"
integrity sha512-V4vaDWvxA2zgesg4KPgEGiomWEBpJXvY4ZX34Y3qxK8LUm5I87L+qGIOTd9tHZOARXNRt9pLbblSKiYBlGMawg==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/scope-manager" "4.14.2"
"@typescript-eslint/types" "4.14.2"
"@typescript-eslint/typescript-estree" "4.14.2"
"@typescript-eslint/scope-manager" "4.15.0"
"@typescript-eslint/types" "4.15.0"
"@typescript-eslint/typescript-estree" "4.15.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

Expand All @@ -5096,32 +5097,32 @@
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^4.14.0":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.14.2.tgz#31e216e4baab678a56e539f9db9862e2542c98d0"
integrity sha512-ipqSP6EuUsMu3E10EZIApOJgWSpcNXeKZaFeNKQyzqxnQl8eQCbV+TSNsl+s2GViX2d18m1rq3CWgnpOxDPgHg==
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.15.0.tgz#8df94365b4b7161f9e8514fe28aef19954810b6b"
integrity sha512-L6Dtbq8Bc7g2aZwnIBETpmUa9XDKCMzKVwAArnGp5Mn7PRNFjf3mUzq8UeBjL3K8t311hvevnyqXAMSmxO8Gpg==
dependencies:
"@typescript-eslint/scope-manager" "4.14.2"
"@typescript-eslint/types" "4.14.2"
"@typescript-eslint/typescript-estree" "4.14.2"
"@typescript-eslint/scope-manager" "4.15.0"
"@typescript-eslint/types" "4.15.0"
"@typescript-eslint/typescript-estree" "4.15.0"
debug "^4.1.1"

"@typescript-eslint/scope-manager@4.14.2":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.14.2.tgz#64cbc9ca64b60069aae0c060b2bf81163243b266"
integrity sha512-cuV9wMrzKm6yIuV48aTPfIeqErt5xceTheAgk70N1V4/2Ecj+fhl34iro/vIssJlb7XtzcaD07hWk7Jk0nKghg==
"@typescript-eslint/scope-manager@4.15.0":
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.15.0.tgz#c42703558ea6daaaba51a9c3a86f2902dbab9432"
integrity sha512-CSNBZnCC2jEA/a+pR9Ljh8Y+5TY5qgbPz7ICEk9WCpSEgT6Pi7H2RIjxfrrbUXvotd6ta+i27sssKEH8Azm75g==
dependencies:
"@typescript-eslint/types" "4.14.2"
"@typescript-eslint/visitor-keys" "4.14.2"
"@typescript-eslint/types" "4.15.0"
"@typescript-eslint/visitor-keys" "4.15.0"

"@typescript-eslint/types@3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727"
integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==

"@typescript-eslint/types@4.14.2":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.2.tgz#d96da62be22dc9dc6a06647f3633815350fb3174"
integrity sha512-LltxawRW6wXy4Gck6ZKlBD05tCHQUj4KLn4iR69IyRiDHX3d3NCAhO+ix5OR2Q+q9bjCrHE/HKt+riZkd1At8Q==
"@typescript-eslint/types@4.15.0":
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.15.0.tgz#3011ae1ac3299bb9a5ac56bdd297cccf679d3662"
integrity sha512-su4RHkJhS+iFwyqyXHcS8EGPlUVoC+XREfy5daivjLur9JP8GhvTmDipuRpcujtGC4M+GYhUOJCPDE3rC5NJrg==

"@typescript-eslint/typescript-estree@3.10.1":
version "3.10.1"
Expand All @@ -5137,17 +5138,16 @@
semver "^7.3.2"
tsutils "^3.17.1"

"@typescript-eslint/typescript-estree@4.14.2":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.2.tgz#9c5ebd8cae4d7b014f890acd81e8e17f309c9df9"
integrity sha512-ESiFl8afXxt1dNj8ENEZT12p+jl9PqRur+Y19m0Z/SPikGL6rqq4e7Me60SU9a2M28uz48/8yct97VQYaGl0Vg==
"@typescript-eslint/typescript-estree@4.15.0":
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.0.tgz#402c86a7d2111c1f7a2513022f22a38a395b7f93"
integrity sha512-jG6xTmcNbi6xzZq0SdWh7wQ9cMb2pqXaUp6bUZOMsIlu5aOlxGxgE/t6L/gPybybQGvdguajXGkZKSndZJpksA==
dependencies:
"@typescript-eslint/types" "4.14.2"
"@typescript-eslint/visitor-keys" "4.14.2"
"@typescript-eslint/types" "4.15.0"
"@typescript-eslint/visitor-keys" "4.15.0"
debug "^4.1.1"
globby "^11.0.1"
is-glob "^4.0.1"
lodash "^4.17.15"
semver "^7.3.2"
tsutils "^3.17.1"

Expand All @@ -5158,12 +5158,12 @@
dependencies:
eslint-visitor-keys "^1.1.0"

"@typescript-eslint/visitor-keys@4.14.2":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.2.tgz#997cbe2cb0690e1f384a833f64794e98727c70c6"
integrity sha512-KBB+xLBxnBdTENs/rUgeUKO0UkPBRs2vD09oMRRIkj5BEN8PX1ToXV532desXfpQnZsYTyLLviS7JrPhdL154w==
"@typescript-eslint/visitor-keys@4.15.0":
version "4.15.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.0.tgz#2a07768df30c8a5673f1bce406338a07fdec38ca"
integrity sha512-RnDtJwOwFucWFAMjG3ghCG/ikImFJFEg20DI7mn4pHEx3vC48lIAoyjhffvfHmErRDboUPC7p9Z2il4CLb7qxA==
dependencies:
"@typescript-eslint/types" "4.14.2"
"@typescript-eslint/types" "4.15.0"
eslint-visitor-keys "^2.0.0"

"@ungap/global-this@^0.4.2":
Expand Down Expand Up @@ -6733,9 +6733,9 @@ aws4@^1.8.0:
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==

axe-core@^4.0.1, axe-core@^4.0.2:
version "4.1.1"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.1.tgz#70a7855888e287f7add66002211a423937063eaf"
integrity sha512-5Kgy8Cz6LPC9DJcNb3yjAXTu3XihQgEdnIg50c//zOC/MyLP0Clg+Y8Sh9ZjjnvBrDZU4DgXS9C3T9r4/scGZQ==
version "4.1.2"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.2.tgz#7cf783331320098bfbef620df3b3c770147bc224"
integrity sha512-V+Nq70NxKhYt89ArVcaNL9FDryB3vQOd+BFXZIfO3RP6rwtj+2yqqqdHEkacutglPaZLkJeuXKCjCJDMGPtPqg==

axios@^0.21.1:
version "0.21.1"
Expand Down Expand Up @@ -9864,9 +9864,9 @@ ejs@^3.1.2:
jake "^10.6.1"

electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.649:
version "1.3.657"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.657.tgz#a9c307f2612681245738bb8d36d997cbb568d481"
integrity sha512-/9ROOyvEflEbaZFUeGofD+Tqs/WynbSTbNgNF+/TJJxH1ePD/e6VjZlDJpW3FFFd3nj5l3Hd8ki2vRwy+gyRFw==
version "1.3.659"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.659.tgz#479eb1a80044ad3664ebd548e7b225fefe06a914"
integrity sha512-VPc1LcvuQYGjam6k7JcB6uJFTMo2YNlJ6rSbwbxApZQdow7X81kh/vDB6LB5B8DNmvkbKnpZkLmpKmnvoKA+Gw==

elegant-spinner@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -12566,9 +12566,9 @@ humanize-ms@^1.2.1:
ms "^2.0.0"

husky@^5.0.4:
version "5.0.8"
resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.8.tgz#2fd4cb4972bfb3fdb999feb48587aee8925339da"
integrity sha512-lijwzgHIJi7iYijEw77DIqyPDR6mFsOuGbjonI83nnAqJbWShGKtAJg1IqnFabnqGPEMiPv0Q8bnSwThfjW95A==
version "5.0.9"
resolved "https://registry.yarnpkg.com/husky/-/husky-5.0.9.tgz#6d38706643d66ed395bcd4ee952d02e3f15eb3a3"
integrity sha512-0SjcaY21a+IRdx7p7r/X33Vc09UR2m8SbP8yfkhUX2/jAmwcz+GR7i9jXkp2pP3GfX23JhMkVP6SWwXB18uXtg==

iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
version "0.4.24"
Expand Down Expand Up @@ -21511,9 +21511,9 @@ ts-invariant@^0.6.0:
tslib "^1.9.3"

ts-jest@^26.5.0:
version "26.5.0"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.0.tgz#3e3417d91bc40178a6716d7dacc5b0505835aa21"
integrity sha512-Ya4IQgvIFNa2Mgq52KaO8yBw2W8tWp61Ecl66VjF0f5JaV8u50nGoptHVILOPGoI7SDnShmEqnYQEmyHdQ+56g==
version "26.5.1"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.1.tgz#4d53ee4481552f57c1624f0bd3425c8b17996150"
integrity sha512-G7Rmo3OJMvlqE79amJX8VJKDiRcd7/r61wh9fnvvG8cAjhA9edklGw/dCxRSQmfZ/z8NDums5srSVgwZos1qfg==
dependencies:
"@types/jest" "26.x"
bs-logger "0.x"
Expand Down

0 comments on commit f835264

Please sign in to comment.