Skip to content

Commit

Permalink
v1.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Aug 21, 2023
1 parent 5f255c6 commit 6c21891
Show file tree
Hide file tree
Showing 173 changed files with 12,954 additions and 11,755 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ src/lib/big.js/
src/lib/rlottie/rlottie-wasm.js
src/lib/aes-js/index.js
src/lib/noble-ed25519/index.js
src/lib/webextension-polyfill/browser.js
jest.config.js
playwright.config.ts
postcss.config.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
name: Electron release
# Terms:
# "build" - Compile web project using webpack.
# "package" - Produce a distributive package for a specific platform as a workflow artifact.
# "publish" - Send a package to corresponding store and GitHub release page.
# "release" - build + package + publish
#
# Jobs in this workflow will skip the "publish" step when `PUBLISH_REPO` is not set.

name: Package and publish

on:
workflow_dispatch:
push:
branches: master
branches:
- master

env:
APP_NAME: MyTonWallet

jobs:
release:
runs-on: macOS-latest
electron-release:
name: Build, package and publish Electron
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -48,7 +58,7 @@ jobs:
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k actions $KEY_CHAIN
security find-identity -v -p codesigning $KEY_CHAIN
- name: Build and release
- name: Build, package and publish
env:
TONHTTPAPI_MAINNET_URL: ${{ vars.TONHTTPAPI_MAINNET_URL }}
TONAPIIO_MAINNET_URL: ${{ vars.TONAPIIO_MAINNET_URL }}
Expand All @@ -70,28 +80,33 @@ jobs:
npm run deploy:electron
fi
- uses: actions/upload-artifact@v3
- name: Upload macOS x64 artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-x64.dmg
path: dist-electron/${{ env.APP_NAME }}-x64.dmg

- uses: actions/upload-artifact@v3
- name: Upload macOS arm64 artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-arm64.dmg
path: dist-electron/${{ env.APP_NAME }}-arm64.dmg

- uses: actions/upload-artifact@v3
- name: Upload Linux artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-x86_64.AppImage
path: dist-electron/${{ env.APP_NAME }}-x86_64.AppImage

- uses: actions/upload-artifact@v3
- name: Upload Windows artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-x64.exe
path: dist-electron/${{ env.APP_NAME }}-x64.exe

windowsSigning:
needs: release
electron-sign-for-windows:
name: Sign and re-publish Windows package
needs: electron-release
runs-on: windows-latest
if: vars.PUBLISH_REPO != ''
env:
Expand Down Expand Up @@ -137,7 +152,7 @@ jobs:
with:
name: ${{ env.FILE_NAME }}

- name: Signing package
- name: Sign package
env:
KEYPAIR_ALIAS: ${{ secrets.KEYPAIR_ALIAS }}
FILE_PATH: ${{ steps.download-artifact.outputs.download-path }}
Expand Down Expand Up @@ -183,3 +198,119 @@ jobs:
shell: bash
run: |
curl -X PATCH -H "Authorization: Bearer $GH_TOKEN" "https://api.github.com/repos/$PUBLISH_REPO/releases/$RELEASE_ID" -d '{"draft": false}'
extensions-package:
name: Package extensions
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Cache node modules
id: npm-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Build and package
env:
TONHTTPAPI_MAINNET_URL: ${{ vars.TONHTTPAPI_MAINNET_URL }}
TONAPIIO_MAINNET_URL: ${{ vars.TONAPIIO_MAINNET_URL }}
TONHTTPAPI_TESTNET_URL: ${{ vars.TONHTTPAPI_TESTNET_URL }}
TONAPIIO_TESTNET_URL: ${{ vars.TONAPIIO_TESTNET_URL }}
PROXY_HOSTS: ${{ vars.PROXY_HOSTS }}
STAKING_POOLS: ${{ vars.STAKING_POOLS }}

PUBLISH_REPO: ${{ vars.PUBLISH_REPO }}
run: |
if [ -z "$PUBLISH_REPO" ]; then
npm run build:extension:staging
npm run build:extension:staging:firefox
else
npm run build:extension:production
npm run build:extension:production:firefox
fi
- name: Upload Chrome extension artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-chrome.zip
path: ${{ env.APP_NAME }}.zip

- name: Upload Firefox extension artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-firefox.zip
path: ${{ env.APP_NAME }}-firefox.zip

extensions-publish:
name: Publish extensions
needs: extensions-build
runs-on: ubuntu-latest
if: vars.PUBLISH_REPO != ''
steps:
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Cache node modules
id: npm-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Set environment variables
id: variables
shell: bash
run: |
echo "CHROME_FILE_NAME=${{ env.APP_NAME }}-chrome.zip" >> "$GITHUB_ENV"
echo "FIREFOX_FILE_NAME=${{ env.APP_NAME }}-firefox.zip" >> "$GITHUB_ENV"
- name: Download Chrome extension artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.CHROME_FILE_NAME }}

- name: Publish to Chrome store
env:
EXTENSION_ID: ${{ vars.CHROME_EXTENSION_ID }}
CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
if: ${{ vars.CLIENT_ID != '' }}
run: chrome-webstore-upload upload --auto-publish --source ${{ env.CHROME_FILE_NAME }}

- name: Download Firefox extension artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.FIREFOX_FILE_NAME }}

- name: Publish to Firefox addons
env:
WEB_EXT_API_KEY: ${{ secrets.FIREFOX_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.FIREFOX_API_SECRET }}
if: ${{ env.WEB_EXT_API_KEY != '' }}
run: |
mkdir /tmp/dist
unzip ${{ env.FIREFOX_FILE_NAME }} -d /tmp/dist
web-ext-submit --source-dir=/tmp/dist
43 changes: 43 additions & 0 deletions .github/workflows/statoscope-comment.jora
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Original: https://github.com/statoscope/statoscope.tech/blob/main/.github/workflows/statoscope-comment.jora

// variables
$after: resolveInputFile();
$inputCompilation: $after.compilations.pick();
$inputInitialCompilation: $after.compilations.chunks.filter(<initial>);
$before: resolveReferenceFile();
$referenceCompilation: $before.compilations.pick();
$referenceInitialCompilation: $before.compilations.chunks.filter(<initial>);

// helpers
$getSizeByChunks: => files.(getAssetSize($$, true)).reduce(=> size + $$, 0);

// output
{
initialSize: {
$after: $inputInitialCompilation.$getSizeByChunks($inputCompilation.hash);
$before: $referenceInitialCompilation.$getSizeByChunks($referenceCompilation.hash);
$after,
$before,
diff: {
value: $after - $before,
percent: $after.percentFrom($before, 2),
formatted: { type: 'size', a: $before, b: $after } | formatDiff() + ` (${b.percentFrom(a, 2)}%)`,
}
},
bundleSize: {
$after: $inputCompilation.chunks.$getSizeByChunks($inputCompilation.hash);
$before: $referenceCompilation.chunks.$getSizeByChunks($referenceCompilation.hash);
$after,
$before,
diff: {
value: $after - $before,
percent: $after.percentFrom($before, 2),
formatted: { type: 'size', a: $before, b: $after } | formatDiff() + ` (${b.percentFrom(a, 2)}%)`,
}
},
validation: {
$messages: resolveInputFile().compilations.[hash].(hash.validation_getItems());
$messages,
total: $messages.size()
}
}
10 changes: 10 additions & 0 deletions .github/workflows/statoscope-comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = ({ initialSize, bundleSize, validation, prNumber}) => `**📦 Statoscope quick diff with master branch:**
**⚖️ Initial size:** ${initialSize.diff.percent > 1.5 ? '🔴' : (initialSize.diff.percent < 0 ? '🟢' : '⚪️')} ${initialSize.diff.percent > 0 ? '+' : ''}${initialSize.diff.formatted}
**⚖️ Total bundle size:** ${bundleSize.diff.percent > 1.5 ? '🔴' : (bundleSize.diff.percent < 0 ? '🟢' : '⚪️')} ${bundleSize.diff.percent > 0 ? '+' : ''}${bundleSize.diff.formatted}
**🕵️ Validation errors:** ${validation.total > 0 ? validation.total : '✅'}
Full Statoscope report could be found [here️](https://deploy-preview-${prNumber}--mytonwallet-e5kxpi8iga.netlify.app/report.html)
`;
82 changes: 82 additions & 0 deletions .github/workflows/statoscope.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Statoscope Bundle Analytics

on:
pull_request:
branches:
- '*'

jobs:
install:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Reconfigure git to use HTTPS authentication
uses: GuillaumeFalourd/SSH-to-HTTPS@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Cache results
uses: actions/cache@v3
id: cache-results
with:
path: |
node_modules
key: ${{ github.sha }}
statoscope:
needs:
- install
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Reconfigure git to use HTTPS authentication
uses: GuillaumeFalourd/SSH-to-HTTPS@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Restore cache
uses: actions/cache@v3
id: restore-cache
with:
path: |
node_modules
key: ${{ github.sha }}
- name: Build
run: npm run build:production; cp public/build-stats.json input.json
- name: Download reference stats
uses: dawidd6/action-download-artifact@v2
with:
workflow: upload-main-stats.yml
workflow_conclusion: success
name: main-stats
path: ./
continue-on-error: true
- name: Validate
run: npm run statoscope:validate-diff
- name: Query stats
if: "github.event_name == 'pull_request'"
run: cat .github/workflows/statoscope-comment.jora | npx --no-install @statoscope/cli query --input input.json --input reference.json > result.json
- name: Hide bot comments
uses: int128/hide-comment-action@v1
- name: Comment PR
if: "github.event_name == 'pull_request'"
uses: actions/[email protected]
with:
script: |
const createStatoscopeComment = require('./dev/createStatoscopeComment');
await createStatoscopeComment({ github, context, core })
31 changes: 31 additions & 0 deletions .github/workflows/upload-main-stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload main stats

on:
push:
branches: [ master ]

jobs:
build_and_upload:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Reconfigure git to use HTTPS authentication
uses: GuillaumeFalourd/SSH-to-HTTPS@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Build
run: npm run build:production; cp ./public/build-stats.json ./reference.json
- uses: actions/upload-artifact@v2
with:
name: main-stats
path: ./reference.json
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ trash/
coverage/
src/i18n/en.json
notarization-error.log
.github/workflows/*
!.github/workflows/electron-release.yml
Loading

0 comments on commit 6c21891

Please sign in to comment.