Skip to content

Commit

Permalink
fix(electron): fix corrupt zip file on mac (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwambach committed Jul 22, 2020
1 parent 7041896 commit 6f41958
Show file tree
Hide file tree
Showing 3 changed files with 549 additions and 218 deletions.
22 changes: 17 additions & 5 deletions ci/cloudbuild-electron-builder.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
steps:
- name: 'gcr.io/cloud-builders/npm'
- name: gcr.io/cloud-builders/npm
entrypoint: npm
args: ['ci']

- name: 'stedolan/jq'
- name: stedolan/jq
entrypoint: 'bash'
args: ['-c', 'jq -r <package.json ".version" > version.txt']

- name: 'gcr.io/esa-climate-from-space/electron-builder'
- name: gcr.io/esa-climate-from-space/electron-builder
entrypoint: 'npm'
args: ['run', 'electron:prepare-build']

- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:alpine'
- name: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
entrypoint: 'bash'
args: ['-c', 'gsutil -m cp -r gs://esa-cfs-tiles/$(cat version.txt)/basemaps ./dist']

- name: 'gcr.io/esa-climate-from-space/electron-builder'
- name: gcr.io/esa-climate-from-space/electron-builder
env:
- 'ELECTRON_CACHE=/root/.cache/electron'
- 'ELECTRON_BUILDER_CACHE=/root/.cache/electron-builder'
entrypoint: 'npm'
args: ['run', 'electron:build']

# fix bug in electron mac zip by re-zipping the app again
- name: gcr.io/esa-climate-from-space/zip
entrypoint: 'bash'
args:
- '-c'
- |
VERSION=$$(cat version.txt)
rm -r /workspace/dist-electron/esa-climate-from-space-*-mac.zip
cd /workspace/dist-electron/mac
zip -r /workspace/dist-electron/esa-climate-from-space-$$VERSION-mac.zip ./esa-climate-from-space.app
artifacts:
objects:
location: 'gs://esa-cfs-versions/electron/${BRANCH_NAME}'
Expand Down
Loading

0 comments on commit 6f41958

Please sign in to comment.