From 05197d5213479c51a9e0fec4681d383cf3288168 Mon Sep 17 00:00:00 2001 From: Akash Satheesan Date: Thu, 3 Jun 2021 22:00:37 +0530 Subject: [PATCH 1/3] feat(ci): add restore-keys for ci speedup (#3516) --- .github/workflows/ci.yaml | 8 ++++++++ ci/build/npm-postinstall.sh | 2 +- ci/lib.sh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2229df08..8fcda93a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,8 @@ jobs: with: path: "**/node_modules" key: yarn-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn-build- - name: Install dependencies if: steps.cache-yarn.outputs.cache-hit != 'true' @@ -78,6 +80,8 @@ jobs: with: path: "**/node_modules" key: yarn-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn-build- - name: Install dependencies if: steps.cache-yarn.outputs.cache-hit != 'true' @@ -107,6 +111,8 @@ jobs: with: path: "**/node_modules" key: yarn-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn-build- - name: Install dependencies if: steps.cache-yarn.outputs.cache-hit != 'true' @@ -347,6 +353,8 @@ jobs: with: path: "**/node_modules" key: yarn-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn-build- - name: Download release packages uses: actions/download-artifact@v2 diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 761e46c1..05c93681 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -75,7 +75,7 @@ main() { # This is a copy of symlink_asar in ../lib.sh. Look there for details. symlink_asar() { - rm -f node_modules.asar + rm -rf node_modules.asar if [ "${WINDIR-}" ]; then mklink /J node_modules.asar node_modules else diff --git a/ci/lib.sh b/ci/lib.sh index 3b78cb6e..7417a484 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -113,7 +113,7 @@ RELEASE_PATH="${RELEASE_PATH-release}" # Code itself but also extensions will look specifically in this directory for # files (like the ripgrep binary or the oniguruma wasm). symlink_asar() { - rm -f node_modules.asar + rm -rf node_modules.asar if [ "${WINDIR-}" ]; then # mklink takes the link name first. mklink /J node_modules.asar node_modules From 808daa44e1cf9b254173deffc7fc86431d1a723a Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 24 May 2021 16:47:55 -0700 Subject: [PATCH 2/3] fix: update git push to cdrci repo in brew-bump --- CHANGELOG.md | 4 ++++ ci/steps/brew-bump.sh | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8939af..62d307a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,10 @@ VS Code v0.00.0 - chore: cross-compile docker images with buildx #3166 @oxy - chore: update node to v14 #3458 @oxy +### Development + +- fix(publish): update cdrci fork in brew-bump.sh #3468 @jsjoeio + ## 3.10.2 VS Code v1.56.1 diff --git a/ci/steps/brew-bump.sh b/ci/steps/brew-bump.sh index 4e450025..e16ab559 100755 --- a/ci/steps/brew-bump.sh +++ b/ci/steps/brew-bump.sh @@ -26,7 +26,10 @@ main() { git merge upstream/master echo "Pushing changes to cdrci/homebrew-core fork on GitHub" - git push origin master + # Source: https://serverfault.com/a/912788 + # shellcheck disable=SC2016,SC2028 + echo '#!/bin/sh\nexec echo "$HOMEBREW_GITHUB_API_TOKEN"' >"$HOME"/.git-askpass.sh + GIT_ASKPASS="$HOME/.git-askpass.sh" git push https://cdrci@github.com/cdrci/homebrew-core.git --all # Find the docs for bump-formula-pr here # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18 From 8b383149138c081c7d36264b2554f1ad509a7a47 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Tue, 25 May 2021 14:18:04 -0700 Subject: [PATCH 3/3] feat: add 'set up homebrew' step publish.yaml --- .github/workflows/publish.yaml | 7 +++++++ ci/steps/brew-bump.sh | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 361c47ae..c56b41ac 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -42,6 +42,13 @@ jobs: needs: npm runs-on: macos-latest steps: + # Ensure things are up to date + # Suggested by homebrew maintainers + # https://github.com/Homebrew/discussions/discussions/1532#discussioncomment-782633 + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + - uses: actions/checkout@v2 - name: Configure git run: | diff --git a/ci/steps/brew-bump.sh b/ci/steps/brew-bump.sh index e16ab559..ec0704cd 100755 --- a/ci/steps/brew-bump.sh +++ b/ci/steps/brew-bump.sh @@ -29,7 +29,11 @@ main() { # Source: https://serverfault.com/a/912788 # shellcheck disable=SC2016,SC2028 echo '#!/bin/sh\nexec echo "$HOMEBREW_GITHUB_API_TOKEN"' >"$HOME"/.git-askpass.sh - GIT_ASKPASS="$HOME/.git-askpass.sh" git push https://cdrci@github.com/cdrci/homebrew-core.git --all + # Ensure it's executable since we just created it + chmod +x "$HOME/.git-askpass.sh" + # GIT_ASKPASS lets us use the password when pushing without revealing it in the process list + # See: https://serverfault.com/a/912788 + GIT_ASKPASS="$HOME/.git-askpass.sh" git push https://cdr-oss@github.com/cdr-oss/homebrew-core.git --all # Find the docs for bump-formula-pr here # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18