Skip to content

Commit

Permalink
Feat/adding dev build (#1103)
Browse files Browse the repository at this point in the history
* Feat: Transaction service refactoring (#1053)

* feat: added new transaction service, extrinsic builder and changed transfer florw

* feat: removed extra components, changed get fee func

* fix: wrap tx for submit step only if account is multisig

* feat: implemented new service usage for staking transactions

* fix: fix build tx error

* chore: fixed tests, removed extrinsic service from public api

* fix: signatory error fix

* chore: renamed wrappers

* chore: renamed operation footer prop and make it optional

* Update src/renderer/entities/transaction/lib/extrinsicService.ts

Co-authored-by: Yaroslav Grachev <[email protected]>

* Update src/renderer/entities/multisig/lib/multisigTx/common/utils.ts

Co-authored-by: Yaroslav Grachev <[email protected]>

* chore: fixed pr comments

* chore: fixed linter error

* chore: removed extra props from transfer form

* chore: fix lockfile

* chore: fixed confirmation test

* fix: fixed xcm transfer fee error

* fix: fixed amount error

* chore: fixed invalid character error

---------

Co-authored-by: Egor B <[email protected]>
Co-authored-by: Yaroslav Grachev <[email protected]>

* feat: add stage build

* fix: remove config separation

* fix: change triggers

* fix: github triggers

* fix: change approach to url management

* fix: change trigger and github command

* fix: add separate webpack for internal build

* fix: eslinter

* fix: typo in yamls

* Update src/main/factories/create.ts

Co-authored-by: Aleksandr Makhnev <[email protected]>

---------

Co-authored-by: egor0798 <[email protected]>
Co-authored-by: Egor B <[email protected]>
Co-authored-by: Yaroslav Grachev <[email protected]>
Co-authored-by: Aleksandr Makhnev <[email protected]>
  • Loading branch information
5 people authored Sep 29, 2023
1 parent 64e089f commit 57f5031
Show file tree
Hide file tree
Showing 43 changed files with 1,175 additions and 1,073 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,14 @@ module.exports = {
},
],
},
ignorePatterns: ['node_modules', 'coverage.txt', 'junit.xml', 'jest-unit-results.json', 'package.json'],
ignorePatterns: [
'.vscode',
'coverage',
'release',
'node_modules',
'coverage.txt',
'junit.xml',
'jest-unit-results.json',
'package.json',
],
};
55 changes: 55 additions & 0 deletions .github/workflows/build_stage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# build_stage.yaml
---
name: Build stage app

on:
workflow_dispatch:
pull_request:
types: [ labeled ]

env:
CSC_FOR_PULL_REQUEST: true
CI: true

jobs:
internal-release-build:
if: ${{ github.event.label.name == 'internal-build' || github.event_name == 'workflow_dispatch' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: ⚙️ Install dependencies
uses: ./.github/workflows/install-pnpm

- name: Add MacOS certs
if: startsWith(matrix.os, 'macos')
run: chmod +x .github/add_cert_in_keychain.sh && .github/add_cert_in_keychain.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}

- name: Build app
env:
# secrets for notarization
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
pnpm stage:sequence
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: build-artifats
path: |
release/dist/*.exe
release/dist/*.dmg
release/dist/*.AppImage
57 changes: 57 additions & 0 deletions .github/workflows/send_artifact_urls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# send_artifact_urls.yaml
---
name: Send notification with artifact URLs

on:
workflow_run:
types:
- 'completed'
workflows:
- 'Build stage app'

jobs:
comment-on-pr:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Get Artifact URL & PR Info
env:
GITHUB_TOKEN: ${{ github.token }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
WORKFLOW_RUN_EVENT_OBJ: ${{ toJSON(github.event.workflow_run) }}
run: |
PREVIOUS_JOB_ID=$(jq -r '.id' <<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Previous Job ID: $PREVIOUS_JOB_ID"
echo "PREVIOUS_JOB_ID=$PREVIOUS_JOB_ID" >> "$GITHUB_ENV"
ARTIFACT_URL=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
--jq ".artifacts.[] |
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
select(.expired==false) |
.archive_download_url")
echo "ARTIFACT URL: $ARTIFACT_URL"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> "$GITHUB_ENV"
PR_NUMBER=$(jq -r '.pull_requests[0].number' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "PR Number: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
HEAD_SHA=$(jq -r '.pull_requests[0].head.sha' \
<<< "$WORKFLOW_RUN_EVENT_OBJ")
echo "Head sha: $HEAD_SHA"
echo "HEAD_SHA=$HEAD_SHA" >> "$GITHUB_ENV"
- name: Notify Telegram channel
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
👨‍💻 Stage build was created successfully, URL to download:
${{ github.env.ARTIFACT_URL }}
7 changes: 5 additions & 2 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ const { name: NAME, author: AUTHOR, version: VERSION, description: DESCRIPTION }

const AUTHOR_IN_KEBAB_CASE = AUTHOR.name.replace(/\s+/g, '-');

const prod_app_id = `com.${AUTHOR_IN_KEBAB_CASE}.${NAME}`.toLowerCase();
const stage_app_id = `com.${AUTHOR_IN_KEBAB_CASE}.${NAME}.stage`.toLowerCase();

exports.APP_CONFIG = {
NAME,
AUTHOR,
VERSION,
DESCRIPTION,

TITLE: 'Nova Spektr',
APP_ID: `com.${AUTHOR_IN_KEBAB_CASE}.${NAME}`.toLowerCase(),
TITLE: process.env.NODE_ENV === 'staging' ? 'Nova Spektr Stage' : 'Nova Spektr',
APP_ID: process.env.NODE_ENV === 'staging' ? stage_app_id : prod_app_id,

MAIN: {
WINDOW: {
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "Polkadot Enterprise application",
"version": "1.1.1",
"main": "./release/build/main.js",
"repository": "https://github.com/novasamatech/nova-spektr",
"license": "MIT",
"author": {
"name": "Novasama Technologies"
Expand All @@ -20,15 +21,22 @@
"webpack:renderer:dev": "webpack serve --config webpack/webpack.renderer.dev.ts",
"webpack:renderer:stage": "webpack serve --config webpack/webpack.renderer.stage.ts",
"webpack:renderer:prod": "webpack --config webpack/webpack.renderer.prod.ts",
"webpack:renderer:prod:internal": "webpack --config webpack/webpack.renderer.prod.internal.ts",
"webpack:main:dev": "webpack --config webpack/webpack.main.dev.ts",
"webpack:main:stage": "webpack --config webpack/webpack.main.stage.ts",
"webpack:main:prod": "webpack --config webpack/webpack.main.prod.ts",
"webpack:main:prod:internal": "webpack --config webpack/webpack.main.prod.internal.ts",

"build": "cross-env NODE_ENV=production CHAINS_FILE=chains pnpm r clean:prod webpack:renderer:prod webpack:main:prod",
"build:stage": "cross-env NODE_ENV=staging FORCE_ELECTRON=true CHAINS_FILE=chains-dev pnpm r clean:prod webpack:renderer:prod:internal webpack:main:prod:internal",
"postbuild": "node scripts/postbuild.js",
"dist": "electron-builder -p never",
"postbuild:stage": "node scripts/postbuild.js stage",
"dist": "cross-env NODE_ENV=production electron-builder -p never",
"dist:stage": "cross-env NODE_ENV=staging FORCE_ELECTRON=true electron-builder -p never",
"clean:build": "rimraf release/build",
"clean:prod": "rimraf release/dist",
"stage:sequence": "pnpm r clean:build clean:prod build:stage postbuild:stage dist:stage",
"prod:sequence": "pnpm run clean:build && pnpm run clean:prod && pnpm run build && pnpm run postbuild && pnpm run dist",

"test": "jest --config=jest.config.ts --json --outputFile=jest-unit-results.json",
"test:integration": "jest --config=tests/integrations/jest.config.ts --group=integration --json --outputFile=jest-results.json",
Expand Down
Loading

0 comments on commit 57f5031

Please sign in to comment.