Skip to content

Commit

Permalink
Merge pull request #306 from HathorNetwork/dev
Browse files Browse the repository at this point in the history
Release v0.20.0
  • Loading branch information
pedroferreira1 authored Aug 29, 2024
2 parents 4dca688 + bf54e7e commit 2153b0c
Show file tree
Hide file tree
Showing 98 changed files with 5,502 additions and 2,824 deletions.
81 changes: 81 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
module.exports = {
env: {
browser: true,
es2020: true,
node: true,
},
extends: ['airbnb-base', 'plugin:react/recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: ['react', 'prettier'],
rules: {
'react/prop-types': 'off', // Disable prop-types rule as this is used selectively in this repo
'no-console': 'off', // Do not warn on console statements: they are expected on this application
'react/react-in-jsx-scope': 'off', // React 17 specific jsx-runtime enabled, so React import is not required
'prettier/prettier': 'error', // Add Prettier errors as ESLint errors
'arrow-parens': ['error', 'as-needed'],
'import/no-named-as-default': 0,
'import/prefer-default-export': 0,
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'comma-dangle': 0,
'object-curly-newline': 'off', // This rule is better handled by prettier
eqeqeq: [1, 'allow-null'],
'no-continue': 0,
'no-cond-assign': 1,
'no-constant-condition': 0,
'no-control-regex': 1,
'no-debugger': 1,
'no-dupe-keys': 1,
'no-ex-assign': 1,
'no-extra-boolean-cast': 1,
'no-func-assign': 1,
'no-regex-spaces': 1,
'no-unreachable': 1,
'no-fallthrough': 1,
'no-lone-blocks': 1,
'no-delete-var': 1,
'no-shadow': 'warn',
'no-shadow-restricted-names': 1,
'no-undef': 2,
'no-undef-init': 1,
'no-use-before-define': 0,
'no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
varsIgnorePattern: '^_', // Allow variables starting with _ to be unused
argsIgnorePattern: '^_', // Allow parameters starting with _ to be unused
},
],
'no-underscore-dangle': 0,
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'no-await-in-loop': 'off',
'no-plusplus': 'off',
'guard-for-in': 'off',
'no-bitwise': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
},
],
'jest/no-disabled-tests': 'off', // It's useful to have skipped tests on our suites

camelcase: 'off', // Conflicts with variables obtained directly from the fullnode endpoints
'import/no-named-as-default-member': 'off', // This will require a more complex refactor to fix
'react/no-string-refs': 'off', // This rule will be enforced only when the screens are refactored as functional components
'class-methods-use-this': 'off', // This rule will be enforced only when the screens are refactored as functional components
},
settings: {
react: {
version: 'detect',
},
},
};
151 changes: 122 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ on:
branches: [master]
tags: ['v*']

permissions:
id-token: write
contents: read

jobs:
dependencies:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Set up Node.js 18.x
# https://github.com/actions/setup-node/releases/tag/v3.7.0
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Set up Node.js 20.x
# https://github.com/actions/setup-node/releases/tag/v4.0.3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 18.x
node-version: 20.x

- name: Cache node modules
# https://github.com/actions/cache/releases/tag/v3.3.1
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
# https://github.com/actions/cache/releases/tag/v4.0.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
env:
cache-name: cache-node-modules
with:
Expand All @@ -29,24 +35,62 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: |
npm install
tar -cvf node_modules.tar ./node_modules
- name: Upload node modules
uses: actions/upload-artifact@v2
# https://github.com/actions/upload-artifact/releases/tag/v4.3.4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
with:
name: node_modules
path: node_modules.tar
if-no-files-found: error
retention-days: 1

deploy-testnet-explorer:
if: github.ref == 'refs/heads/master'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRoleTestnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules

- name: Build
run: |
tar -xf node_modules.tar
make build site=testnet
- name: Deploy Testnet Explorer
run: |
make deploy site=testnet
deploy-nano-testnet-explorer:
if: github.ref == 'refs/heads/master'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::471112952246:role/ExplorerGitHubActionsRole
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
Expand All @@ -55,22 +99,49 @@ jobs:
- name: Build
run: |
tar -xf node_modules.tar
make testnet_build
- name: Deploy Testnet Explorer
make build site=nano-testnet
- name: Deploy Nano Testnet Explorer
run: |
make testnet_deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
CLOUDFRONT_ID: E2TGO5SVP34CC3
deploy-mainnet-explorer:
make deploy site=nano-testnet
deploy-ekvilibro-testnet-explorer:
if: github.ref == 'refs/heads/master'
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::730335348496:role/ExplorerGitHubActionsRoleEkvilibroTestnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: node_modules
- name: Build
run: |
tar -xf node_modules.tar
make build site=ekvilibro-testnet
- name: Deploy Ekvilibro Testnet Explorer
run: |
make deploy site=ekvilibro-testnet
deploy-ekvilibro-mainnet-explorer:
if: startsWith(github.ref, 'refs/tags/v')
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: eu-central-1
role-to-assume: arn:aws:iam::730335348496:role/ExplorerGitHubActionsRoleEkvilibroMainnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v3.0.2
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
Expand All @@ -79,12 +150,34 @@ jobs:
- name: Build
run: |
tar -xf node_modules.tar
make mainnet_build
make build site=ekvilibro-mainnet
- name: Deploy Ekvilibro Mainnet Explorer
run: |
make deploy site=ekvilibro-mainnet
deploy-mainnet-explorer:
if: startsWith(github.ref, 'refs/tags/v')
needs: dependencies
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure AWS Credentials
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.2
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::769498303037:role/ExplorerGitHubActionsRoleMainnet
- name: Download node modules
# https://github.com/actions/download-artifact/releases/tag/v4.1.8
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: node_modules

- name: Build
run: |
tar -xf node_modules.tar
make build site=mainnet
- name: Deploy Mainnet Explorer
run: |
make mainnet_deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
CLOUDFRONT_ID: ETOC9JKCK86OG
make deploy site=mainnet
19 changes: 13 additions & 6 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
steps:
# https://github.com/actions/checkout/releases/tag/v3.5.3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
# https://github.com/actions/checkout/releases/tag/v4.1.7
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Use Node.js ${{ matrix.node-version }}
# https://github.com/actions/setup-node/releases/tag/v3.7.0
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
# https://github.com/actions/setup-node/releases/tag/v4.0.3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: |
npm install
- name: Build
run: |
make testnet_build
make build site=testnet
- name: Format
run: |
npm run format:check
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.17.0
v20
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid"
}
Loading

0 comments on commit 2153b0c

Please sign in to comment.