From 952ff688ca6adff001657c0883fc2c6e85ee3754 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Tue, 15 Feb 2022 18:36:23 +0800 Subject: [PATCH 01/27] Add Windows Signing deployment --- .github/workflows/release.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4427294d..f858fc1c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,10 @@ jobs: # Log in to Snap Store snapcraft_token: ${{ secrets.snapcraft_token }} + - name: Install AzureSignTool + if: startsWith(matrix.os, 'windows') + run: dotnet tool install --global AzureSignTool + - name: Extract current branch name shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" @@ -58,8 +62,9 @@ jobs: mkdir -p ~/private_keys/ echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8 - - name: Build/release Electron app + - name: Build/release Electron app (MacOS, Ubuntu) uses: samuelmeuli/action-electron-builder@v1 + if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') with: build_script_name: electron:pre-build @@ -74,7 +79,21 @@ jobs: mac_certs: ${{ secrets.mac_certs }} mac_certs_password: ${{ secrets.mac_certs_password }} + - name: Sign package + if: startsWith(matrix.os, 'windows') + run: | + Get-ChildItem -recurse -Include **.msix | ForEach-Object { + $msixPath = $_.FullName + & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $msixPath + } + + - name: Release Electron app (Windows) env: - # macOS notarization API key - API_KEY_ID: ${{ secrets.mac_api_key_id }} - API_KEY_ISSUER_ID: ${{ secrets.mac_api_key_issuer_id }} \ No newline at end of file + github_token: ${{ secrets.github_token }} + binary: deploy-windows + run: | + curl -X POST \ + -H 'Content-Type: application/x-executable' \ + --data-binary @${BINARY} \ + https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${BINARY} + From a09ec34c61a5c8111d2eb1f602e695ed95708047 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Tue, 15 Feb 2022 19:29:05 +0800 Subject: [PATCH 02/27] Add test-release.yml --- .github/workflows/test-release.yml | 99 ++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/test-release.yml diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 000000000..315e66f8e --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,99 @@ +# Only run on feature/sign-windows push +name: Release Executables Binaries + +on: + push: + branches: + - feature/sign-windows +jobs: + release: + runs-on: ${{ matrix.os }} + environment: deployment + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: setup dependencies + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev + + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install deps with big timeout + run: | + yarn install --network-timeout 600000 + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v1 + # Only install Snapcraft on Ubuntu + if: startsWith(matrix.os, 'ubuntu') + with: + # Log in to Snap Store + snapcraft_token: ${{ secrets.snapcraft_token }} + + - name: Install AzureSignTool + if: startsWith(matrix.os, 'windows') + run: dotnet tool install --global AzureSignTool + + - name: Extract current branch name + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + - name: Log release reference + run: | + echo "********* START RELEASE REF **********" + echo ${{ github.ref }} + echo ${{ steps.extract_branch.outputs.branch }} + echo "********* END RELEASE REF ************" + + - name: Prepare for app notarization (MacOS) + if: startsWith(matrix.os, 'macos') + # Import Apple API key for app notarization on macOS + run: | + mkdir -p ~/private_keys/ + echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8 + + - name: Build/release Electron app (MacOS, Ubuntu) + uses: samuelmeuli/action-electron-builder@v1 + if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') + with: + + build_script_name: electron:pre-build + + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.github_token }} + + # When a push is done to feature/sign-windows, the action builds binaries for all OS and they are then released directly + release: ${{ steps.extract_branch.outputs.branch == 'feature/sign-windows' }} + + mac_certs: ${{ secrets.mac_certs }} + mac_certs_password: ${{ secrets.mac_certs_password }} + + - name: Sign package + if: startsWith(matrix.os, 'windows') + run: | + Get-ChildItem -recurse -Include **.msix | ForEach-Object { + $msixPath = $_.FullName + & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $msixPath + } + + - name: Release Electron app (Windows) + env: + github_token: ${{ secrets.github_token }} + binary: deploy-windows + run: | + curl -X POST \ + -H 'Content-Type: application/x-executable' \ + --data-binary @${BINARY} \ + https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${BINARY} + From 2fd3391578c28fcfa67bf6cd5a932c6044ef37f4 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 13:19:12 +0800 Subject: [PATCH 03/27] change capital letters --- .github/workflows/test-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 315e66f8e..486e29a2f 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -94,6 +94,6 @@ jobs: run: | curl -X POST \ -H 'Content-Type: application/x-executable' \ - --data-binary @${BINARY} \ - https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${BINARY} + --data-binary @${binary} \ + https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${binary} From d00ae1f772257df305a9cec9bf211649d8006934 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 14:07:11 +0800 Subject: [PATCH 04/27] remove name --- .github/workflows/test-release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 486e29a2f..2cd241dbe 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -90,10 +90,8 @@ jobs: - name: Release Electron app (Windows) env: github_token: ${{ secrets.github_token }} - binary: deploy-windows run: | curl -X POST \ -H 'Content-Type: application/x-executable' \ - --data-binary @${binary} \ - https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${binary} + https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets From ed71da95a1a4a26ccd5046eefcf2e00d800be567 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 15:32:03 +0800 Subject: [PATCH 05/27] Revise flow --- .github/workflows/test-release.yml | 36 +++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 2cd241dbe..3d4541ef2 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -79,19 +79,35 @@ jobs: mac_certs: ${{ secrets.mac_certs }} mac_certs_password: ${{ secrets.mac_certs_password }} - - name: Sign package + - name: Build Electron app (Windows) if: startsWith(matrix.os, 'windows') run: | - Get-ChildItem -recurse -Include **.msix | ForEach-Object { - $msixPath = $_.FullName - & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $msixPath + yarn run electron:build + + - name: Sign package (Windows) + if: startsWith(matrix.os, 'windows') + run: | + Get-ChildItem -recurse -Include ./dist/**.exe | ForEach-Object { + $exePath = $_.FullName + & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $exePath } - - name: Release Electron app (Windows) - env: - github_token: ${{ secrets.github_token }} + - name: Cleanup artifacts (Windows) + if: startsWith(matrix.os, 'windows') run: | - curl -X POST \ - -H 'Content-Type: application/x-executable' \ - https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets + npx rimraf "dist_electron/!(*.exe|*.blockmap|*.yml)" + - name: Upload artifacts (Windows) + uses: actions/upload-artifact@v2 + if: startsWith(matrix.os, 'windows') + with: + name: ${{ matrix.os }} + path: dist + + - name: Release (Windows) + uses: softprops/action-gh-release@v1 + if: startsWith(matrix.os, 'windows') + with: + files: "dist/**" + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From 6059b872f29d9af9a8357a1dee80da6a46cccfb5 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 16:54:43 +0800 Subject: [PATCH 06/27] Fix syntax on file extension selection --- .github/workflows/test-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 3d4541ef2..bc0544d87 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -95,7 +95,7 @@ jobs: - name: Cleanup artifacts (Windows) if: startsWith(matrix.os, 'windows') run: | - npx rimraf "dist_electron/!(*.exe|*.blockmap|*.yml)" + npx rimraf "dist/!(*.{exe,blockmap,yml})" - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 From 7e1665dc703a8adad479b8a5d858a683065ced25 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 18:18:38 +0800 Subject: [PATCH 07/27] Fix cleanup artifacts --- .github/workflows/test-release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index bc0544d87..106701cb3 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -95,7 +95,12 @@ jobs: - name: Cleanup artifacts (Windows) if: startsWith(matrix.os, 'windows') run: | - npx rimraf "dist/!(*.{exe,blockmap,yml})" + mkdir dist/temp + mv dist/*.exe ./dist/temp + mv dist/*.blockmap ./dist/temp + mv dist/latest.yml ./dist/temp + npx rimraf "dist/!(temp)" + npx rimraf "dist/.icon-ico" - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 @@ -108,6 +113,7 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(matrix.os, 'windows') with: + tag_name: ${{ github.ref }} files: "dist/**" env: GITHUB_TOKEN: ${{ secrets.github_token }} From bc4db55844e2a6698fa43b129bdcb7242c1fb152 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 20:03:04 +0800 Subject: [PATCH 08/27] Fix azuresigntool command & draft release --- .github/workflows/test-release.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 106701cb3..5ad6d4e4b 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -87,20 +87,19 @@ jobs: - name: Sign package (Windows) if: startsWith(matrix.os, 'windows') run: | - Get-ChildItem -recurse -Include ./dist/**.exe | ForEach-Object { + cd dist; Get-ChildItem -recurse -Include **.exe | ForEach-Object { $exePath = $_.FullName - & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $exePath - } + & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc "${{ secrets.azure_key_vault_name }}" -tr http://timestamp.digicert.com -v $exePath + }; cd .. - name: Cleanup artifacts (Windows) if: startsWith(matrix.os, 'windows') run: | - mkdir dist/temp - mv dist/*.exe ./dist/temp - mv dist/*.blockmap ./dist/temp - mv dist/latest.yml ./dist/temp + mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml - Destination dist/temp npx rimraf "dist/!(temp)" npx rimraf "dist/.icon-ico" + mv dist/temp/* dist + npx rimraf "dist/temp" - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 @@ -113,6 +112,7 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(matrix.os, 'windows') with: + draft: true tag_name: ${{ github.ref }} files: "dist/**" env: From fe2fdbd06d9ac290f42e363a78c1515c86c6b27c Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 20:12:43 +0800 Subject: [PATCH 09/27] Add release tag --- .github/workflows/test-release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 5ad6d4e4b..0e6cb2c64 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -108,6 +108,17 @@ jobs: name: ${{ matrix.os }} path: dist + - uses: actions/checkout@v2 + - name: Set output + id: vars + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + - name: Check output + env: + RELEASE_VERSION: ${{ steps.vars.outputs.tag }} + run: | + echo $RELEASE_VERSION + echo ${{ steps.vars.outputs.tag }} + - name: Release (Windows) uses: softprops/action-gh-release@v1 if: startsWith(matrix.os, 'windows') From 4177ea0c32c63a86a8877d67d9537597f880d2aa Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 20:42:00 +0800 Subject: [PATCH 10/27] Fix error & change release deploy tool --- .github/workflows/test-release.yml | 31 ++++++++++++------------------ package.json | 2 +- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 0e6cb2c64..4d78463aa 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -95,7 +95,7 @@ jobs: - name: Cleanup artifacts (Windows) if: startsWith(matrix.os, 'windows') run: | - mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml - Destination dist/temp + mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml -Destination dist/temp npx rimraf "dist/!(temp)" npx rimraf "dist/.icon-ico" mv dist/temp/* dist @@ -108,23 +108,16 @@ jobs: name: ${{ matrix.os }} path: dist - - uses: actions/checkout@v2 - - name: Set output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} - - name: Check output - env: - RELEASE_VERSION: ${{ steps.vars.outputs.tag }} - run: | - echo $RELEASE_VERSION - echo ${{ steps.vars.outputs.tag }} - - - name: Release (Windows) - uses: softprops/action-gh-release@v1 + - name: Get version from package.json + if: startsWith(matrix.os, 'windows') + run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV + + - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') + uses: pkgdeps/git-tag-action@v2 with: - draft: true - tag_name: ${{ github.ref }} - files: "dist/**" - env: - GITHUB_TOKEN: ${{ secrets.github_token }} + github_token: ${{ secrets.GITHUB_TOKEN }} + github_repo: ${{ github.repository }} + version: ${{ env.PACKAGE_VERSION }} + git_commit_sha: ${{ github.sha }} + git_tag_prefix: "v" diff --git a/package.json b/package.json index 76e7a66bb..cf60f3285 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chain-desktop-wallet", - "version": "0.6.8", + "version": "0.0.1", "description": "Crypto.com Chain Desktop Wallet App", "repository": "github:crypto-com/chain-desktop-wallet", "author": "Crypto.org ", From f552d61838d44a8eff7c19946cf39b0a089c9b08 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 21:21:17 +0800 Subject: [PATCH 11/27] Attempt to keep double quote --- .github/workflows/test-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 4d78463aa..3a141386b 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -110,13 +110,13 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') - run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV + run: node -p -e '`PACKAGE_VERSION=${require(\"./package.json\").version}`' >> $GITHUB_ENV - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') uses: pkgdeps/git-tag-action@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.github_token }} github_repo: ${{ github.repository }} version: ${{ env.PACKAGE_VERSION }} git_commit_sha: ${{ github.sha }} From 722092d6ef44b6e36c55727eaf1448cedc6367b3 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 21:54:27 +0800 Subject: [PATCH 12/27] Test another get version approach --- .github/workflows/test-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 3a141386b..ce2fb12af 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -110,7 +110,9 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') - run: node -p -e '`PACKAGE_VERSION=${require(\"./package.json\").version}`' >> $GITHUB_ENV + run: | + PACKAGE_VERSION=`node -e "console.log(require('./package.json').version);"` + echo package_version=$PACKAGE_VERSION >> $GITHUB_ENV - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') From afb007ed5f454289dfe5500ba3147e6acdadd45c Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:03:28 +0800 Subject: [PATCH 13/27] Test another get version approach --- .github/workflows/test-release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index ce2fb12af..ec68eed1e 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -27,6 +27,18 @@ jobs: with: node-version: 12 + - name: Get version from package.json + if: startsWith(matrix.os, 'windows') + run: | + PACKAGE_VERSION=`node -e "console.log(require('./package.json').version);"` + echo package_version=$PACKAGE_VERSION >> $GITHUB_ENV + echo $PACKAGE_VERSION + + - name: Test package.json environement variable + if: startsWith(matrix.os, 'windows') + run: | + echo ${{ env.package_version }} + - name: Install deps with big timeout run: | yarn install --network-timeout 600000 From 497d8b2f2d4b9b355de915abe8d88690c6e53403 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:17:04 +0800 Subject: [PATCH 14/27] Test another get version approach --- .github/workflows/test-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index ec68eed1e..ed9adec7f 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -30,9 +30,9 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') run: | - PACKAGE_VERSION=`node -e "console.log(require('./package.json').version);"` - echo package_version=$PACKAGE_VERSION >> $GITHUB_ENV - echo $PACKAGE_VERSION + node -p -e '`package_version=${require(\"./package.json\").version}`' >> $GITHUB_ENV + node -p -e '`package_version=${require(\"./package.json\").version}`' + echo ${{ env.package_version }} - name: Test package.json environement variable if: startsWith(matrix.os, 'windows') From c3364b387c5f12b539c0fc8a3c8e0e3f9031bd10 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:32:10 +0800 Subject: [PATCH 15/27] Test another get version approach --- .github/workflows/test-release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index ed9adec7f..c3041bc23 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -30,7 +30,7 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') run: | - node -p -e '`package_version=${require(\"./package.json\").version}`' >> $GITHUB_ENV + node -p -e '`package_version=${require(\"./package.json\").version}`' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append node -p -e '`package_version=${require(\"./package.json\").version}`' echo ${{ env.package_version }} @@ -123,8 +123,7 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') run: | - PACKAGE_VERSION=`node -e "console.log(require('./package.json').version);"` - echo package_version=$PACKAGE_VERSION >> $GITHUB_ENV + node -p -e '`package_version=${require(\"./package.json\").version}`' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') @@ -132,6 +131,6 @@ jobs: with: github_token: ${{ secrets.github_token }} github_repo: ${{ github.repository }} - version: ${{ env.PACKAGE_VERSION }} + version: ${{ env.package_version }} git_commit_sha: ${{ github.sha }} git_tag_prefix: "v" From f10a08ef0ef8f11841465a41888c177ac2ff4460 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:43:21 +0800 Subject: [PATCH 16/27] Test another get version approach --- .github/workflows/test-release.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index c3041bc23..8fd1fa64f 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -26,14 +26,19 @@ jobs: uses: actions/setup-node@v1 with: node-version: 12 - + - name: Get version from package.json - if: startsWith(matrix.os, 'windows') - run: | - node -p -e '`package_version=${require(\"./package.json\").version}`' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - node -p -e '`package_version=${require(\"./package.json\").version}`' - echo ${{ env.package_version }} - + shell: bash + run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require(\"./package.json\").version}`')" + id: extract_version + + - name: Get package version + run: | + echo "********* START RELEASE VERSION **********" + echo ${{ github.ref }} + echo ${{ steps.extract_version.outputs.version }} + echo "********* END RELEASE VERSION ************" + - name: Test package.json environement variable if: startsWith(matrix.os, 'windows') run: | From 96c98bbef70f04652f7ff3c5822526cfcac48c21 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:49:03 +0800 Subject: [PATCH 17/27] Test another get version approach --- .github/workflows/test-release.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 8fd1fa64f..9bd920859 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -26,10 +26,10 @@ jobs: uses: actions/setup-node@v1 with: node-version: 12 - + - name: Get version from package.json shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require(\"./package.json\").version}`')" + run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require("./package.json").version}`')" id: extract_version - name: Get package version @@ -39,11 +39,6 @@ jobs: echo ${{ steps.extract_version.outputs.version }} echo "********* END RELEASE VERSION ************" - - name: Test package.json environement variable - if: startsWith(matrix.os, 'windows') - run: | - echo ${{ env.package_version }} - - name: Install deps with big timeout run: | yarn install --network-timeout 600000 @@ -127,15 +122,16 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') - run: | - node -p -e '`package_version=${require(\"./package.json\").version}`' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - + shell: bash + run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require("./package.json").version}`')" + id: extract_version + - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') uses: pkgdeps/git-tag-action@v2 with: github_token: ${{ secrets.github_token }} github_repo: ${{ github.repository }} - version: ${{ env.package_version }} + version: ${{ steps.extract_version.outputs.version }} git_commit_sha: ${{ github.sha }} git_tag_prefix: "v" From 9a9fbd5126a38d9a92eb9f342497927b1cac100d Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 22:52:46 +0800 Subject: [PATCH 18/27] Test another get version approach --- .github/workflows/test-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 9bd920859..a9442e12b 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -29,7 +29,7 @@ jobs: - name: Get version from package.json shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require("./package.json").version}`')" + run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" id: extract_version - name: Get package version @@ -123,8 +123,8 @@ jobs: - name: Get version from package.json if: startsWith(matrix.os, 'windows') shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`package_version=${require("./package.json").version}`')" - id: extract_version + run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" + id: package_version - name: package-version-to-git-tag if: startsWith(matrix.os, 'windows') @@ -132,6 +132,6 @@ jobs: with: github_token: ${{ secrets.github_token }} github_repo: ${{ github.repository }} - version: ${{ steps.extract_version.outputs.version }} + version: ${{ steps.package_version.outputs.version }} git_commit_sha: ${{ github.sha }} git_tag_prefix: "v" From 8b30a3a02d851e7eff95bfb17d14aa4996c8743c Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Wed, 16 Feb 2022 23:47:28 +0800 Subject: [PATCH 19/27] Customize flow & add .eve release --- .github/workflows/test-release.yml | 37 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index a9442e12b..52dcee62b 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -27,18 +27,6 @@ jobs: with: node-version: 12 - - name: Get version from package.json - shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" - id: extract_version - - - name: Get package version - run: | - echo "********* START RELEASE VERSION **********" - echo ${{ github.ref }} - echo ${{ steps.extract_version.outputs.version }} - echo "********* END RELEASE VERSION ************" - - name: Install deps with big timeout run: | yarn install --network-timeout 600000 @@ -60,11 +48,17 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch + - name: Get version from package.json + shell: bash + run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" + id: package_version + - name: Log release reference run: | echo "********* START RELEASE REF **********" echo ${{ github.ref }} echo ${{ steps.extract_branch.outputs.branch }} + echo ${{ steps.package_version.outputs.version }} echo "********* END RELEASE REF ************" - name: Prepare for app notarization (MacOS) @@ -120,14 +114,7 @@ jobs: name: ${{ matrix.os }} path: dist - - name: Get version from package.json - if: startsWith(matrix.os, 'windows') - shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" - id: package_version - - - name: package-version-to-git-tag - if: startsWith(matrix.os, 'windows') + - name: Push version tag to GitHub if not existed uses: pkgdeps/git-tag-action@v2 with: github_token: ${{ secrets.github_token }} @@ -135,3 +122,13 @@ jobs: version: ${{ steps.package_version.outputs.version }} git_commit_sha: ${{ github.sha }} git_tag_prefix: "v" + + - name: Release Electron app (Windows) + uses: softprops/action-gh-release@v1 + if: startsWith(matrix.os, 'windows') + with: + draft: true + tag_name: ${{ steps.package_version.outputs.version }} + files: "dist/**" + env: + GITHUB_TOKEN: ${{ secrets.github_token }} From cc16f891cd119cb5c1ea573824556dd5c9687c22 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 00:04:02 +0800 Subject: [PATCH 20/27] Remove step --- .github/workflows/test-release.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 52dcee62b..066c107e8 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -52,7 +52,7 @@ jobs: shell: bash run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" id: package_version - + - name: Log release reference run: | echo "********* START RELEASE REF **********" @@ -114,15 +114,6 @@ jobs: name: ${{ matrix.os }} path: dist - - name: Push version tag to GitHub if not existed - uses: pkgdeps/git-tag-action@v2 - with: - github_token: ${{ secrets.github_token }} - github_repo: ${{ github.repository }} - version: ${{ steps.package_version.outputs.version }} - git_commit_sha: ${{ github.sha }} - git_tag_prefix: "v" - - name: Release Electron app (Windows) uses: softprops/action-gh-release@v1 if: startsWith(matrix.os, 'windows') From ee4b0becf0a4207d6b7c1456ddfa02b549f65b39 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 01:09:07 +0800 Subject: [PATCH 21/27] Align version tag & file naming --- .github/workflows/test-release.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 066c107e8..a617e6a67 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -48,17 +48,20 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch - - name: Get version from package.json + - name: Get name & version from package.json shell: bash - run: echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" - id: package_version + run: | + echo "##[set-output name=version;]$(node -p -e '`v${require("./package.json").version}`')" + echo "##[set-output name=name;]$(node -p -e '`v${require("./package.json").name}`')" + id: package_json - name: Log release reference run: | echo "********* START RELEASE REF **********" echo ${{ github.ref }} - echo ${{ steps.extract_branch.outputs.branch }} - echo ${{ steps.package_version.outputs.version }} + echo branch: ${{ steps.extract_branch.outputs.branch }} + echo name: ${{ steps.package_json.outputs.name }} + echo version: ${{ steps.package_json.outputs.version }} echo "********* END RELEASE REF ************" - name: Prepare for app notarization (MacOS) @@ -106,6 +109,8 @@ jobs: npx rimraf "dist/.icon-ico" mv dist/temp/* dist npx rimraf "dist/temp" + mv dist/temp/*.exe dist/temp/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe + mv dist/temp/*.blockmap dist/temp/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe.blockmap - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 @@ -119,7 +124,7 @@ jobs: if: startsWith(matrix.os, 'windows') with: draft: true - tag_name: ${{ steps.package_version.outputs.version }} + tag_name: ${{ steps.package_json.outputs.version }} files: "dist/**" env: GITHUB_TOKEN: ${{ secrets.github_token }} From cc61d85e634e628ed15581b7904979bb4572c134 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 01:34:08 +0800 Subject: [PATCH 22/27] Fix path --- .github/workflows/test-release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index a617e6a67..6c8fd4644 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -40,6 +40,7 @@ jobs: snapcraft_token: ${{ secrets.snapcraft_token }} - name: Install AzureSignTool + # Only install Azure Sign Tool on Windows if: startsWith(matrix.os, 'windows') run: dotnet tool install --global AzureSignTool @@ -51,8 +52,8 @@ jobs: - name: Get name & version from package.json shell: bash run: | - echo "##[set-output name=version;]$(node -p -e '`v${require("./package.json").version}`')" - echo "##[set-output name=name;]$(node -p -e '`v${require("./package.json").name}`')" + echo "##[set-output name=name;]$(node -p -e '`${require("./package.json").name}`')" + echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" id: package_json - name: Log release reference @@ -95,6 +96,8 @@ jobs: - name: Sign package (Windows) if: startsWith(matrix.os, 'windows') + # Instead of pointing to a specific .exe, uses a PowerShell script which iterates through all the files stored in dist folder. + # If the file has the .exe extension, then it will use the AzureSignTool command to sign it. run: | cd dist; Get-ChildItem -recurse -Include **.exe | ForEach-Object { $exePath = $_.FullName @@ -109,8 +112,8 @@ jobs: npx rimraf "dist/.icon-ico" mv dist/temp/* dist npx rimraf "dist/temp" - mv dist/temp/*.exe dist/temp/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe - mv dist/temp/*.blockmap dist/temp/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe.blockmap + mv dist/*.exe dist/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe + mv dist/*.blockmap dist/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe.blockmap - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 @@ -124,7 +127,7 @@ jobs: if: startsWith(matrix.os, 'windows') with: draft: true - tag_name: ${{ steps.package_json.outputs.version }} + tag_name: v${{ steps.package_json.outputs.version }} files: "dist/**" env: GITHUB_TOKEN: ${{ secrets.github_token }} From 5c217ca2b3f71786f7b7ec954ee70210669975b0 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 02:01:46 +0800 Subject: [PATCH 23/27] Align .exe release naming --- .github/workflows/test-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 6c8fd4644..c5fa428a4 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -112,8 +112,8 @@ jobs: npx rimraf "dist/.icon-ico" mv dist/temp/* dist npx rimraf "dist/temp" - mv dist/*.exe dist/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe - mv dist/*.blockmap dist/${{ steps.package_json.outputs.name }}-${{ steps.package_json.outputs.version }}.exe.blockmap + mv dist/*.exe dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe + mv dist/*.blockmap dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe.blockmap - name: Upload artifacts (Windows) uses: actions/upload-artifact@v2 From 6b50dd2011e2943330ed03ec3c00852f5ce9bb76 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 02:07:25 +0800 Subject: [PATCH 24/27] Use Node 14 --- .github/workflows/test-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index c5fa428a4..8f13d8c08 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -25,7 +25,7 @@ jobs: - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: - node-version: 12 + node-version: 14 - name: Install deps with big timeout run: | From 6c1a69cdfc4b564d31f4596c3a823df98ec5e031 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 02:40:44 +0800 Subject: [PATCH 25/27] Remove test-release.yml and migrate to release.yml --- .github/workflows/release.yml | 62 +++++++++++--- .github/workflows/test-release.yml | 133 ----------------------------- 2 files changed, 48 insertions(+), 147 deletions(-) delete mode 100644 .github/workflows/test-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47f55027c..f8c17eb66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,7 @@ jobs: snapcraft_token: ${{ secrets.snapcraft_token }} - name: Install AzureSignTool + # Only install Azure Sign Tool on Windows if: startsWith(matrix.os, 'windows') run: dotnet tool install --global AzureSignTool @@ -48,11 +49,20 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" id: extract_branch + - name: Get name & version from package.json + shell: bash + run: | + echo "##[set-output name=name;]$(node -p -e '`${require("./package.json").name}`')" + echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" + id: package_json + - name: Log release reference run: | echo "********* START RELEASE REF **********" echo ${{ github.ref }} - echo ${{ steps.extract_branch.outputs.branch }} + echo branch: ${{ steps.extract_branch.outputs.branch }} + echo name: ${{ steps.package_json.outputs.name }} + echo version: ${{ steps.package_json.outputs.version }} echo "********* END RELEASE REF ************" - name: Prepare for app notarization (MacOS) @@ -79,21 +89,45 @@ jobs: mac_certs: ${{ secrets.mac_certs }} mac_certs_password: ${{ secrets.mac_certs_password }} - - name: Sign package + - name: Build Electron app (Windows) if: startsWith(matrix.os, 'windows') run: | - Get-ChildItem -recurse -Include **.msix | ForEach-Object { - $msixPath = $_.FullName - & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc ${{ secrets.azure_key_vault_name }} -tr http://timestamp.digicert.com -v $msixPath - } + yarn run electron:build - - name: Release Electron app (Windows) - env: - github_token: ${{ secrets.github_token }} - binary: deploy-windows + - name: Sign built binary (Windows) + if: startsWith(matrix.os, 'windows') + # Instead of pointing to a specific .exe, uses a PowerShell script which iterates through all the files stored in dist folder. + # If the file has the .exe extension, then it will use the AzureSignTool command to sign it. run: | - curl -X POST \ - -H 'Content-Type: application/x-executable' \ - --data-binary @${BINARY} \ - https://${github_actor}:${{ secrets.github_token }}@uploads.github.com/repos/${github_repository}/releases/${{ steps.create_release.outputs.release_id }}/assets?name=${BINARY} + cd dist; Get-ChildItem -recurse -Include **.exe | ForEach-Object { + $exePath = $_.FullName + & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc "${{ secrets.azure_key_vault_name }}" -tr http://timestamp.digicert.com -v $exePath + }; cd .. + - name: Cleanup artifacts (Windows) + if: startsWith(matrix.os, 'windows') + run: | + mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml -Destination dist/temp + npx rimraf "dist/!(temp)" + npx rimraf "dist/.icon-ico" + mv dist/temp/* dist + npx rimraf "dist/temp" + mv dist/*.exe dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe + mv dist/*.blockmap dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe.blockmap + + - name: Upload artifacts (Windows) + uses: actions/upload-artifact@v2 + if: startsWith(matrix.os, 'windows') + with: + name: ${{ matrix.os }} + path: dist + + - name: Release Electron app (Windows) + uses: softprops/action-gh-release@v1 + if: startsWith(matrix.os, 'windows') + with: + draft: true + tag_name: v${{ steps.package_json.outputs.version }} + files: "dist/**" + env: + GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml deleted file mode 100644 index 8f13d8c08..000000000 --- a/.github/workflows/test-release.yml +++ /dev/null @@ -1,133 +0,0 @@ -# Only run on feature/sign-windows push -name: Release Executables Binaries - -on: - push: - branches: - - feature/sign-windows -jobs: - release: - runs-on: ${{ matrix.os }} - environment: deployment - - strategy: - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - - steps: - - name: setup dependencies - if: startsWith(matrix.os, 'ubuntu') - run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev libudev-dev - - - name: Check out Git repository - uses: actions/checkout@v1 - - - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v1 - with: - node-version: 14 - - - name: Install deps with big timeout - run: | - yarn install --network-timeout 600000 - - - name: Install Snapcraft - uses: samuelmeuli/action-snapcraft@v1 - # Only install Snapcraft on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - with: - # Log in to Snap Store - snapcraft_token: ${{ secrets.snapcraft_token }} - - - name: Install AzureSignTool - # Only install Azure Sign Tool on Windows - if: startsWith(matrix.os, 'windows') - run: dotnet tool install --global AzureSignTool - - - name: Extract current branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - - name: Get name & version from package.json - shell: bash - run: | - echo "##[set-output name=name;]$(node -p -e '`${require("./package.json").name}`')" - echo "##[set-output name=version;]$(node -p -e '`${require("./package.json").version}`')" - id: package_json - - - name: Log release reference - run: | - echo "********* START RELEASE REF **********" - echo ${{ github.ref }} - echo branch: ${{ steps.extract_branch.outputs.branch }} - echo name: ${{ steps.package_json.outputs.name }} - echo version: ${{ steps.package_json.outputs.version }} - echo "********* END RELEASE REF ************" - - - name: Prepare for app notarization (MacOS) - if: startsWith(matrix.os, 'macos') - # Import Apple API key for app notarization on macOS - run: | - mkdir -p ~/private_keys/ - echo '${{ secrets.mac_api_key }}' > ~/private_keys/AuthKey_${{ secrets.mac_api_key_id }}.p8 - - - name: Build/release Electron app (MacOS, Ubuntu) - uses: samuelmeuli/action-electron-builder@v1 - if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') - with: - - build_script_name: electron:pre-build - - # GitHub token, automatically provided to the action - # (No need to define this secret in the repo settings) - github_token: ${{ secrets.github_token }} - - # When a push is done to feature/sign-windows, the action builds binaries for all OS and they are then released directly - release: ${{ steps.extract_branch.outputs.branch == 'feature/sign-windows' }} - - mac_certs: ${{ secrets.mac_certs }} - mac_certs_password: ${{ secrets.mac_certs_password }} - - - name: Build Electron app (Windows) - if: startsWith(matrix.os, 'windows') - run: | - yarn run electron:build - - - name: Sign package (Windows) - if: startsWith(matrix.os, 'windows') - # Instead of pointing to a specific .exe, uses a PowerShell script which iterates through all the files stored in dist folder. - # If the file has the .exe extension, then it will use the AzureSignTool command to sign it. - run: | - cd dist; Get-ChildItem -recurse -Include **.exe | ForEach-Object { - $exePath = $_.FullName - & AzureSignTool sign -kvu "${{ secrets.azure_key_vault_url }}" -kvi "${{ secrets.azure_key_vault_client_id }}" -kvt "${{ secrets.azure_key_vault_tenant_id }}" -kvs "${{ secrets.azure_key_vault_client_secret }}" -kvc "${{ secrets.azure_key_vault_name }}" -tr http://timestamp.digicert.com -v $exePath - }; cd .. - - - name: Cleanup artifacts (Windows) - if: startsWith(matrix.os, 'windows') - run: | - mkdir dist/temp; Move-Item -Path dist/*.exe, dist/*.blockmap, dist/latest.yml -Destination dist/temp - npx rimraf "dist/!(temp)" - npx rimraf "dist/.icon-ico" - mv dist/temp/* dist - npx rimraf "dist/temp" - mv dist/*.exe dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe - mv dist/*.blockmap dist/${{ steps.package_json.outputs.name }}-setup-${{ steps.package_json.outputs.version }}.exe.blockmap - - - name: Upload artifacts (Windows) - uses: actions/upload-artifact@v2 - if: startsWith(matrix.os, 'windows') - with: - name: ${{ matrix.os }} - path: dist - - - name: Release Electron app (Windows) - uses: softprops/action-gh-release@v1 - if: startsWith(matrix.os, 'windows') - with: - draft: true - tag_name: v${{ steps.package_json.outputs.version }} - files: "dist/**" - env: - GITHUB_TOKEN: ${{ secrets.github_token }} From efd3a9687bb4f9bb17093c52f355b715ec70f7bb Mon Sep 17 00:00:00 2001 From: crypto-matto <74586409+crypto-matto@users.noreply.github.com> Date: Thu, 17 Feb 2022 10:13:22 +0800 Subject: [PATCH 26/27] Update package.json Co-authored-by: Xinyu <91446598+XinyuCRO@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 05f77aaa5..f64ad1d9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chain-desktop-wallet", - "version": "0.0.1", + "version": "0.6.9", "description": "Crypto.com Chain Desktop Wallet App", "repository": "github:crypto-com/chain-desktop-wallet", "author": "Crypto.org ", From 5ac4a8facbebf664fa34de34e0af451ce3ce5139 Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Thu, 17 Feb 2022 12:19:08 +0800 Subject: [PATCH 27/27] Remove duplicated branch check --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8c17eb66..ffdbd4eb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,9 +83,6 @@ jobs: # (No need to define this secret in the repo settings) github_token: ${{ secrets.github_token }} - # When a push is done to master, the action builds binaries for all OS and they are then released directly - release: ${{ steps.extract_branch.outputs.branch == 'master' }} - mac_certs: ${{ secrets.mac_certs }} mac_certs_password: ${{ secrets.mac_certs_password }}