1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove win-ca/pem before publish & catch inject error (#3362)

This commit is contained in:
Sebastian Malton 2021-07-13 11:40:52 -04:00 committed by GitHub
parent ca1ad425ab
commit 9e363b8d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 20 deletions

View File

@ -24,12 +24,12 @@ jobs:
Write-Output ("##vso[task.setvariable variable=CI_BUILD_TAG;]$CI_BUILD_TAG") Write-Output ("##vso[task.setvariable variable=CI_BUILD_TAG;]$CI_BUILD_TAG")
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
displayName: Set the tag name as an environment variable displayName: Set the tag name as an environment variable
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: $(node_version) versionSpec: $(node_version)
displayName: Install Node.js displayName: Install Node.js
- task: Cache@2 - task: Cache@2
inputs: inputs:
key: 'yarn | "$(Agent.OS)"" | yarn.lock' key: 'yarn | "$(Agent.OS)"" | yarn.lock'
@ -37,7 +37,7 @@ jobs:
yarn | "$(Agent.OS)" yarn | "$(Agent.OS)"
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- bash: | - bash: |
set -e set -e
git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay
@ -47,13 +47,13 @@ jobs:
env: env:
GH_TOKEN: $(LENS_IDE_GH_TOKEN) GH_TOKEN: $(LENS_IDE_GH_TOKEN)
displayName: Customize config displayName: Customize config
- script: make node_modules - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- script: make build - script: make build
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env: env:
@ -75,12 +75,12 @@ jobs:
- script: CI_BUILD_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG" - script: CI_BUILD_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG"
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
displayName: Set the tag name as an environment variable displayName: Set the tag name as an environment variable
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: $(node_version) versionSpec: $(node_version)
displayName: Install Node.js displayName: Install Node.js
- task: Cache@2 - task: Cache@2
inputs: inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock' key: 'yarn | "$(Agent.OS)" | yarn.lock'
@ -88,7 +88,7 @@ jobs:
yarn | "$(Agent.OS)" yarn | "$(Agent.OS)"
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- bash: | - bash: |
set -e set -e
git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay
@ -98,13 +98,13 @@ jobs:
env: env:
GH_TOKEN: $(LENS_IDE_GH_TOKEN) GH_TOKEN: $(LENS_IDE_GH_TOKEN)
displayName: Customize config displayName: Customize config
- script: make node_modules - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- script: make build - script: make build
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env: env:
@ -128,12 +128,12 @@ jobs:
- script: CI_BUILD_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG" - script: CI_BUILD_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=CI_BUILD_TAG]$CI_BUILD_TAG"
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
displayName: Set the tag name as an environment variable displayName: Set the tag name as an environment variable
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: $(node_version) versionSpec: $(node_version)
displayName: Install Node.js displayName: Install Node.js
- task: Cache@2 - task: Cache@2
inputs: inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock' key: 'yarn | "$(Agent.OS)" | yarn.lock'
@ -141,7 +141,7 @@ jobs:
yarn | "$(Agent.OS)" yarn | "$(Agent.OS)"
path: $(YARN_CACHE_FOLDER) path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages displayName: Cache Yarn packages
- bash: | - bash: |
set -e set -e
git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay git clone "https://${GH_TOKEN}@github.com/lensapp/lens-ide.git" .lens-ide-overlay
@ -151,13 +151,13 @@ jobs:
env: env:
GH_TOKEN: $(LENS_IDE_GH_TOKEN) GH_TOKEN: $(LENS_IDE_GH_TOKEN)
displayName: Customize config displayName: Customize config
- script: make node_modules - script: make node_modules
displayName: Install dependencies displayName: Install dependencies
- script: make build-npm - script: make build-npm
displayName: Generate npm package displayName: Generate npm package
- bash: | - bash: |
sudo chown root:root / sudo chown root:root /
sudo apt-get update && sudo apt-get install -y snapd sudo apt-get update && sudo apt-get install -y snapd
@ -168,7 +168,7 @@ jobs:
env: env:
SNAP_LOGIN: $(SNAP_LOGIN) SNAP_LOGIN: $(SNAP_LOGIN)
displayName: Setup snapcraft displayName: Setup snapcraft
- script: make build - script: make build
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))" condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env: env:

View File

@ -60,6 +60,8 @@ build: node_modules binaries/client
$(MAKE) build-extensions -B $(MAKE) build-extensions -B
yarn run compile yarn run compile
ifeq "$(DETECTED_OS)" "Windows" ifeq "$(DETECTED_OS)" "Windows"
# https://github.com/ukoloff/win-ca#clear-pem-folder-on-publish
rm -rf node_modules/win-ca/pem
yarn run electron-builder --publish onTag --x64 --ia32 yarn run electron-builder --publish onTag --x64 --ia32
else else
yarn run electron-builder --publish onTag yarn run electron-builder --publish onTag

View File

@ -33,5 +33,9 @@ if (isMac) {
} }
if (isWindows) { if (isWindows) {
winca.inject("+"); // see: https://github.com/ukoloff/win-ca#caveats try {
winca.inject("+"); // see: https://github.com/ukoloff/win-ca#caveats
} catch (error) {
logger.error(`[CA]: failed to force load: ${error}`);
}
} }