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 7b946f9
Show file tree
Hide file tree
Showing 173 changed files with 2,356 additions and 5,350 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 All @@ -33,7 +43,7 @@ jobs:
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Import MacOS Signing Certificate
- name: Import MacOS signing certificate
env:
APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
Expand All @@ -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 @@ -65,43 +75,45 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if [ -z "$PUBLISH_REPO" ]; then
npm run electron:staging
npm run electron:package:staging
else
npm run deploy:electron
npm run electron:release:production
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:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PUBLISH_REPO: ${{ vars.PUBLISH_REPO }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Certificate
- name: Setup certificate
shell: bash
run: echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12

Expand Down Expand Up @@ -137,7 +149,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 +195,106 @@ 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: Build and 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 extension-chrome:package:staging
npm run extension-firefox:package:staging
else
npm run extension-chrome:package:production
npm run extension-firefox:package:production
fi
- name: Upload Chrome extension artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.APP_NAME }}-chrome.zip
path: ${{ env.APP_NAME }}-chrome.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-package
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: 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 }}
run: npx --yes chrome-webstore-upload-cli@2 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: |
UNZIP_DIR=/tmp/${{ env.APP_NAME }}-firefox
mkdir $UNZIP_DIR
unzip ${{ env.FIREFOX_FILE_NAME }} -d $UNZIP_DIR
npx --yes web-ext-submit@7 --source-dir=$UNZIP_DIR/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 })
Loading

0 comments on commit 7b946f9

Please sign in to comment.