From 40493f363fa48c136d5718dc64e439073169120e Mon Sep 17 00:00:00 2001 From: crypto-matto Date: Fri, 5 Jul 2024 15:55:38 +0800 Subject: [PATCH] Update Windows Deployment --- .github/workflows/release.yml | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95cc98fd4..89ebb07d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,43 +95,43 @@ jobs: # Login to Snap Store SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} - # - name: Build Electron app (Windows) - # if: startsWith(matrix.os, 'windows') - # run: | - # yarn run electron:build + - name: Build Electron app (Windows) + if: startsWith(matrix.os, 'windows') + run: | + yarn run electron:build - # - 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: | - # 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" - - # - name: Upload artifacts (Windows) - # uses: actions/upload-artifact@v2 - # if: startsWith(matrix.os, 'windows') - # with: - # name: ${{ matrix.os }} - # path: dist + - 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: | + 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: 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 }} + - 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" + + - 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 }}