-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b946f9
commit 9e142be
Showing
179 changed files
with
2,641 additions
and
1,753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,26 +57,30 @@ jobs: | |
node_modules | ||
key: ${{ github.sha }} | ||
- name: Build | ||
run: npm run build:production; cp public/build-stats.json input.json | ||
- name: Download reference stats | ||
run: npm run build:production | ||
- name: Download reference statistics | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: upload-main-stats.yml | ||
workflow: statoscope-upload-reference-statistics.yml | ||
workflow_conclusion: success | ||
name: main-stats | ||
name: statoscope-reference | ||
path: ./ | ||
continue-on-error: true | ||
- name: Prepare statoscope input | ||
run: cp public/statoscope-build-statistics.json input.json; mv statoscope-reference.json reference.json | ||
- 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 | ||
run: cat .github/workflows/statoscope-comment.jora | npx --no-install @statoscope/cli query --input input.json --input reference.json > statoscope-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'); | ||
const createStatoscopeComment = require('./dev/statoscopeCreateComment'); | ||
await createStatoscopeComment({ github, context, core }) | ||
- name: Cleanup | ||
run: rm input.json; rm reference.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
cp -R ./public/* ${1:-"dist"} | ||
rm ./dist/statoscope-report.html | ||
rm ./dist/build-stats.json | ||
|
||
cp ./src/lib/rlottie/rlottie-wasm.js ${1:-"dist"} | ||
cp ./src/lib/rlottie/rlottie-wasm.wasm ${1:-"dist"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Missing argument: <target>" | ||
exit 1 | ||
fi | ||
|
||
TARGET="$1" | ||
|
||
cp -R ./public/* ./src/lib/rlottie/rlottie-wasm.js ./src/lib/rlottie/rlottie-wasm.wasm ./dist/ | ||
|
||
rm -rf ./dist/statoscope-* \ | ||
./dist/get \ | ||
./dist/background-electron-dmg.tiff \ | ||
./dist/electron-entitlements.mac.plist \ | ||
./dist/icon-electron-* \ | ||
./dist/site.webmanifest | ||
|
||
rm -f "MyTonWallet-$TARGET.zip" | ||
|
||
zip -r -X "MyTonWallet-$TARGET.zip" dist/* |
4 changes: 2 additions & 2 deletions
4
dev/createStatoscopeComment.js → dev/statoscopeCreateComment.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Electron | ||
|
||
Electron allows to build native application, that can be installed and run on Windows, macOS and Linux. | ||
|
||
## NPM scripts | ||
|
||
- `npm run dev:electron` | ||
|
||
Run Electron in development mode, concurrently starts 3 processes with watch for changes: main (main Electron process), renderer (FE code) and Webpack for Electron (compiles main Electron process from TypeScript). | ||
|
||
- `npm run electron:webpack` | ||
|
||
The main process code for Electron, which includes preload functionality, is written in TypeScript and is compiled using the `webpack-electron.config.js` configuration to generate JavaScript code. | ||
|
||
- `npm run electron:build` | ||
|
||
Prepare renderer (FE code) build, compile Electron main process code, install and build native dependencies, is used before packaging or publishing. | ||
|
||
- `npm run electron:staging` | ||
|
||
Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `staging` (allows to open DevTools, includes sourcemaps and does not minify built JavaScript code), can be used for manual distribution and testing packaged application. | ||
|
||
- `npm run electron:production` | ||
|
||
Create packages for macOS, Windows and Linux in `dist-electron` folders with `APP_ENV` as `production` (disabled DevTools, minified built JavaScript code), can be used for manual distribution and testing packaged application. | ||
|
||
- `npm run deploy:electron` | ||
|
||
Create packages for macOS, Windows and Linux in `dist-electron` folder and publish release to GitHub, which allows supporting autoupdates. See [GitHub release workflow](#github-release) for more info. | ||
|
||
## Code signing on MacOS | ||
|
||
To sign the code of your application, follow these steps: | ||
|
||
- Install certificates to `login` folder of your Keychain. | ||
- Download and install `Developer ID - G2` certificate from the [Apple PKI](https://www.apple.com/certificateauthority/) page. | ||
- Under the Keychain application, go to the private key associated with your developer certificate. Then do `key > Get Info > Access Control`. Down there, make sure your application (Xcode) is in the list `Always allow access by these applications` and make sure `Confirm before allowing access` is turned on. | ||
- A valid and appropriate identity from your keychain will be automatically used when you publish your application. | ||
|
||
More info in the [official documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing). | ||
|
||
## Notarize on MacOS | ||
|
||
Application notarization is done automatically in [electron-builder](https://github.com/electron-userland/electron-builder/) module, which requires `APPLE_ID` and `APPLE_APP_SPECIFIC_PASSWORD` environment variables to be passed. | ||
|
||
How to obtain app-specific password: | ||
|
||
- Sign in to [appleid.apple.com](appleid.apple.com). | ||
- In the "Sign-In and Security" section, select "App-Specific Passwords". | ||
- Select "Generate an app-specific password" or select the Add button, then follow the steps on your screen. | ||
|
||
## GitHub release | ||
|
||
### GitHub access token | ||
|
||
In order to publish new release, you need to add GitHub access token to `.env`. Generate a GitHub access token by going to https://github.com/settings/tokens/new. The access token should have the repo scope/permission. Once you have the token, assign it to an environment variable: | ||
|
||
``` | ||
# .env | ||
GH_TOKEN="{YOUR_TOKEN_HERE}" | ||
``` | ||
|
||
### Publish settings | ||
|
||
Publish configuration in `electron-builder.yml` config file allows to set GitHub repository owner/name. | ||
|
||
### Release workflow | ||
|
||
- Draft a new release on GitHub. Create new tag version with the value of `version` in your application `package.json`, and prefix it with `v`. “Release title” can be anything you want. | ||
|
||
For example, if your application `package.json` version is `1.0`, your draft’s tag version would be `v1.0`. | ||
|
||
- Save draft release | ||
- Run `npm run electron:publish`, which will upload build artefacts to newly reated release. | ||
- Once you are done, publish the release. GitHub will tag the latest commit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Verifying GPG signatures of MyTonWallet using macOS or Linux command line | ||
This can be used to verify the authenticity of MyTonWallet binaries/sources. | ||
|
||
Download only from https://mytonwallet.app/get or https://github.com/mytonwalletorg/mytonwallet/releases and remember to check the gpg signature again every time you download a new version. | ||
|
||
## Obtain public GPG key for Mytonwallet Dev | ||
In a terminal enter (or copy): | ||
|
||
```shell | ||
gpg --keyserver keys.openpgp.org --recv-keys 9F14486135531F4127DF8CAD52978EAFD01FD271 | ||
``` | ||
|
||
You should be able to substitute any public GPG keyserver if keys.openpgp.org is (temporarily) not working | ||
|
||
## Download MyTonWallet and signature file (.asc) | ||
Download the `MyTonWallet-<platform>.dmg` (or `.exe` or `.AppImage` file). Download the signature file with the same name and extension `.asc`. | ||
|
||
## Verify GPG signature | ||
Run the following command from the same directory you saved the files replacing <executable file> with the one actually downloaded: | ||
|
||
```shell | ||
gpg --verify <executable file>.asc <executable file> | ||
``` | ||
|
||
The message should say: | ||
|
||
```shell | ||
Good signature from "Mytonwallet Dev <[email protected]>" | ||
``` | ||
|
||
and | ||
|
||
```shell | ||
Primary key fingerprint: 9F14 4861 3553 1F41 27DF 8CAD 5297 8EAF D01F D271 | ||
``` | ||
|
||
You can ignore this: | ||
|
||
```shell | ||
WARNING: This key is not certified with a trusted signature! | ||
gpg: There is no indication that the signature belongs to the owner. | ||
``` | ||
|
||
(It simply means you have not established a web of trust with other GPG users.) |
Oops, something went wrong.