From 163d4ff5fbe82df873b58417e7209485fc1dbad4 Mon Sep 17 00:00:00 2001 From: Mark Sinclair Date: Wed, 2 Feb 2022 16:01:20 +0000 Subject: [PATCH] Wallet signing on MacOS (#1093) * Fix up tauri config to have correct Apple signing metadata * Add GitHub Actions to create a release, build and sign the wallet (on MacOS) when pushing to a `nym-wallet-*` tag * Review feedback * [ci skip] Generate TS types Co-authored-by: mmsinclair --- .../workflows/nym-wallet-publish-macos.yml | 70 +++++++++++++++++++ .github/workflows/nym-wallet-publish.yml | 13 +++- nym-wallet/Cargo.lock | 2 +- nym-wallet/src-tauri/Cargo.toml | 2 +- nym-wallet/src-tauri/tauri.conf.json | 14 ++-- 5 files changed, 89 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/nym-wallet-publish-macos.yml diff --git a/.github/workflows/nym-wallet-publish-macos.yml b/.github/workflows/nym-wallet-publish-macos.yml new file mode 100644 index 0000000000..b75986d0ac --- /dev/null +++ b/.github/workflows/nym-wallet-publish-macos.yml @@ -0,0 +1,70 @@ +name: Publish Nym Wallet (MacOS) +on: + push: + tags: + - nym-wallet-* + +defaults: + run: + working-directory: nym-wallet + +jobs: + publish-tauri: + strategy: + fail-fast: false + matrix: + platform: [macos-latest] + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v2 + - name: Node v16 + uses: actions/setup-node@v1 + with: + node-version: 16.x + - name: Install Rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Install the Apple developer certificate for code signing + env: + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + + # import certificate and provisioning profile from secrets + echo -n "$APPLE_CERTIFICATE" | base64 --decode --output $CERTIFICATE_PATH + + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + + - name: Install app dependencies and build it + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_IDENTITY_ID }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + run: yarn && yarn build + + - name: Upload to release based on tag name + uses: softprops/action-gh-release@v1 + with: + files: nym-wallet/target/release/bundle/dmg/*.dmg + + - name: Clean up keychain + if: ${{ always() }} + run: | + security delete-keychain $RUNNER_TEMP/app-signing.keychain-db diff --git a/.github/workflows/nym-wallet-publish.yml b/.github/workflows/nym-wallet-publish.yml index 95544979af..549e306197 100644 --- a/.github/workflows/nym-wallet-publish.yml +++ b/.github/workflows/nym-wallet-publish.yml @@ -1,4 +1,4 @@ -name: Publish Nym Wallet +name: Publish Nym Wallet (create release based on tag name) on: push: tags: @@ -8,5 +8,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Run a one-line script - run: echo Hello, world! + - name: Checkout + uses: actions/checkout@v2 + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + body: This is a pre-release of the Nym Wallet. + diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 5d6b0c3e31..7afbc04e3d 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "nym_wallet" -version = "0.1.0" +version = "1.0.0" dependencies = [ "bip39", "coconut-interface", diff --git a/nym-wallet/src-tauri/Cargo.toml b/nym-wallet/src-tauri/Cargo.toml index 54e43f7470..91a693d95e 100644 --- a/nym-wallet/src-tauri/Cargo.toml +++ b/nym-wallet/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nym_wallet" -version = "0.1.0" +version = "1.0.0" description = "Nym Native Wallet" authors = ["you"] license = "" diff --git a/nym-wallet/src-tauri/tauri.conf.json b/nym-wallet/src-tauri/tauri.conf.json index 3a71b3a3eb..5465a7dfb8 100644 --- a/nym-wallet/src-tauri/tauri.conf.json +++ b/nym-wallet/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "nym-wallet", - "version": "0.12.1" + "version": "1.0.0" }, "build": { "distDir": "../dist", @@ -13,7 +13,7 @@ "bundle": { "active": true, "targets": "all", - "identifier": "com.nymwallet.nymtech", + "identifier": "net.nymtech.wallet", "icon": [ "icons/32x32.png", "icons/128x128.png", @@ -23,9 +23,9 @@ ], "resources": [], "externalBin": [], - "copyright": "", - "category": "DeveloperTool", - "shortDescription": "", + "copyright": "Copyright © 2021-2022 Nym Technologies SA", + "category": "Business", + "shortDescription": "Nym desktop wallet allows you to manage your Nym tokens", "longDescription": "", "deb": { "depends": [], @@ -36,7 +36,7 @@ "minimumSystemVersion": "", "useBootstrapper": false, "exceptionDomain": "", - "signingIdentity": null, + "signingIdentity": "Developer ID Application: Nym Technologies SA (VW5DZLFHM5)", "entitlements": null }, "windows": { @@ -55,7 +55,7 @@ }, "windows": [ { - "title": "nym-wallet", + "title": "Nym Wallet", "width": 1268, "height": 768, "resizable": true