Skip to content

Commit

Permalink
Merge pull request #36 from qlrd/main
Browse files Browse the repository at this point in the history
Major updates of libraries to go to a stable version of the software
  • Loading branch information
qlrd authored Dec 23, 2023
2 parents 3678248 + 029ab84 commit ee96e0f
Show file tree
Hide file tree
Showing 67 changed files with 1,100 additions and 979 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-linux-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: "20.10.0"

- name: Variables helpers
id: setup
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Upload artifacts
uses: actions/upload-artifact@v3
#if: ${{ github.ref_name == 'main' }}
if: ${{ github.ref_name == 'main' }}
with:
name: ${{ runner.os }}-${{ steps.setup.outputs.app-name }}-AppImage
retention-days: 5
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/build-linux-deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build electron application as deb package on linux

on:
workflow_call:
secrets:
token:
required: true

jobs:

build-linux:
runs-on: ubuntu-latest

steps:

- name: Checkout Git repository
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: "20.10.0"

- name: Variables helpers
id: setup
run: |
KRUX_VERSION=`node -e "console.log(require('./package.json').version)"`
echo "app-version=$KRUX_VERSION" >> $GITHUB_OUTPUT
KRUX_NAME=krux-installer
echo "app-name=${KRUX_NAME}_${KRUX_VERSION}_amd64" >> $GITHUB_OUTPUT
echo "::group::Variables"
echo "app-version=$KRUX_VERSION"
echo "app-name=$KRUX_NAME"
echo "::endgroup::"
- name: Install dependencies
run: yarn install

- name: Build electron app
env:
GH_TOKEN: ${{ secrets.token }}
run: yarn run build --linux deb

- name: Hash electron app (Linux)
uses: qlrd/sha256sum-action@v2
with:
working-directory: ./release/${{ steps.setup.outputs.app-version }}
file: ${{ steps.setup.outputs.app-name }}.deb
ext: sha256.txt

- name: List release files
run: |
echo "::group::Release files"
ls -la release/${{ steps.setup.outputs.app-version }}
echo "::endgroup::"
- name: Install xvfb-maybe to allow headless test
run: yarn add --dev xvfb-maybe

- name: E2E test electron app
env:
DEBUG: 'krux:*'
run: ./node_modules/.bin/xvfb-maybe ./node_modules/.bin/wdio run wdio.conf.mts

- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ github.ref_name == 'main' }}
with:
name: ${{ runner.os }}-${{ steps.setup.outputs.app-name }}-deb
retention-days: 5
path: |
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.deb
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.deb.sha256.txt
2 changes: 1 addition & 1 deletion .github/workflows/build-mac-dmg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: "20.10.0"

- name: Variables helpers
id: setup
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-windows-nsis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: "20.10.0"

- name: Variables helpers
id: setup
shell: pwsh
run: |
$loc = Get-Location
$firmware_version = "v23.09.0"
$firmware_version = "v23.09.1"
$zipname = "krux-$firmware_version.zip"
$signame = "krux-$firmware_version.zip.sig"
$pemname = "selfcustody.pem"
$extraResources = "$loc\extraResources"
$opensslVersion = "3.1.3"
$opensslVersion = "3.2.0"
$release_url = "https://github.com/selfcustody/krux/releases/download"
$raw_url = "https://raw.githubusercontent.com/selfcustody/krux/main"
$app_version = node -e "console.log(require('./package.json').version)"
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Install chromedriver.exe
shell: pwsh
run: |
$url = "https://chromedriver.storage.googleapis.com/106.0.5249.61/chromedriver_win32.zip"
$url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.56/win32/chrome-win32.zip"
$tmp_path = ".\chromedriver_win32.zip"
$dest_path = "node_modules\chromedriver\bin"
Invoke-WebRequest -Uri $url -OutFile $tmp_path
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:

- name: Upload artifacts
uses: actions/upload-artifact@v3
#if: ${{ github.ref_name == 'main' }}
if: ${{ github.ref_name == 'main' }}
with:
name: ${{ runner.os}}-${{ steps.setup.outputs.app-name }}-Nsis
retention-days: 5
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- ".vscode"
- ".dockerignore"
- "Dockerfile"
#- ".gitignore"
- ".gitignore"
#- ".github/**"
#- "!.github/workflows/build.yml"

Expand All @@ -22,12 +22,17 @@ jobs:
secrets:
token: ${{ secrets.github_token }}

build-windows-nsis:
uses: ./.github/workflows/build-windows-nsis.yml
build-linux-deb:
uses: ./.github/workflows/build-linux-deb.yml
secrets:
token: ${{ secrets.github_token }}

build-mac-dmg:
uses: ./.github/workflows/build-mac-dmg.yml
build-windows-nsis:
uses: ./.github/workflows/build-windows-nsis.yml
secrets:
token: ${{ secrets.github_token }}

#build-mac-dmg:
# uses: ./.github/workflows/build-mac-dmg.yml
# secrets:
# token: ${{ secrets.github_token }}
3 changes: 2 additions & 1 deletion .vscode/.e2e.env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DEBUG=krux:*
DEBUG=krux:*
NODE_ENV=test
48 changes: 21 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
## 2022-10-03
# 0.0.1

[v2.1.0](https://github.com/electron-vite/electron-vite-vue/pull/267)
- Major updates dependencies:
- `electron`: 28.1.0;
- `vite-plugin-electron`: 0.15.5;
- `wdio-electron-service`: 6.0.2.

- `vite-electron-plugin` is Fast, and WYSIWYG. 🌱
- last-commit: db2e830 v2.1.0: use `vite-electron-plugin` instead `vite-plugin-electron`
- Minor updates:
- `@wdio/cli`: 8.27.0;
- `@wdio/globals`: 8.27.0;
- `@wdio/local-runner`: 8.27.0;
- `@wdio/mocha-framework`: 8.27.0;
- `@wdio/spec-reporter`: 8.27.0;
- `vue`: 3.3.13;
- `vue-tsc`: 1.8.26;
- `vuetify`: 3.4.8;

## 2022-06-04
- Refactored `test/e2e/specs`:
- to suit `wdio-electron-service` major updates that break E2E tests;
- renamed extensions to `mts` to suit `vite-plugin-electron`;
- updated krux firmware version checks to `23.09.1`;

[v2.0.0](https://github.com/electron-vite/electron-vite-vue/pull/156)
- Updated `openssl` for windows to `3.2.0` *;

- 🖖 Based on the `vue-ts` template created by `npm create vite`, integrate `vite-plugin-electron`
- ⚡️ More simplify, is in line with Vite project structure
- last-commit: a15028a (HEAD -> main) feat: hoist `process.env`
- Removed MacOS release since the current approach did not worked well on MacOS;

## 2022-01-30

[v1.0.0](https://github.com/electron-vite/electron-vite-vue/releases/tag/v1.0.0)

- ⚡️ Main、Renderer、preload, all built with vite

## 2022-01-27
- Refactor the scripts part.
- Remove `configs` directory.

## 2021-11-11
- Refactor the project. Use vite.config.ts build `Main-process`, `Preload-script` and `Renderer-process` alternative rollup.
- Scenic `Vue>=3.2.13`, `@vue/compiler-sfc` is no longer necessary.
- If you prefer Rollup, Use rollup branch.

```bash
Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
```
> \* see [WARNING](WARNING.md)
88 changes: 15 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ For more information, see [flash the firmware onto the device](https://selfcusto

- MacOS

**Help Wanted**: we need mac users!

## Install

- See [releases page](https://github.com/selfcustody/krux-installer/releases);
Expand Down Expand Up @@ -102,6 +100,13 @@ if you want to show some debug messages:
DEBUG=krux:* yarn run dev
```

#### Debug development app with VSCode/VSCodium

If you're codding with VSCode/VSCodium, go to `Run and Debug`
tab and select `Debug App`:

![VScodium Debug](images/vscodium_debug.png)

### Test

#### Prepare tests
Expand Down Expand Up @@ -159,81 +164,18 @@ In linux/mac:
DEBUG=krux:* yarn run build --<os> <target>
```

##### Filter tests

Additionaly, you can filter some tests with
`--filter` option and a based regular expression argument.
##### Run tests

For example, if you want to exclude tests until `25th` test,
you can do this:
To run all tests in command line:

```bash
yarn run e2e --filter '0([0-1][0-9]|2[0-4]).*.spec.ts'
NODE_ENV=test yarn run e2e
```

if you want to debug some messages:
#### Debug test in VSCode/VSCodium

```bash
DEBUG=krux:* yarn run e2e --filter '0([0-1][0-9]|2[0-4]).*.spec.ts'
```
If you're codding with VSCode/VSCodium, the `NODE_ENV`
variable is already configured. To run, tests, go to `Run and Debug`
tab and select `Test E2E App`:

#### WARNING: Builtin OpenSSL for windows in KruxInstaller

When downloading official krux firmware versions,
it is necessary to verify the signature through the OpenSSL tool,
as a way to verify the authenticity of the downloaded binaries.

On "Unix like" releases (Linux and MacOS),
verification is easily done since such tool
exists natively in operating system.

In windows release,
we are faced with the peculiarity of the operating system in question
do not have such a tool
(see this [issue](https://github.com/qlrd/krux-installer/issues/2)).

So, we packaged a stable version of OpenSSL, and
compiled it from the [source](https://github.com/openssl/openssl).
The compilation process is done entirely in a reproducible virtual environment and,
therefore, not locally, with the github-action [compile-openssl-windows-action](https://github.com/qlrd/compile-openssl-windows-action/actions).

Since it is compiled in a virtual environment on github:

- it is expected to be fully verifiable and free of malicious code;
- it is expected that, if you're developing in Windows machine,
some difficulties will be appear.
- You can check the build steps in [actions](https://github.com/qlrd/krux-installer/actions).

## TODOs

- Kendryte K210 devices:
- [x] Flash to M5stickV;
- [x] Flash to Sipeed Amigo;
- [x] Flash to Sipeed Bit;
- [x] Flash to Sipeed Dock;
- [ ] Flash to Yahboom Aimotion
- [ ] Build from source to M5stickV;
- [ ] Build from source to Sipeed Amigo;
- [ ] Build from source to Sipeed Bit;
- [ ] Build from source to Sipeed Dock;
- [ ] Debug for M5stickV;
- [ ] Debug for Sipeed Amigo;
- [ ] Debug for Sipeed Bit;
- [ ] Debug for Sipeed Dock;
- [odudex Android version](https://github.com/odudex/krux_binaries/tree/main/Android):
- [ ] Transfer to device;
- [ ] Build for device;
- [ ] Debug for device.
- Windows:
- [x] Build NSIS installer;
- [ ] Build Portable installer;
- [ ] Build AppX installer;
- Linux:
- [x] Build `AppImage` standalone;
- [ ] Build `deb` package for [apt-get](https://www.debian.org/doc/manuals/apt-howto/);
- [ ] Build `snap` package for [snapcraft](https://snapcraft.io/);
- [ ] Build `pacman` package for [pacman](https://wiki.archlinux.org/title/Pacman).
- MacOS:
- [x] Build DMG installer;
- [ ] Build PKG installer;
- [ ] Build MAS installer;
![VScodium E2E test](images/vscodium.png)
33 changes: 33 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# TODO

- Kendryte K210 devices:
- [x] Flash to M5stickV;
- [x] Flash to Sipeed Amigo;
- [x] Flash to Sipeed Bit;
- [x] Flash to Sipeed Dock;
- [ ] Flash to Yahboom Aimotion
- [ ] Build from source to M5stickV;
- [ ] Build from source to Sipeed Amigo;
- [ ] Build from source to Sipeed Bit;
- [ ] Build from source to Sipeed Dock;
- [ ] Debug for M5stickV;
- [ ] Debug for Sipeed Amigo;
- [ ] Debug for Sipeed Bit;
- [ ] Debug for Sipeed Dock;
- [odudex Android version](https://github.com/odudex/krux_binaries/tree/main/Android):
- [ ] Transfer to device;
- [ ] Build for device;
- [ ] Debug for device.
- Windows:
- [x] Build NSIS installer;
- [ ] Build Portable installer;
- [ ] Build AppX installer;
- Linux:
- [x] Build `AppImage` standalone;
- [x] Build `deb` package for [apt-get](https://www.debian.org/doc/manuals/apt-howto/);
- [ ] Build `snap` package for [snapcraft](https://snapcraft.io/);
- [ ] Build `pacman` package for [pacman](https://wiki.archlinux.org/title/Pacman).
- MacOS:
- [x] Build DMG installer;
- [ ] Build PKG installer;
- [ ] Build MAS installer;
Loading

0 comments on commit ee96e0f

Please sign in to comment.