build: delete unneeded files when running a release (#21216)

* build: delete unneeded files when running a release

Needed to free up disk space on MacOS.

* Delete all the .git directories

* Update comment

* Run gn gen after deleting .git dirs
This commit is contained in:
John Kleinschmidt 2019-11-20 10:42:38 -05:00 committed by GitHub
parent af3bee742f
commit 4bc85f777f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,10 +256,11 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
step-delete-git-directories: &step-delete-git-directories step-delete-git-directories: &step-delete-git-directories
run: run:
name: Delete src/.git directory on MacOS to free space name: Delete all .git directories under src on MacOS to free space
command: | command: |
if [ "`uname`" == "Darwin" ]; then if [ "`uname`" == "Darwin" ]; then
sudo rm -rf src/.git cd src
( find . -type d -name ".git" ) | xargs rm -rf
fi fi
# On macOS the yarn install command during gclient sync was run on a linux # On macOS the yarn install command during gclient sync was run on a linux
@ -907,8 +908,8 @@ steps-electron-build: &steps-electron-build
- *step-get-more-space-on-mac - *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac - *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac - *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories - *step-delete-git-directories
- *step-gn-gen-default
# Electron app # Electron app
- *step-electron-build - *step-electron-build
@ -989,8 +990,8 @@ steps-electron-build-with-inline-checkout-for-tests: &steps-electron-build-with-
- *step-get-more-space-on-mac - *step-get-more-space-on-mac
- *step-install-npm-deps-on-mac - *step-install-npm-deps-on-mac
- *step-fix-sync-on-mac - *step-fix-sync-on-mac
- *step-gn-gen-default
- *step-delete-git-directories - *step-delete-git-directories
- *step-gn-gen-default
# Electron app # Electron app
- *step-electron-build - *step-electron-build
@ -1085,8 +1086,9 @@ steps-electron-build-for-publish: &steps-electron-build-for-publish
- *step-get-more-space-on-mac - *step-get-more-space-on-mac
- *step-gclient-sync - *step-gclient-sync
- *step-setup-env-for-build - *step-setup-env-for-build
- *step-gn-gen-default
- *step-delete-git-directories - *step-delete-git-directories
- *step-minimize-workspace-size-from-checkout
- *step-gn-gen-default
# Electron app # Electron app
- *step-electron-build - *step-electron-build