From 1acd684ab13c6c0dd0c2eedfa06fb589f4fcaed8 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Sat, 16 Nov 2024 23:42:28 -0500 Subject: [PATCH] Delete `script/bottle`. Partial #638 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- .github/workflows/release.yml | 17 ------ Makefile | 4 -- script/bottle | 101 ---------------------------------- 3 files changed, 122 deletions(-) delete mode 100755 script/bottle diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa7cb0f..919bb17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -137,23 +137,6 @@ jobs: --revision "$(git rev-list -n 1 '${{ needs.start.outputs.mas_version }}')" \ mas-cli/tap/mas - - name: 🚰 Update mas tap formula - env: - GH_TOKEN: ${{ github.token }} - DRY_RUN: ${{ needs.start.outputs.dry_run }} - run: | - DRY_RUN="${DRY_RUN}" \ - script/bottle - - - name: 🚀 Upload Bottles - env: - GH_TOKEN: ${{ github.token }} - DRY_RUN: ${{ needs.start.outputs.dry_run }} - if: ${{ needs.start.outputs.dry_run == 'false' }} - run: | - gh release upload '${{ needs.start.outputs.mas_version }}' \ - .build/bottles/mas-*.bottle.tar.gz - homebrew-core: runs-on: macos-15 needs: [start, homebrew-tap] diff --git a/Makefile b/Makefile index 012319d..1cb6ede 100644 --- a/Makefile +++ b/Makefile @@ -153,10 +153,6 @@ package: build ## Packages the project. package-install: package ## Installs the package. script/package_install -.PHONY: bottle -bottle: ## Builds Homebrew bottles. - script/bottle - .PHONY: brew_release_validate brew_release_validate: ## Validates Homebrew mas formula. script/brew_release_validate diff --git a/script/bottle b/script/bottle deleted file mode 100755 index 1c45163..0000000 --- a/script/bottle +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/bash -ex -# -# script/bottle -# mas -# -# Builds bottles of mas Homebrew formula for custom tap: -# https://github.com/mas-cli/homebrew-tap -# -# This script should be run _after_ the formula has been updated in Homebrew -# - -################################################################################ -# -# Variables -# - -mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")" - -if ! cd -- "${mas_dir}"; then - printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2 - exit 1 -fi - -BOTTLE_DIR=".build/bottles" -CORE_TAP_PATH="$(brew --repo homebrew/core)" -version="$(script/version)" -ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${version}" - -# Supports macOS 10.13 and later -OS_NAMES=( - sequoia - arm64_sequoia - sonoma - arm64_sonoma - ventura - arm64_ventura - monterey - arm64_monterey - big_sur - arm64_big_sur - catalina - mojave - high_sierra - sierra - el_capitan -) - -macos_version="$(sw_vers -productVersion)" -case "${macos_version%%.*}" in - 15) - CURRENT_PLATFORM=sequoia - ;; - 14) - CURRENT_PLATFORM=sonoma - ;; - 13) - CURRENT_PLATFORM=ventura - ;; - 12) - CURRENT_PLATFORM=monterey - ;; - 11) - CURRENT_PLATFORM=big_sur - ;; - 10) - CURRENT_PLATFORM=catalina - ;; - *) - echo 'Unsupported macOS version. This script requires Catalina or newer.' >&2 - exit 1 - ;; -esac - -# Prefix platform with architecture -if [[ "$(uname -m)" == 'arm64' ]]; then - CURRENT_PLATFORM="arm64_${CURRENT_PLATFORM}" -fi - -echo "==> 🍼 Bottling mas ${version} on ${CURRENT_PLATFORM} for ${OS_NAMES[*]}" -brew install --build-bottle mas-cli/tap/mas - -# Generate bottle do block, dropping last 2 lines -brew bottle --verbose --no-rebuild --root-url="${ROOT_URL}" mas-cli/tap/mas - -# Output filename from brew bottle -generated_bottle_filename="mas--${version}.${CURRENT_PLATFORM}.bottle.tar.gz" - -if [[ ! -e "${generated_bottle_filename}" ]]; then - echo "Bottle not found: ${generated_bottle_filename}" >&2 - echo 'If an old version is showing in the log and filename, then make sure the formula has been updated in:' >&2 - echo "${CORE_TAP_PATH}" >&2 - exit 1 -fi - -mkdir -p "${BOTTLE_DIR}" - -for os in "${OS_NAMES[@]}"; do - cp -v "${generated_bottle_filename}" "${BOTTLE_DIR}/mas-${version}.${os}.bottle.tar.gz" -done - -rm "${generated_bottle_filename}"