From d2ae146e07f3bd9599b91dd048cbb9d5ac79339b Mon Sep 17 00:00:00 2001 From: Pawel Lipski Date: Tue, 21 May 2024 19:58:39 +0200 Subject: [PATCH] Stop bumping Homebrew formula --- .circleci/config.yml | 27 ----------- PACKAGES.md | 25 +++++----- ci/homebrew/ci-deploy.sh | 84 ---------------------------------- ci/pypi/ci-wait-for-package.sh | 21 --------- 4 files changed, 14 insertions(+), 143 deletions(-) delete mode 100644 ci/homebrew/ci-deploy.sh delete mode 100644 ci/pypi/ci-wait-for-package.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 96839ca41..10b9ec436 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -224,15 +224,6 @@ jobs: # Side effects: does an actual release, but to the test PyPI command: bash ci/pypi/ci-deploy.sh --dry-run - - run: - name: 'Wait up to 10 minutes for Test PyPI package to be available' - command: bash ci/pypi/ci-wait-for-package.sh test.pypi.org 10 - - - run: - name: '[Dry run] Update Homebrew with local installation test' - # Prerequisites: artifacts must be released to test PyPI first - command: bash ci/homebrew/ci-deploy.sh --dry-run - - run: name: '[Dry run] Publish image to Docker Hub' command: bash ci/docker/ci-deploy.sh --dry-run @@ -266,19 +257,6 @@ jobs: name: 'Deploy to PyPI' command: bash ci/pypi/ci-deploy.sh - "update homebrew formula": - executor: ubuntu_executor - steps: - - checkout - - run: - # See https://github.com/Homebrew/homebrew-core/pull/119200/commits/a4902911fadbdcf2c6b64ce691024ff97a516f1c - # for a case where the package wasn't available right after the upload and Homebrew Core build failed. - name: 'Wait up to 10 minutes for PyPI package to be available' - command: bash ci/pypi/ci-wait-for-package.sh pypi.org 10 - - run: - name: 'Update Homebrew formula' - command: bash ci/homebrew/ci-deploy.sh - "publish image to docker hub": executor: ubuntu_executor steps: @@ -375,10 +353,6 @@ workflows: <<: *only_master requires: - dry run deploy - - update homebrew formula: - <<: *only_master - requires: - - deploy to pypi - publish image to docker hub: <<: *only_master requires: @@ -397,7 +371,6 @@ workflows: <<: *only_master requires: - deploy to pypi - - update homebrew formula - publish image to docker hub - build and upload deb package to ppa - publish snap to the stable channel diff --git a/PACKAGES.md b/PACKAGES.md index d3273637b..e30198204 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -11,14 +11,14 @@ the **edge-most** channel that corresponds to the **released** versions of git-m | Conda Forge | ![Conda package](https://img.shields.io/conda/vn/conda-forge/git-machete.svg?label=) | [**Conda package**](https://anaconda.org/conda-forge/git-machete) | [Recipe](https://github.com/conda-forge/git-machete-feedstock/blob/main/recipe/meta.yaml) (points to PyPI) | [PRs](https://github.com/conda-forge/git-machete-feedstock/pulls?q=is%3Apr) | Feedstock maintainers, incl. [@asford (Alex Ford)](https://github.com/asford) and ourselves | Feedstock GitHub bot | - | ![Conda downloads](https://img.shields.io/conda/dn/conda-forge/git-machete.svg) | | Gentoo | ![Gentoo package](https://repology.org/badge/version-for-repo/gentoo/git-machete.svg?header=) | [**Gentoo package**](https://packages.gentoo.org/packages/dev-vcs/git-machete) | [ebuild](https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-vcs/git-machete) (points to GitHub) | | Gentoo package maintainers | Gentoo package maintainers | bash, fish, zsh | | | GitHub Releases (rpm) | ![GitHub latest release](https://img.shields.io/github/v/release/VirtusLab/git-machete?label=) | [**GitHub releases**](https://github.com/VirtusLab/git-machete/releases) | | | Ourselves | Our CI on `master` builds | - | ![GitHub releases total downloads](https://img.shields.io/github/downloads/VirtusLab/git-machete/total)[^2] | -| Homebrew | ![homebrew formula](https://img.shields.io/homebrew/v/git-machete.svg?label=) | [**Formula**](https://formulae.brew.sh/formula/git-machete) | [Formula source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/git-machete.rb) (points to PyPI) | [PRs](https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+git-machete) | Homebrew maintainers | Our CI on `master` builds (opens formula-bump PR), then homebrew-core GitHub Actions | bash, fish, zsh + man page | ![homebrew formula monthly downloads](https://img.shields.io/homebrew/installs/dm/git-machete.svg)
![homebrew formula quarterly downloads](https://img.shields.io/homebrew/installs/dq/git-machete.svg)
![homebrew formula yearly downloads](https://img.shields.io/homebrew/installs/dy/git-machete.svg) | +| Homebrew | ![homebrew formula](https://img.shields.io/homebrew/v/git-machete.svg?label=) | [**Formula**](https://formulae.brew.sh/formula/git-machete) | [Formula source](https://github.com/Homebrew/homebrew-core/blob/master/Formula/g/git-machete.rb) (points to PyPI) | [PRs](https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+git-machete) | Homebrew maintainers | [BrewTestBot](https://github.com/BrewTestBot) [^3] | bash, fish, zsh + man page | ![homebrew formula monthly downloads](https://img.shields.io/homebrew/installs/dm/git-machete.svg)
![homebrew formula quarterly downloads](https://img.shields.io/homebrew/installs/dq/git-machete.svg)
![homebrew formula yearly downloads](https://img.shields.io/homebrew/installs/dy/git-machete.svg) | | [LiGurOS (Gentoo fork)](https://liguros.gitlab.io/) | ![LiGurOS develop package](https://repology.org/badge/version-for-repo/liguros_develop/git-machete.svg?header=) | | [ebuild](https://gitlab.com/liguros/liguros-repo/-/tree/develop/dev-vcs/git-machete) (points to GitHub) | | LiGurOS package maintainers | LiGurOS package maintainers | bash, fish, zsh | | -| nixpkgs | ![nixpkgs unstable package](https://repology.org/badge/version-for-repo/nix_unstable/git-machete.svg?header=) | [**nixpkgs unstable package**](https://search.nixos.org/packages?channel=unstable&show=git-machete&query=git-machete) | [Expression](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/git-machete/default.nix) (points to GitHub) | [PRs](https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+git-machete) | nixpkgs maintainers, incl. [@blitz (Julian Stecklina)](https://github.com/blitz) | [@r-ryantm bot](https://github.com/r-ryantm) ([logs](https://r.ryantm.com/log/git-machete/))[^3] | bash, fish, zsh | | -| PyPI | ![PyPI package](https://img.shields.io/pypi/v/git-machete.svg?label=) | [**PyPI package**](https://pypi.org/project/git-machete)
[Test PyPI package](https://test.pypi.org/project/git-machete) | | | Ourselves | Our CI on `master` builds[^4] | - | ![PyPI daily downloads](https://img.shields.io/pypi/dd/git-machete.svg)
![PyPI weekly downloads](https://img.shields.io/pypi/dw/git-machete.svg)
![PyPI monthly downloads](https://img.shields.io/pypi/dm/git-machete.svg)
![PyPI wheel?](https://img.shields.io/pypi/wheel/git-machete.svg) | -| PPA (Ubuntu) | [^5] | [**PPA packages**](https://launchpad.net/~virtuslab/+archive/ubuntu/git-machete/+packages) | [debian/ folder (in this repo)](debian) | | Ourselves | Our CI on `master` builds (uploads source package), then Launchpad build system (see [builds](https://launchpad.net/~virtuslab/+archive/ubuntu/git-machete/+builds?&build_state=all)) | - | | -| Read the Docs | N/A | [**Read the Docs (stable)**](https://git-machete.readthedocs.io/en/stable)
[Read the Docs (latest)](https://git-machete.readthedocs.io/en/latest)
[Admin page](https://readthedocs.org/projects/git-machete/) | | | Ourselves | Read the Docs itself (see [builds](https://readthedocs.org/projects/git-machete/builds)), triggered by GitHub webhook [^6] | N/A | ![Read the Docs build status](https://readthedocs.org/projects/git-machete/badge/?version=stable) | +| nixpkgs | ![nixpkgs unstable package](https://repology.org/badge/version-for-repo/nix_unstable/git-machete.svg?header=) | [**nixpkgs unstable package**](https://search.nixos.org/packages?channel=unstable&show=git-machete&query=git-machete) | [Expression](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/git-machete/default.nix) (points to GitHub) | [PRs](https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+git-machete) | nixpkgs maintainers, incl. [@blitz (Julian Stecklina)](https://github.com/blitz) | [@r-ryantm bot](https://github.com/r-ryantm) ([logs](https://r.ryantm.com/log/git-machete/))[^4] | bash, fish, zsh | | +| PyPI | ![PyPI package](https://img.shields.io/pypi/v/git-machete.svg?label=) | [**PyPI package**](https://pypi.org/project/git-machete)
[Test PyPI package](https://test.pypi.org/project/git-machete) | | | Ourselves | Our CI on `master` builds[^5] | - | ![PyPI daily downloads](https://img.shields.io/pypi/dd/git-machete.svg)
![PyPI weekly downloads](https://img.shields.io/pypi/dw/git-machete.svg)
![PyPI monthly downloads](https://img.shields.io/pypi/dm/git-machete.svg)
![PyPI wheel?](https://img.shields.io/pypi/wheel/git-machete.svg) | +| PPA (Ubuntu) | [^6] | [**PPA packages**](https://launchpad.net/~virtuslab/+archive/ubuntu/git-machete/+packages) | [debian/ folder (in this repo)](debian) | | Ourselves | Our CI on `master` builds (uploads source package), then Launchpad build system (see [builds](https://launchpad.net/~virtuslab/+archive/ubuntu/git-machete/+builds?&build_state=all)) | - | | +| Read the Docs | N/A | [**Read the Docs (stable)**](https://git-machete.readthedocs.io/en/stable)
[Read the Docs (latest)](https://git-machete.readthedocs.io/en/latest)
[Admin page](https://readthedocs.org/projects/git-machete/) | | | Ourselves | Read the Docs itself (see [builds](https://readthedocs.org/projects/git-machete/builds)), triggered by GitHub webhook [^7] | N/A | ![Read the Docs build status](https://readthedocs.org/projects/git-machete/badge/?version=stable) | | Scoop (Windows) | ![Scoop](https://img.shields.io/scoop/v/git-machete?label=) | [**Scoop package**](https://scoop.sh/#/apps?q=git-machete) | [Manifest](https://github.com/ScoopInstaller/Main/blob/master/bucket/git-machete.json) (points to PyPI, auto-updates based on GitHub) | [PRs](https://github.com/ScoopInstaller/Main/pulls?q=is%3Apr+git-machete) | Scoop maintainers | Scoop itself (thanks to `autoupdate` attribute in manifest) | - | | -| Snap | ![Snap](https://img.shields.io/snapcraft/v/git-machete/latest/stable?label=) | [**Snap package**](https://snapcraft.io/git-machete) | [snapcraft.yaml (in this repo)](snap/snapcraft.yaml) | | Ourselves | Our CI on `master` builds[^7] | - | | +| Snap | ![Snap](https://img.shields.io/snapcraft/v/git-machete/latest/stable?label=) | [**Snap package**](https://snapcraft.io/git-machete) | [snapcraft.yaml (in this repo)](snap/snapcraft.yaml) | | Ourselves | Our CI on `master` builds[^8] | - | | | [T2 SDE](https://t2sde.org/) | ![T2 SDE package](https://repology.org/badge/version-for-repo/t2/git-machete.svg?header=) | [**T2 SDE package**](https://t2sde.org/packages/git-machete) | [Package definition](http://svn.exactcode.de/t2/trunk/package/contrib/git-machete/) (points to GitHub) | | T2 SDE package maintainers | T2 SDE package maintainers | - | | [^0]: Completions are available under all package managers via `git machete completion `. @@ -28,17 +28,20 @@ the **edge-most** channel that corresponds to the **released** versions of git-m [^2]: GitHub downloads most likely correspond to the RPM packages attached to the releases. -[^3]: nixpkgs releases used to be done by our CI until @blitz's [PR #131141 to NixOS/nixpkgs](https://github.com/NixOS/nixpkgs/pull/131141) which set up the bot. +[^3]: Homebrew updates used to be done by our CI until git-machete has been added to [`.github/autobump.txt` in `Homebrew/homebrew-core`](https://github.com/Homebrew/homebrew-core/blob/master/.github/autobump.txt) + on [PR #171225 to Homebrew/homebrew-core](https://github.com/Homebrew/homebrew-core/pull/171225/files#diff-895127b46978b016c724afe1fe53341d3d25253eead3b82d796b9bd72aa0c9a9R840). -[^4]: CI builds of `develop` publish the package to Test PyPI. +[^4]: nixpkgs releases used to be done by our CI until @blitz's [PR #131141 to NixOS/nixpkgs](https://github.com/NixOS/nixpkgs/pull/131141) which set up the bot. + +[^5]: CI builds of `develop` publish the package to Test PyPI. CI builds of `master` publish the package to main (production) PyPI. -[^5]: There are no badges available for PPA packages; see [badges/shields#560](https://github.com/badges/shields/issues/560). +[^6]: There are no badges available for PPA packages; see [badges/shields#560](https://github.com/badges/shields/issues/560). -[^6]: Read the Docs builds of `develop` are published as [latest](https://git-machete.readthedocs.io/en/latest). +[^7]: Read the Docs builds of `develop` are published as [latest](https://git-machete.readthedocs.io/en/latest). Read the Docs builds of `master` are published as [stable](https://git-machete.readthedocs.io/en/stable). -[^7]: Releases used to be done by Snap Store itself, triggered by webhook. [We moved that process to CI](https://github.com/VirtusLab/git-machete/issues/436) to skip a manual promotion step. +[^8]: Releases used to be done by Snap Store itself, triggered by webhook. [We moved that process to CI](https://github.com/VirtusLab/git-machete/issues/436) to skip a manual promotion step. ## [Repology](https://repology.org/project/git-machete/versions) diff --git a/ci/homebrew/ci-deploy.sh b/ci/homebrew/ci-deploy.sh deleted file mode 100644 index bec4cd549..000000000 --- a/ci/homebrew/ci-deploy.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -set -e -o pipefail -u -x - -HOMEBREW_VERSION=4.2.11 - -export HOMEBREW_NO_AUTO_UPDATE=1 - -NONINTERACTIVE=1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -# https://stackoverflow.com/questions/54912857/how-do-i-install-old-version-of-homebrew-itself-not-the-formula -(cd /home/linuxbrew/.linuxbrew/Homebrew; git checkout $HOMEBREW_VERSION) -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" -brew --version - -version=$(cut -d\' -f2 git_machete/__init__.py) - -if [[ ${1-} == "--dry-run" || ${CIRCLE_BRANCH-} != "master" ]]; then - do_push=false - pypi_host=test.pypi.org -else - do_push=true - pypi_host=pypi.org -fi - -pypi_metadata_json=$(curl -s "https://$pypi_host/pypi/git-machete/$version/json" | jq '.urls | map(select(.packagetype == "sdist")) | .[0]') -url=$(echo "$pypi_metadata_json" | jq --raw-output .url) -sha256=$(echo "$pypi_metadata_json" | jq --raw-output .digests.sha256) - -# We need to run `brew tap homebrew/core` manually because: -# 1. the formula files need to be present at .../.linuxbrew/Homebrew/Library/Taps/... - -# otherwise, `brew bump-formula-pr` will fail due to missing formula AND -# 2. since Homebrew 4.0.0 it is no longer done by default when installing `brew`; see https://brew.sh/2023/02/16/homebrew-4.0.0/ -# Also, we can't use `--shallow` here (even though it'd save us ~3 minutes), this option is no longer supported (see https://stackoverflow.com/a/65243764). -brew tap --force homebrew/core -brew developer on -brew config - -echo "Bump Homebrew formula" -flags=(--no-browse --verbose --url "$url" --sha256 "$sha256") -if [[ $do_push == true ]]; then - # Relying on HOMEBREW_GITHUB_API_TOKEN, provided by the CI - # See https://docs.brew.sh/Manpage -> Ctrl+F HOMEBREW_GITHUB_API_TOKEN - - git config --global user.email "gitmachete@virtuslab.com" - git config --global user.name "Git Machete Bot" - - # `--force` ignores the existence of open PRs for the same formula. - # It is useful for the rare cases where a develop/master build runs while a PR for the previously released version is still pending. - # See https://app.circleci.com/pipelines/github/VirtusLab/git-machete/3140/workflows/6ee0916d-fc11-49b2-b29a-5bbc95cb25c4/jobs/16418: - # Error: These open pull requests may be duplicates: - # git-machete 3.15.1 https://github.com/Homebrew/homebrew-core/pull/123123 - # Duplicate PRs should not be opened. Use --force to override this error. - brew bump-formula-pr --force "${flags[@]}" git-machete -else - echo "Refraining from push since it's a dry run" - - # homebrew-core has been fetched by `brew tap` above - tap_repo=/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core - formula_file=$tap_repo/Formula/g/git-machete.rb - - # Workaround for https://github.com/orgs/Homebrew/discussions/5193 - sed -i 's/files.pythonhosted.org/test-files.pythonhosted.org/' $formula_file - - brew bump-formula-pr --write-only "${flags[@]}" git-machete - - (cd $tap_repo; GIT_PAGER="cat" git diff) - brew install --build-from-source --formula $formula_file - - if [[ "$version" != "$(git machete version | cut -d' ' -f3)" ]]; then - echo "Something went wrong during brew installation: installed version does not match version from formula." - echo "Formula version: $version, installed version: $(git machete version | cut -d' ' -f3)" - exit 1 - fi - if ! git machete --help | grep 'GIT-MACHETE(1)'; then - echo "man page has not been installed, aborting" - exit 1 - fi - if ! git machete completion bash | grep '#!.*bash'; then - echo "shell completion is not available in runtime, aborting" - exit 1 - fi - - brew remove git-machete -fi diff --git a/ci/pypi/ci-wait-for-package.sh b/ci/pypi/ci-wait-for-package.sh deleted file mode 100644 index c53d47d0a..000000000 --- a/ci/pypi/ci-wait-for-package.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e -o pipefail -u - -host=$1 -timeout_minutes=${2-10} -version=$(cut -d\' -f2 git_machete/__init__.py) -url=https://$host/pypi/git-machete/$version/json - -# Typically just 2 minutes of waiting are enough. -for i in $(seq 1 "$timeout_minutes"); do - echo "Checking package availability at $url, attempt #$i out of $timeout_minutes..." - if curl --fail --location --silent --show-error "$url"; then - echo "Package metadata available at $url" - exit 0 - fi - sleep 60 -done - -echo "Package still not published after $timeout_minutes minutes" -exit 1