diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 7e9bc549f..dfa8739ae 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -8,22 +8,49 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: - build: - runs-on: ubuntu-latest - + build-and-test: strategy: + fail-fast: false matrix: - node-version: [11.x] + os: [windows-latest, ubuntu-latest] + node-version: ['14', '16'] + + # OS-specific commands/variables + include: + - os: ubuntu-latest + cmd_del: rm + cmd_build: npm run build + - os: windows-latest + cmd_del: del + cmd_build: node .\scripts\package.js + + runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y - - run: npm i - - run: npm run build --if-present - - run: npm test + + - name: Install dependencies (linux only) + if: matrix.os == 'ubuntu-latest' + run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y + + - name: Remove lock file (old node.js only) + if: matrix.node-version == '14' + run: ${{ matrix.cmd_del }} package-lock.json + + - name: Install npm packages + run: npm i --legacy-peer-deps + + - name: Build + run: ${{ matrix.cmd_build }} + + - name: Test + run: npm test diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 785bb1815..df7473b2c 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -4,28 +4,45 @@ on: workflow_dispatch jobs: package: - runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-18.04] + + # OS-specific commands/variables + include: + - os: ubuntu-18.04 + cmd_package: npm run package-linux + out_filename: Bob-linux + - os: windows-latest + cmd_package: npm run package-win + out_filename: Bob-windows + + runs-on: ${{matrix.os}} steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js 16.x uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 16.x - - name: Install dependencies + - name: Install dependencies (linux only) + if: matrix.os == 'ubuntu-18.04' run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y - - name: npm install - run: npm i + - name: Install npm packages + run: npm i --legacy-peer-deps - - name: Generate AppImage - run: npm run package-linux + - name: Generate Executable + run: ${{ matrix.cmd_package }} - name: Store artifacts uses: actions/upload-artifact@v2 with: - name: AppImage - path: release/*.AppImage + name: ${{ matrix.out_filename }} + path: | + release/*.AppImage + release/*.msi diff --git a/BUILD.md b/BUILD.md index c358623f0..d79737aec 100644 --- a/BUILD.md +++ b/BUILD.md @@ -3,7 +3,7 @@ ### MacOS 1. uninstall gmp by running `brew uninstall gmp --ignore-dependencies` -2. run `npm run package` +2. run `npm run package-mac` (see [README](./README.md) for cross-arch build) 3. reinstall gmp by running `brew install gmp` 4. notarize `Bob.dmg` by running `xcrun altool --notarize-app --primary-bundle-id "{bunde-id}" --username "{username}" --password "{password}" --asc-provider "{asc-provider-id}" --file ./release/Bob.dmg` 5. you can check notarization status by running `xcrun altool --notarization-info "{notarization-id}" --username "{username} --password "{password}"` diff --git a/README.md b/README.md index 177b8571c..7d0ceafc3 100644 --- a/README.md +++ b/README.md @@ -48,20 +48,40 @@ Due to Ledger USB integration, additional dependencies are required: #### OSX +If you are running OSX on an arm64 processor (aka "Apple Silicon" or "M1") it +is highly recommended to upgrade to Node.js v16 +[which has arm64 support.](https://nodejs.org/en/blog/release/v16.0.0/#toolchain-and-compiler-upgrades) + +Building for OSX requires one extra "optional" dependency (dmg-license) +[that can not currently be installed on Windows/Linux systems](https://github.com/electron-userland/electron-builder/issues/6520): + ```bash brew install libusb git clone https://github.com/kyokan/bob-wallet cd bob-wallet npm install +npm install dmg-license ``` -Build the app package: +Build the app package *for the native architecture of your Mac*: ```bash -npm run package +npm run package-mac ``` -The output app will be created in the `/release/mac` folder. Open `Bob.app` to start the wallet. +If you are running OSX on an arm64 but want to build the executable for x86 (Intel) +Macs, you can do so but you must first downgrade to Node.js v14 or re-install Node.js v16 +for x86 instead of arm64. Building for a non-native architecture will seriously impair +the performance of the application, so this option is only recommended for multi-platform +distribution by maintainers with M1 Macs. As an extra complication, this process must +be run in an environment where `libunbound` is available as an x86 package. + +```bash +npm run package-mac-intel +``` + +The output app will be created in the `/release/mac` or `/release/mac-arm64` folder. +Open `Bob.app` to start the wallet. #### Linux diff --git a/app/app.html b/app/app.html index 262b086ec..082d376e9 100644 --- a/app/app.html +++ b/app/app.html @@ -11,5 +11,9 @@
+