From 98b6baf81d0e92f681da04ac1a9f24b4b4d06c21 Mon Sep 17 00:00:00 2001 From: Akis Kesoglou Date: Thu, 9 Nov 2023 17:24:52 +0200 Subject: [PATCH] dddd --- .github/actions/publish/action.yml | 28 +++++++++------------------- .github/workflows/flowzone.yml | 2 +- forge.config.ts | 11 +---------- package.json | 4 +++- 4 files changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 3be57c6c76f..438d4fef8b3 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -98,22 +98,11 @@ runs: - name: Import Windows code signing certificate if: runner.os == 'Windows' - shell: powershell - run: | - Set-Content -Path ${{ runner.temp }}/certificate.base64 -Value $env:WINDOWS_CERTIFICATE - certutil -decode ${{ runner.temp }}/certificate.base64 ${{ runner.temp }}/certificate.pfx - Remove-Item -path ${{ runner.temp }} -include certificate.base64 - - Import-PfxCertificate ` - -FilePath ${{ runner.temp }}/certificate.pfx ` - -CertStoreLocation Cert:\CurrentUser\My ` - -Password (ConvertTo-SecureString -String $env:WINDOWS_CERTIFICATE_PASSWORD -Force -AsPlainText) - - Remove-Item -path ${{ runner.temp }} -include certificate.pfx - - env: - WINDOWS_CERTIFICATE: ${{ fromJSON(inputs.secrets).WINDOWS_SIGNING }} - WINDOWS_CERTIFICATE_PASSWORD: ${{ fromJSON(inputs.secrets).WINDOWS_SIGNING_PASSWORD }} + id: import_win_signing_cert + uses: timheuer/base64-to-file@v1 + with: + fileName: 'win-cert.pfx' + encodedString: ${{ secrets.WINDOWS_CERTIFICATE }} - name: Package release id: package_release @@ -129,20 +118,21 @@ runs: if [[ $runner_os =~ linux ]]; then BUILD_ARCH='x64' + npm run make-debug -- --arch="${BUILD_ARCH}" elif [[ $runner_os =~ darwin|macos|osx ]]; then BUILD_ARCH='x64,arm64' + npm run make-debug -- --arch="${BUILD_ARCH}" elif [[ $runner_os =~ windows|win ]]; then BUILD_ARCH="ia32,x64" + npm run make-debug-win -- --arch="${BUILD_ARCH}" else echo "ERROR: unexpected runner OS: ${runner_os}" exit 1 fi - npm run make -- --arch="${BUILD_ARCH}" - echo "version=${APPLICATION_VERSION}" >> $GITHUB_OUTPUT env: @@ -153,7 +143,7 @@ runs: XCODE_APP_LOADER_PASSWORD: ${{ fromJSON(inputs.secrets).XCODE_APP_LOADER_PASSWORD }} XCODE_APP_LOADER_TEAM_ID: ${{ fromJSON(inputs.secrets).XCODE_APP_LOADER_TEAM_ID }} # Windows signing - WINDOWS_SIGNING: ${{ fromJSON(inputs.secrets).WINDOWS_SIGNING }} + WINDOWS_SIGNING_CERT_PATH: ${{ steps.import_win_signing_cert.outputs.filePath }} WINDOWS_SIGNING_PASSWORD: ${{ fromJSON(inputs.secrets).WINDOWS_SIGNING_PASSWORD }} # https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/#improvements-for-public-repository-forks # https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks#about-workflow-runs-from-public-forks diff --git a/.github/workflows/flowzone.yml b/.github/workflows/flowzone.yml index 1193e1f7fd0..8da142716b2 100644 --- a/.github/workflows/flowzone.yml +++ b/.github/workflows/flowzone.yml @@ -20,7 +20,7 @@ jobs: (github.event.pull_request.head.repo.full_name != github.repository && github.event_name == 'pull_request_target') secrets: inherit with: - tests_run_on: '["ubuntu-20.04","macos-12","windows-2019"]' + tests_run_on: '["windows-2019"]' restrict_custom_actions: false github_prerelease: true repo_config: true diff --git a/forge.config.ts b/forge.config.ts index 8e4fb8b70eb..e24b7395931 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -7,7 +7,6 @@ import { MakerDMG } from '@electron-forge/maker-dmg'; import { MakerAppImage } from '@reforged/maker-appimage'; import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives'; import { WebpackPlugin } from '@electron-forge/plugin-webpack'; -import { ResourcePlugin } from 'electron-forge-resource-plugin'; import { mainConfig, rendererConfig } from './webpack.config'; @@ -30,7 +29,7 @@ if (process.env.NODE_ENV === 'production') { }; winSigningConfig = { - certificateFile: process.env.WINDOWS_SIGNING, + certificateFile: process.env.WINDOWS_SIGNING_CERT_PATH, certificatePassword: process.env.WINDOWS_SIGNING_PASSWORD } } @@ -134,14 +133,6 @@ const config: ForgeConfig = { ], }, }), - new ResourcePlugin({ - env: 'ETCHER_UTIL_BIN_PATH', - path: `out/sidecar/bin/etcher-util${process.platform === 'win32' ? '.exe' : ''}`, - build: { - command: 'npm rebuild mountutils && tsc --project tsconfig.sidecar.json && pkg out/sidecar/util/api.js -c pkg-sidecar.json --target node18 --output out/sidecar/bin/etcher-util', - sources: './lib/util/', - }, - }), ], }; diff --git a/package.json b/package.json index 67802ce2527..6160b12002a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "test": "echo npm run test-{linux,windows,macos}", "package": "electron-forge package", "start": "electron-forge start", - "make": "electron-forge make" + "make": "electron-forge make", + "make-debug": "DEBUG='electron-forge:*,electron-packager,electron-rebuild' npm run make", + "make-debug-win": "@powershell -Command $env:DEBUG='electron-forge:*,electron-packager,electron-rebuild,electron-windows-installer:main';npm run make" }, "husky": { "hooks": {