Skip to content

Commit

Permalink
Merge branch 'binary-com:master' into b-duration-display
Browse files Browse the repository at this point in the history
  • Loading branch information
akmal-deriv authored Feb 19, 2024
2 parents 1fb0af2 + 6b16c2f commit 7b4370d
Show file tree
Hide file tree
Showing 758 changed files with 21,593 additions and 2,988 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,9 @@
# ==============================================================

/packages/api/**/* @adrienne-deriv @thisyahlen-deriv @farhan-nurzi-deriv @wojciech-deriv

# ==============================================================
# deriv-app/api-v2
# ==============================================================

/packages/api-v2/**/* @adrienne-deriv @thisyahlen-deriv @farhan-nurzi-deriv @wojciech-deriv
4 changes: 4 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ inputs:
DATADOG_SESSION_SAMPLE_RATE_LOGS:
description: 'Datadog session sample rate for logs'
required: false
REMOTE_CONFIG_URL:
description: 'Remote config backup URL'
required: true

runs:
using: composite
Expand All @@ -69,5 +72,6 @@ runs:
GROWTHBOOK_CLIENT_KEY: ${{ inputs.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ inputs.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ inputs.REF_NAME }}
REMOTE_CONFIG_URL: ${{ inputs.REMOTE_CONFIG_URL }}
run: npm run build:all
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/download_remote_config_backup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Remote Config Backup Download
description: Download remote config backup
inputs:
REMOTE_CONFIG_URL:
description: "Remote config backup URL"
GPG_PRIVATE_KEY:
description: "GPG private key"
GPG_PASSPHRASE:
description: "GPG passphrase"
GITHUB_TOKEN:
description: "GitHub token"
runs:
using: composite
steps:
- name: Download remote config backup
run: |
echo "Downloading remote config backup"
curl ${{ inputs.REMOTE_CONFIG_URL }} > packages/api/src/remote_config.json
echo "Remote Config backup downloaded successfully!"
shell: bash
1 change: 1 addition & 0 deletions .github/actions/invalidate_npm_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
node_modules
packages/account/node_modules
packages/api/node_modules
packages/api-v2/node_modules
packages/appstore/node_modules
packages/bot-skeleton/node_modules
packages/bot-web-ui/node_modules
Expand Down
1 change: 1 addition & 0 deletions .github/actions/npm_install_from_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ runs:
node_modules
packages/account/node_modules
packages/api/node_modules
packages/api-v2/node_modules
packages/appstore/node_modules
packages/bot-skeleton/node_modules
packages/bot-web-ui/node_modules
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
uses: "./.github/actions/setup_node"
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Download Remote Config Backup File
uses: ./.github/actions/download_remote_config_backup
with:
REMOTE_CONFIG_URL: ${{ env.REMOTE_CONFIG_URL }}
- name: Build
uses: "./.github/actions/build"
with:
Expand All @@ -36,6 +40,7 @@ jobs:
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
- name: Run tests
run: npm test
- name: Versioning
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
uses: "./.github/actions/setup_node"
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Download Remote Config Backup File
uses: ./.github/actions/download_remote_config_backup
with:
REMOTE_CONFIG_URL: ${{ env.REMOTE_CONFIG_URL }}
- name: Build
uses: "./.github/actions/build"
with:
Expand All @@ -34,6 +38,7 @@ jobs:
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
- name: Run tests
run: npm test
- name: Versioning
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
uses: "./.github/actions/setup_node"
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Download Remote Config Backup File
uses: ./.github/actions/download_remote_config_backup
with:
GITHUB_TOKEN: ${{ github.token }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Build
uses: "./.github/actions/build"
with:
Expand All @@ -34,6 +41,7 @@ jobs:
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
- name: Run tests
run: npm test
- name: Publish to Cloudflare Pages Test
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
uses: "./.github/actions/setup_node"
- name: Install Dependencies
uses: "./.github/actions/npm_install_from_cache"
- name: Download Remote Config Backup File
uses: ./.github/actions/download_remote_config_backup
with:
REMOTE_CONFIG_URL: ${{ env.REMOTE_CONFIG_URL }}
- name: Build
uses: "./.github/actions/build"
with:
Expand All @@ -35,6 +39,7 @@ jobs:
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ vars.GROWTHBOOK_DECRYPTION_KEY }}
REF_NAME: ${{ github.ref_name }}
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}
- name: Versioning
uses: "./.github/actions/versioning"
with:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/remote_config_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deriv App Remote Config backup file
on:
push:
branches:
- master

jobs:
download_remote_config_backup_and_create_pr:
name: Download Remote Config Backup File and Create PR
runs-on: Runner_8cores_Deriv-app
env:
REMOTE_CONFIG_BRANCH: "remote_config_update_branch"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Checkout to remote_config_update_branch
run: |
git fetch origin
git checkout "${{ env.REMOTE_CONFIG_BRANCH }}" || git checkout -b "${{ env.REMOTE_CONFIG_BRANCH }}" origin/"${{ env.REMOTE_CONFIG_BRANCH }}"
- name: Download Remote Config Backup File
uses: ./.github/actions/download_remote_config_backup
with:
REMOTE_CONFIG_URL: ${{ vars.REMOTE_CONFIG_URL }}

- name: Import GPG key
id: import-gpg
uses: deriv-com/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Commit the file and Create PR
env:
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit, Not creating a PR."
else
echo "Changes detected, creating a PR"
# Commit the newly downloaded file
cd $(git rev-parse --show-toplevel)
git add packages/api/src/remote_config.json
git commit -m "🤖 Remote Config file update 🤖"
# Force push to this branch in case a previous run created it.
git push --set-upstream origin "${{ env.REMOTE_CONFIG_BRANCH }}" -f
sudo apt install gh
gh auth login --with-token <<< ${{ github.token }}
gh pr close "${{ env.REMOTE_CONFIG_BRANCH }}" || true
gh pr create --base "master" --title "Sync Remote Config File 🤖" --head "binary-com:${{ env.REMOTE_CONFIG_BRANCH }}" --body "This is an automated Pull Request designed to synchronize our project's Remote Config from Its origin. It checks for the changes in the remote config URL and in case of any change, it will update it using this PR."
fi
shell: bash
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
uses: "./.github/actions/build"
- name: Check TypeScript for @deriv/api
run: npx tsc --project packages/api/tsconfig.json -noEmit
- name: Check TypeScript for @deriv/api-v2
run: npx tsc --project packages/api-v2/tsconfig.json -noEmit
- name: Check TypeScript for @deriv/hooks
run: npx tsc --project packages/hooks/tsconfig.json -noEmit
- name: Check TypeScript for @deriv/utils
Expand Down
Loading

0 comments on commit 7b4370d

Please sign in to comment.