Skip to content

Commit

Permalink
Merge pull request #1055 from Tonomy-Foundation/feature/336-veramo-up…
Browse files Browse the repository at this point in the history
…grade-2

Feature/336 veramo upgrade 2
  • Loading branch information
theblockstalk authored Aug 19, 2024
2 parents e96d2df + d14e0e9 commit 61f3a77
Show file tree
Hide file tree
Showing 44 changed files with 8,724 additions and 7,616 deletions.
75 changes: 66 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,81 @@
"rules": {
"eqeqeq": "error",
"no-console": "warn",
"indent": ["error", 4, { "SwitchCase": 1 }],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"camelcase": "error",
"prettier/prettier": "error",
"@typescript-eslint/ban-ts-comment": "warn",
"react/display-name": "off",
"react/no-children-prop": "off",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"padding-line-between-statements": [
"warn",
{ "blankLine": "always", "prev": "block-like", "next": "*" },
{ "blankLine": "always", "prev": "block", "next": "*" },
{ "blankLine": "always", "prev": "*", "next": ["block","block-like"] },
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
{ "blankLine": "always", "prev": ["export", "import"], "next": "*"},
{ "blankLine": "any", "prev": "import", "next": "import"},
{ "blankLine": "any", "prev": "export", "next": "export"}
{
"blankLine": "always",
"prev": "block-like",
"next": "*"
},
{
"blankLine": "always",
"prev": "block",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": [
"block",
"block-like"
]
},
{
"blankLine": "always",
"prev": [
"const",
"let",
"var"
],
"next": "*"
},
{
"blankLine": "any",
"prev": [
"const",
"let",
"var"
],
"next": [
"const",
"let",
"var"
]
},
{
"blankLine": "always",
"prev": [
"export",
"import"
],
"next": "*"
},
{
"blankLine": "any",
"prev": "import",
"next": "import"
},
{
"blankLine": "any",
"prev": "export",
"next": "export"
}
]
},
"parserOptions": {
Expand Down
38 changes: 0 additions & 38 deletions .github/build-apk.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/build-apk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build Android APK

# Use https://github.com/nektos/act to run this locally
# INSTALL:
# curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
# PREPARE: you need to have a `testnet` project in EAS:
# export EXPO_NODE_ENV=testnet
# export EXPO_FIRST_TIME=true
# yarn run build:android
# echo "Set the value of `expoProjectId` in src/config/config.testnet.json"
# RUN:
# act -j build-android -s EXPO_TOKEN="${EXPO_TOKEN}"

on:
push

jobs:
build-android:
runs-on: ubuntu-latest
env:
EXPO_NODE_ENV: testnet
EXPO_PLATFORM: android
NODE_VERSION: 22.3.0
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
# https://expo.dev/accounts/[account]/settings/access-tokens
container:
image: cimg/android:2024.01-ndk
# See https://circleci.com/developer/images/image/cimg/android#image-tags

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install nodejs
run: |
wget "nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz"
sudo tar -C /usr/local --strip-components 1 -xzf "node-v${NODE_VERSION}-linux-x64.tar.gz"
sudo corepack enable
node -v && npm -v && yarn -v
rm "node-v${NODE_VERSION}-linux-x64.tar.gz"
# Clears about 3.2Gb
# Images:
# - node:16/18/20(-alpine)
# - moby/buildkit:latest
# - alpine:3.16/3.17/3.18/3.19
# - debian:10/11
# - ubuntu:20.04/22.04
- name: Clean up Docker images
run: |
echo "Docker before cleanup:"
sudo docker ps
sudo docker images
sudo docker system df
sudo docker system prune -af
echo "Docker after cleanup:"
sudo docker ps
sudo docker images
sudo docker system df
- name: Install dependancies
run: yarn --immutable

# Clears about 0.5Gb
- name: Clear yarn cache
run: |
sudo du -sh ~/.yarn
yarn cache clean
sudo du -sh ~/.yarn
- name: 🚀 Build Android .apk app
run: |
yarn run build:prepare
npx eas build --clear-cache --profile testnet-internal --platform "${EXPO_PLATFORM}" --local
- name: Find APK file and rename it so it can be added as an artifact
run: find . -name "*.apk" -exec mv {} TonomyID.apk \;

- name: Archive Android APK as artifact
# Do not run this step if the action is being run locally (using nektos/act)
if: ${{ github.actor != 'nektos/act' }}
uses: actions/upload-artifact@v3
with:
name: TonomyID-Android
path: ./TonomyID.apk
8 changes: 5 additions & 3 deletions .github/workflows/check-sdk-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ jobs:
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 📦 Check it is using the latest version of the SDK
uses: actions/setup-node@v4
with:
node-version: 18.12.1
- run: corepack enable
node-version: 22.3.0
- run: yarn install --immutable
- run: yarn run updateSdkVersion $GITHUB_BASE_REF check
- run: yarn run updateSdkVersion $GITHUB_BASE_REF check
6 changes: 4 additions & 2 deletions .github/workflows/deploy-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ jobs:
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 🚀 Build and publish demo app
uses: actions/setup-node@v4
with:
node-version: 18.12.1
- run: corepack enable
node-version: 22.3.0
- run: echo "${GOOGLE_SERVICE_ACCOUNT_KEY}" > ./google-service-key.json
- run: echo "${APPLE_STORE_CONNECT_API_KEY}" > ./apple-asc-api-key.p8
- run: yarn --immutable
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ jobs:
with:
token: ${{secrets.MY_GITHUB_PERSONAL_ACCESS_TOKEN}}
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic

# TODO replace this with using semantic-release to do git bump
- name: "Automated Version Bump"
uses: "phips28/gh-action-bump-version@master"
env:
GITHUB_TOKEN: ${{secrets.MY_GITHUB_PERSONAL_ACCESS_TOKEN}}
with:
commit-message: "ci: bumps version to {{version}} [skip ci]"

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 🚀 Build and publish staging app
uses: actions/setup-node@v4
with:
node-version: 18.12.1
- run: corepack enable
node-version: 22.3.0
- run: echo "${GOOGLE_SERVICE_ACCOUNT_KEY}" > ./google-service-key.json
- run: echo "${APPLE_STORE_CONNECT_API_KEY}" > ./apple-asc-api-key.p8
- run: yarn --immutable
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-testnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ jobs:
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 🚀 Build and publish testnet app
uses: actions/setup-node@v4
with:
node-version: 18.12.1
- run: corepack enable
node-version: 22.3.0
- run: echo "${GOOGLE_SERVICE_ACCOUNT_KEY}" > ./google-service-key.json
- run: echo "${APPLE_STORE_CONNECT_API_KEY}" > ./apple-asc-api-key.p8
- run: yarn --immutable
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Test - Pull Requests (not to master)
name: Tests

on:
pull_request:
branches-ignore:
- master
on: push

jobs:
build:
Expand All @@ -13,12 +10,14 @@ jobs:
- name: 🏗 Setup repo
uses: actions/checkout@v4

- name: Enable Corepack before setting up Node
run: corepack enable

- name: 📦 Build, test and lint
uses: actions/setup-node@v4
with:
node-version: 18.12.1
- run: corepack enable
node-version: 22.3.0
- run: yarn --immutable
- run: yarn run test
- run: yarn run lint
- run: yarn run typeCheck
- run: yarn run typeCheck
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.eslint": "explicit"
},
"jest.autoRun": {
"onSave": false
Expand All @@ -16,4 +16,10 @@
"jest.testExplorer": {
"enabled": true
},
"git.branchPrefix": "feature/",
"git.branchProtection": [
"master",
"main",
"development"
],
}
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

4 changes: 1 addition & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.1.1.cjs
nodeLinker: node-modules
8 changes: 7 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// IMPORTANT: The following 3 packages should be imported in this order:
import 'reflect-metadata';
import '@walletconnect/react-native-compat';
import './src/utils/logs';
import './src/utils/polyfill';
// NOTE: The rest can be imported in any order
import '@walletconnect/react-native-compat';
import React from 'react';
import { Provider as PaperProvider } from 'react-native-paper';
import RootNavigation from './src/navigation/Root';
Expand All @@ -12,6 +15,9 @@ import ErrorHandlerContainer from './src/components/ErrorHandlerProvider';
import useErrorStore from './src/store/errorStore';
import settings from './src/settings';
import { runTests } from './src/utils/runtime-tests';
import Debug from 'debug';

Debug.enable(process.env.DEBUG);

if (!settings.isProduction()) {
runTests();
Expand Down
Loading

0 comments on commit 61f3a77

Please sign in to comment.