From 2f7a3610cb1efa6bca7794d8b265001ea347cccb Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 23 Mar 2022 15:11:30 -0700 Subject: [PATCH 1/4] fix: source lib.sh in docker-buildx-push for tagging version --- ci/steps/docker-buildx-push.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh index ba09cd76a115..ebe86047c0bd 100755 --- a/ci/steps/docker-buildx-push.sh +++ b/ci/steps/docker-buildx-push.sh @@ -3,6 +3,9 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." + # ci/lib.sh sets VERSION so it's available to ci/release-image/docker-bake.hcl + # to push the VERSION tag. + source ./ci/lib.sh # NOTE@jsjoeio - this script assumes that you've downloaded # the release-packages artifact to ./release-packages before From 463ce255198c7b7a39700e099e108d5eb74c901b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 23 Mar 2022 15:27:47 -0700 Subject: [PATCH 2/4] chore: use ubuntu and update git config homebrew job --- .github/workflows/npm-brew.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index 64ff8dee2e27..7ea182d8c0f2 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -45,10 +45,8 @@ jobs: NPM_ENVIRONMENT: "production" homebrew: - # The newest version of code-server needs to be available on npm when this runs - # otherwise, it will 404 and won't open a PR to bump version on homebrew/homebrew-core needs: npm - runs-on: macos-latest + runs-on: ubuntu-latest steps: # Ensure things are up to date # Suggested by homebrew maintainers @@ -60,16 +58,10 @@ jobs: - name: Checkout code-server uses: actions/checkout@v3 - - name: Checkout cdrci/homebrew-core - uses: actions/checkout@v3 - with: - repository: cdrci/homebrew-core - path: homebrew-core - - name: Configure git run: | - git config user.name github-actions - git config user.email github-actions@github.com + git config user.name cdrci + git config user.email opensource@coder.com - name: Bump code-server homebrew version env: From f65d5ad4002840d4d844f522b8145e972db8c102 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 23 Mar 2022 15:28:06 -0700 Subject: [PATCH 3/4] refactor: simplify brew-bump.sh script --- ci/steps/brew-bump.sh | 65 ------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/ci/steps/brew-bump.sh b/ci/steps/brew-bump.sh index 68ae26de2ef7..c1828decdb2d 100755 --- a/ci/steps/brew-bump.sh +++ b/ci/steps/brew-bump.sh @@ -2,9 +2,6 @@ set -euo pipefail main() { - REPO="homebrew-core" - GITHUB_USERNAME="cdrci" - UPSTREAM_USERNAME_AND_REPO="Homebrew/$REPO" # Only sourcing this so we get access to $VERSION source ./ci/lib.sh source ./ci/steps/steps-lib.sh @@ -23,68 +20,6 @@ main() { exit 1 fi - # Make sure the git clone step is successful - if ! directory_exists "$REPO"; then - echo "git clone failed. Cannot find $REPO directory." - ls -la - exit 1 - fi - - echo "Changing into $REPO directory" - pushd "$REPO" && pwd - - echo "Adding $UPSTREAM_USERNAME_AND_REPO" - git remote add upstream "https://github.com/$UPSTREAM_USERNAME_AND_REPO.git" - - # Make sure the git remote step is successful - if ! git config remote.upstream.url > /dev/null; then - echo "git remote add upstream failed." - echo "Could not find upstream in list of remotes." - git remote -v - exit 1 - fi - - # TODO@jsjoeio - can I somehow check that this succeeded? - echo "Fetching upstream $UPSTREAM_USERNAME_AND_REPO commits" - git fetch upstream master - - # TODO@jsjoeio - can I somehow check that this succeeded? - echo "Merging in latest $UPSTREAM_USERNAME_AND_REPO changes branch master" - git merge upstream/master - - # GIT_ASKPASS lets us use the password when pushing without revealing it in the process list - # See: https://serverfault.com/a/912788 - PATH_TO_GIT_ASKPASS="$HOME/git-askpass.sh" - # Source: https://serverfault.com/a/912788 - # shellcheck disable=SC2016,SC2028 - echo 'echo $HOMEBREW_GITHUB_API_TOKEN' > "$PATH_TO_GIT_ASKPASS" - - # Make sure the git-askpass.sh file creation is successful - if ! file_exists "$PATH_TO_GIT_ASKPASS"; then - echo "git-askpass.sh not found in $HOME." - ls -la "$HOME" - exit 1 - fi - - # Ensure it's executable since we just created it - chmod +x "$PATH_TO_GIT_ASKPASS" - - # Make sure the git-askpass.sh file is executable - if ! is_executable "$PATH_TO_GIT_ASKPASS"; then - echo "$PATH_TO_GIT_ASKPASS is not executable." - ls -la "$PATH_TO_GIT_ASKPASS" - exit 1 - fi - - # NOTE: we need to make sure our fork is up-to-date - # otherwise, brew bump-formula-pr will use an - # outdated base - echo "Pushing changes to $GITHUB_USERNAME/$REPO fork on GitHub" - # Export the variables so git sees them - export HOMEBREW_GITHUB_API_TOKEN="$HOMEBREW_GITHUB_API_TOKEN" - export GIT_ASKPASS="$PATH_TO_GIT_ASKPASS" - git push "https://$GITHUB_USERNAME@github.com/$GITHUB_USERNAME/$REPO.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 local output From 3a112f63399540bea35ffc294f6f552f4ca02a5b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 23 Mar 2022 15:37:05 -0700 Subject: [PATCH 4/4] Revert "fix: source lib.sh in docker-buildx-push for tagging version" This reverts commit 2f7a3610cb1efa6bca7794d8b265001ea347cccb. --- ci/steps/docker-buildx-push.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/steps/docker-buildx-push.sh b/ci/steps/docker-buildx-push.sh index ebe86047c0bd..ba09cd76a115 100755 --- a/ci/steps/docker-buildx-push.sh +++ b/ci/steps/docker-buildx-push.sh @@ -3,9 +3,6 @@ set -euo pipefail main() { cd "$(dirname "$0")/../.." - # ci/lib.sh sets VERSION so it's available to ci/release-image/docker-bake.hcl - # to push the VERSION tag. - source ./ci/lib.sh # NOTE@jsjoeio - this script assumes that you've downloaded # the release-packages artifact to ./release-packages before