From 436c3a250dfcc40e49ead47fbeac7726b894630d Mon Sep 17 00:00:00 2001 From: Chris Araman Date: Wed, 12 May 2021 17:15:29 -0700 Subject: [PATCH 001/162] =?UTF-8?q?=F0=9F=94=8D=20Search=20for=20compatibl?= =?UTF-8?q?e=20iPad=20and=20iPhone=20apps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/MasKit/Controllers/MasStoreSearch.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/MasKit/Controllers/MasStoreSearch.swift b/Sources/MasKit/Controllers/MasStoreSearch.swift index f5a32e4..b9c5ca7 100644 --- a/Sources/MasKit/Controllers/MasStoreSearch.swift +++ b/Sources/MasKit/Controllers/MasStoreSearch.swift @@ -72,6 +72,8 @@ class MasStoreSearch: StoreSearch { loadSearchResults(url) }.then { results -> Guarantee in guard let result = results.first else { + return try JSONDecoder().decode(SearchResultList.self, from: data).results + } catch { return .value(nil) } From ef28bc9f1a112646bddd07231b23e74f193d1489 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 13:45:09 -0700 Subject: [PATCH 002/162] =?UTF-8?q?=F0=9F=8D=BA=20Update=20mas=20homebrew?= =?UTF-8?q?=20formula=20(1.8.6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Homebrew/mas.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Homebrew/mas.rb b/Homebrew/mas.rb index 7836b2c..0267365 100644 --- a/Homebrew/mas.rb +++ b/Homebrew/mas.rb @@ -2,23 +2,28 @@ class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" url "https://github.com/mas-cli/mas.git", - tag: "v1.8.5", - revision: "9da3c3a1f72271e022f02897ed587f2ce1fcddf3" + tag: "v1.8.6", + revision: "560c89af2c1fdf0da9982a085e19bb6f5f9ad2d0" license "MIT" head "https://github.com/mas-cli/mas.git", branch: "main" bottle do - sha256 cellar: :any_skip_relocation, arm64_monterey: "433b94f32da9835c0800975a5f8db08c823c4b8c35077db7e2a9763d700f0fbe" - sha256 cellar: :any_skip_relocation, arm64_big_sur: "446af97db6bcb0f44d61e7486d7c74d14325002ff9918dba7a7db3045bf8b07c" - sha256 cellar: :any_skip_relocation, monterey: "62f08836f3ff705e8b7dd858a5225a0b0bceb39d6bb2340ee469e68ead73a90b" - sha256 cellar: :any_skip_relocation, big_sur: "18fd65b45ff112ca5c80a31202688617a22dec56b28bbb93cf4bdb6ed2d73d56" - sha256 cellar: :any_skip_relocation, catalina: "29d2d552d09ef893c3560d94a01c2985bb53b2e9499400987ad76c9b50b9f0f9" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "7b11bfefcb43e9a423ff301f7bbc29b0fb86044bf93442f243c5a8a67d8d4869" + sha256 cellar: :any_skip_relocation, arm64_ventura: "e49511dd1283813c4420aec9fc3b3167d18f9fdbb51d82b1e479b628d5312342" + sha256 cellar: :any_skip_relocation, arm64_monterey: "379d46e2657be295321f1603dc1df28130ea0b5b264ceb192a9ba488d77c7a98" + sha256 cellar: :any_skip_relocation, arm64_big_sur: "918a1484de106940f7bebc936e1ded87d7b65652054b09204887ad0651937ec4" + sha256 cellar: :any_skip_relocation, sonoma: "24e3057991ea1eed52eb4a27c0f17d794106770621e5a8bb975477dae135b82d" + sha256 cellar: :any_skip_relocation, ventura: "6ef7788e28c46cdc0f916812f49dfeb1fabf2240a8c36f33ce34bcfb9df1502f" + sha256 cellar: :any_skip_relocation, monterey: "6b313f2f66d028cb7782c108d6e502ce73ccb9c08fac3bece0b057fcce5c4689" + sha256 cellar: :any_skip_relocation, big_sur: "50b50f51219143fcb69c730b52b74011a76104f66348ea727d0200f7b375ae25" + sha256 cellar: :any_skip_relocation, catalina: "d241d3b9156b033f3d2c31684a44de726297e07fd9bd5e3ccc4c36e4f1c3baf3" end depends_on :macos - if Hardware::CPU.arm? + on_arm do depends_on xcode: ["12.2", :build] - else + end + on_intel do depends_on xcode: ["12.0", :build] end From f1276dabc61681ba0d6475ddd7bd89f5e3afc54d Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 13:56:42 -0700 Subject: [PATCH 003/162] =?UTF-8?q?=F0=9F=8D=BA=20Update=20mas-tap=20homeb?= =?UTF-8?q?rew=20formula=20(1.8.6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds sonoma and ventura --- Homebrew/mas-tap.rb | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/Homebrew/mas-tap.rb b/Homebrew/mas-tap.rb index 664ca9d..74cfab8 100644 --- a/Homebrew/mas-tap.rb +++ b/Homebrew/mas-tap.rb @@ -2,34 +2,40 @@ class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" url "https://github.com/mas-cli/mas.git", - tag: "v1.8.5", - revision: "9da3c3a1f72271e022f02897ed587f2ce1fcddf3" + tag: "v1.8.6", + revision: "560c89af2c1fdf0da9982a085e19bb6f5f9ad2d0" license "MIT" head "https://github.com/mas-cli/mas.git", branch: "main" bottle do - root_url "https://github.com/mas-cli/mas/releases/download/v1.8.5" - sha256 cellar: :any_skip_relocation, arm64_monterey: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, arm64_big_sur: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, monterey: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, big_sur: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, catalina: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, mojave: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, high_sierra: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, sierra: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" - sha256 cellar: :any_skip_relocation, el_capitan: "2bf14f3f6cd15b18fe3c96585ceea2d2e538bf1c0c384aba4cd0ac78c19ea287" + root_url "https://github.com/mas-cli/mas/releases/download/v1.8.6" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, arm64_ventura: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, arm64_monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, arm64_big_sur: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, sonoma: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, ventura: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, big_sur: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, catalina: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, mojave: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, high_sierra: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, sierra: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" + sha256 cellar: :any_skip_relocation, el_capitan: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" end depends_on :macos - if Hardware::CPU.arm? + on_arm do depends_on xcode: ["12.2", :build] - else + end + on_intel do depends_on xcode: ["12.0", :build] end def install - system "script/build", "--universal" - system "script/install", "--universal", prefix + system "script/build" + system "script/install", prefix bash_completion.install "contrib/completion/mas-completion.bash" => "mas" fish_completion.install "contrib/completion/mas.fish" From 742e054cc9d99ebdf5d130b6714ea45dc951af32 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 14:09:33 -0700 Subject: [PATCH 004/162] =?UTF-8?q?=F0=9F=94=A8=20Add=20support=20for=20so?= =?UTF-8?q?noma=20&=20ventura=20to=20bottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/script/bottle b/script/bottle index a54733a..9515f9e 100755 --- a/script/bottle +++ b/script/bottle @@ -28,24 +28,31 @@ CURRENT_OS_VERSION_MINOR=${CURRENT_OS_VERSION[1]} echo "CURRENT_OS_VERSION_MAJOR: $CURRENT_OS_VERSION_MAJOR" echo "CURRENT_OS_VERSION_MINOR: $CURRENT_OS_VERSION_MINOR" -if [[ ${CURRENT_OS_VERSION_MAJOR} == "12" ]]; then - if [[ "x86_64" == "$(uname -m)" ]]; then - CURRENT_PLATFORM=monterey - else - CURRENT_PLATFORM=arm64_monterey - fi -elif [[ ${CURRENT_OS_VERSION_MAJOR} == "11" ]]; then - # Big Sur - if [[ "x86_64" == "$(uname -m)" ]]; then - CURRENT_PLATFORM=big_sur - else - CURRENT_PLATFORM=arm64_big_sur - fi -elif [[ ${CURRENT_OS_VERSION_MAJOR} == "10" && ${CURRENT_OS_VERSION_MINOR} == "15" ]]; then +case "${CURRENT_OS_VERSION_MAJOR}" in +14) + CURRENT_PLATFORM=monterey + ;; +13) + CURRENT_PLATFORM=ventura + ;; +12) + CURRENT_PLATFORM=monterey + ;; +11) + CURRENT_PLATFORM=big_sur + ;; +11) CURRENT_PLATFORM=catalina -else + ;; +*) echo "Unsupported macOS version. This script requires Catalina or better." exit 1 + ;; +esac + +# Prefix platform with architecture +if [[ "arm64" == "$(uname -m)" ]]; then + CURRENT_PLATFORM="arm64_${CURRENT_PLATFORM}" fi echo "CURRENT_PLATFORM: ${CURRENT_PLATFORM}" From f3e681a7e2d265d22e5029c06f440fe57b73a2f7 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 14:19:39 -0700 Subject: [PATCH 005/162] =?UTF-8?q?=F0=9F=94=96=20Version=201.8.7-alpha.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.8.7-beta.1 --- Homebrew/mas-tap.rb | 6 +++--- Homebrew/mas.rb | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Homebrew/mas-tap.rb b/Homebrew/mas-tap.rb index 74cfab8..bba7dd8 100644 --- a/Homebrew/mas-tap.rb +++ b/Homebrew/mas-tap.rb @@ -2,13 +2,13 @@ class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" url "https://github.com/mas-cli/mas.git", - tag: "v1.8.6", - revision: "560c89af2c1fdf0da9982a085e19bb6f5f9ad2d0" + tag: "v1.8.7-beta.1", + revision: "f8be3e9aaa6c78490277976f17041f2577f5dc21" license "MIT" head "https://github.com/mas-cli/mas.git", branch: "main" bottle do - root_url "https://github.com/mas-cli/mas/releases/download/v1.8.6" + root_url "https://github.com/mas-cli/mas/releases/download/v1.8.7-beta.1" sha256 cellar: :any_skip_relocation, arm64_sonoma: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, arm64_ventura: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, arm64_monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" diff --git a/Homebrew/mas.rb b/Homebrew/mas.rb index 0267365..1bda0d5 100644 --- a/Homebrew/mas.rb +++ b/Homebrew/mas.rb @@ -2,8 +2,8 @@ class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" url "https://github.com/mas-cli/mas.git", - tag: "v1.8.6", - revision: "560c89af2c1fdf0da9982a085e19bb6f5f9ad2d0" + tag: "v1.8.7-beta.1", + revision: "f8be3e9aaa6c78490277976f17041f2577f5dc21" license "MIT" head "https://github.com/mas-cli/mas.git", branch: "main" From 8076c660f1f2ec454ba12ec278ba530f087a6a33 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 15:51:50 -0700 Subject: [PATCH 006/162] =?UTF-8?q?=F0=9F=91=8C=F0=9F=8F=BB=20Fix=20untest?= =?UTF-8?q?ed=20OS=20branches=20in=20bottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/bottle b/script/bottle index 9515f9e..b6d791a 100755 --- a/script/bottle +++ b/script/bottle @@ -30,7 +30,7 @@ echo "CURRENT_OS_VERSION_MINOR: $CURRENT_OS_VERSION_MINOR" case "${CURRENT_OS_VERSION_MAJOR}" in 14) - CURRENT_PLATFORM=monterey + CURRENT_PLATFORM=sonoma ;; 13) CURRENT_PLATFORM=ventura @@ -41,7 +41,7 @@ case "${CURRENT_OS_VERSION_MAJOR}" in 11) CURRENT_PLATFORM=big_sur ;; -11) +10) CURRENT_PLATFORM=catalina ;; *) From b8dc5ff7184eff810767f786580a0f6ebf1dcb77 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 15:52:52 -0700 Subject: [PATCH 007/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20dup=20bottles?= =?UTF-8?q?=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9b85b78..4d061d6 100644 --- a/Makefile +++ b/Makefile @@ -110,13 +110,9 @@ lint: ## Lints source code. danger: ## Runs danger. script/danger -# Builds bottles -.PHONY: bottles -bottles: ## Builds bottles. - script/bottle - .PHONY: bottle -bottle: bottles ## Alias for bottles +bottle: ## Builds Homebrew bottle for the current system. + script/bottle .PHONY: package package: build ## Packages the project. From 40d3cfde0d8279717fc3032b085162b83ca3c94e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 16:04:18 -0700 Subject: [PATCH 008/162] =?UTF-8?q?=F0=9F=94=A8=20Rename=20MAS=5FVERSION?= =?UTF-8?q?=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 10 +++++----- script/brew_formula_update | 12 ++++++------ script/brew_update | 4 ++-- script/build_artifacts | 4 ++-- script/install | 4 ++-- script/package | 4 ++-- script/version | 8 ++++---- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/script/bottle b/script/bottle index b6d791a..35a671a 100755 --- a/script/bottle +++ b/script/bottle @@ -14,8 +14,8 @@ BUILD_DIR="$PWD/.build" BOTTLE_DIR="$BUILD_DIR/bottles" -VERSION=$(script/version) -ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${VERSION}" +MAS_VERSION=$(script/version) +ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" # Supports macOS 10.11 and later OS_NAMES=(arm64_monterey monterey arm64_big_sur big_sur catalina mojave high_sierra sierra el_capitan) @@ -58,7 +58,7 @@ fi echo "CURRENT_PLATFORM: ${CURRENT_PLATFORM}" # Output filename from build-bottle command -OLD_FILENAME="mas--${VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" +OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" ################################################################################ # @@ -87,7 +87,7 @@ brew style mas-cli/tap/mas # Build the formula for the current macOS version and architecture. # -echo "==> 🍼 Bottling mas ${VERSION} for: ${OS_NAMES[*]}" +echo "==> 🍼 Bottling mas ${MAS_VERSION} for: ${OS_NAMES[*]}" brew install --build-bottle mas-cli/tap/mas # Generate bottle do block, dropping last 2 lines @@ -118,7 +118,7 @@ EOF # Fix filename for os in "${OS_NAMES[@]}"; do - new_filename="mas-${VERSION}.${os}.bottle.tar.gz" + new_filename="mas-${MAS_VERSION}.${os}.bottle.tar.gz" cp -v "${OLD_FILENAME}" "${BOTTLE_DIR}/${new_filename}" # Append each os diff --git a/script/brew_formula_update b/script/brew_formula_update index 4327406..f4e3948 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -20,16 +20,16 @@ function usage { # arg 1 - version tag if test -n "$1"; then - VERSION="$1" + MAS_VERSION="$1" else - VERSION="v$(script/version)" + MAS_VERSION="v$(script/version)" fi # arg 2 - revision (commit hash) if test -n "$2"; then REVISION="$2" else - REVISION=$(git rev-parse "$VERSION") + REVISION=$(git rev-parse "$MAS_VERSION") fi echo "Checking to see if this update can be a simple bump." @@ -44,11 +44,11 @@ if test $status -ne 0; then formula_revisions=1 fi -echo "==> 🧪 Updating homebrew-core formula mas ($VERSION, $REVISION)" +echo "==> 🧪 Updating homebrew-core formula mas ($MAS_VERSION, $REVISION)" echo "Validating formula" brew bump-formula-pr \ - --tag="$VERSION" \ + --tag="$MAS_VERSION" \ --revision="$REVISION" \ --strict \ mas @@ -69,7 +69,7 @@ if test $formula_revisions -eq 1; then fi brew bump-formula-pr \ - --tag="$VERSION" \ + --tag="$MAS_VERSION" \ --revision="$REVISION" \ --strict \ --verbose \ diff --git a/script/brew_update b/script/brew_update index 02f2d46..a6ce2eb 100755 --- a/script/brew_update +++ b/script/brew_update @@ -6,9 +6,9 @@ # Runs all related scripts for generating all artifacts. # -VERSION=$(script/version) +MAS_VERSION=$(script/version) -echo "Updating mas $VERSION Homebrew formula" +echo "Updating mas $MAS_VERSION Homebrew formula" script/brew_formula_update script/bottle diff --git a/script/build_artifacts b/script/build_artifacts index 30d384b..6414d16 100755 --- a/script/build_artifacts +++ b/script/build_artifacts @@ -6,9 +6,9 @@ # Runs all related scripts for generating all artifacts. # -VERSION=$(script/version) +MAS_VERSION=$(script/version) -echo "Building mas $VERSION artifacts" +echo "Building mas $MAS_VERSION artifacts" script/clean script/build --universal diff --git a/script/install b/script/install index 1b72f39..f6ee7ce 100755 --- a/script/install +++ b/script/install @@ -12,7 +12,7 @@ ARCH=$(uname -m) RELEASE=.build/${ARCH}-apple-macosx/release -VERSION=$(script/version) +MAS_VERSION=$(script/version) if [[ $(uname -m) == 'arm64' ]]; then PREFIX=/opt/homebrew @@ -32,7 +32,7 @@ while test -n "$1"; do shift done -echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX" +echo "==> 📲 Installing mas ($MAS_VERSION) for $ARCH to $PREFIX" ditto -v \ "$RELEASE/mas" \ "$PREFIX/bin/" diff --git a/script/package b/script/package index 686647c..30df8f8 100755 --- a/script/package +++ b/script/package @@ -20,7 +20,7 @@ DISTRIBUTION_PLIST="Package/Distribution.plist" DSTROOT=.build/distributions script/install "$DSTROOT/usr/local" --universal -VERSION=$(script/version) +MAS_VERSION=$(script/version) echo "==> 📦 Assemble an installer package" @@ -28,7 +28,7 @@ echo "==> 📦 Assemble an installer package" pkgbuild \ --identifier "$IDENTIFIER" \ --install-location "/" \ - --version "$VERSION" \ + --version "$MAS_VERSION" \ --root "$DSTROOT" \ "$COMPONENT_PACKAGE" diff --git a/script/version b/script/version index 9bce7a8..19c7b31 100755 --- a/script/version +++ b/script/version @@ -9,16 +9,16 @@ # This no longer works with MARKETING_VERSION build setting in Info.plist # agvtool what-marketing-version -terse1 -VERSION=$(git describe --abbrev=0 --tags) -VERSION=${VERSION#v} +MAS_VERSION=$(git describe --abbrev=0 --tags) +MAS_VERSION=${MAS_VERSION#v} SCRIPT_PATH=$(dirname "$(which "$0")") cat <"${SCRIPT_PATH}/../Sources/MasKit/Package.swift" // Generated by: script/version enum Package { - static let version = "${VERSION}" + static let version = "${MAS_VERSION}" } EOF -echo "${VERSION}" +echo "${MAS_VERSION}" From a12d2320be057b7db5521a24ecd6c94e1651d6ab Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 16:40:47 -0700 Subject: [PATCH 009/162] =?UTF-8?q?=F0=9F=A5=85=20Swalloer=20error=20if=20?= =?UTF-8?q?trash=20fails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/uninstall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/uninstall b/script/uninstall index 8e2af57..b863d66 100755 --- a/script/uninstall +++ b/script/uninstall @@ -17,4 +17,4 @@ fi echo "==> 🔥 Uninstalling mas from $PREFIX" -trash "$PREFIX/bin/mas" +trash "$PREFIX/bin/mas" || true From 2a02cee76c61eb1a940e34fc84da7c78d76b5445 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 16:41:12 -0700 Subject: [PATCH 010/162] =?UTF-8?q?=F0=9F=94=A8=20Add=20sonoma=20&=20ventu?= =?UTF-8?q?ra=20to=20bottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/script/bottle b/script/bottle index 35a671a..a048c6d 100755 --- a/script/bottle +++ b/script/bottle @@ -6,6 +6,8 @@ # 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 +# ################################################################################ # @@ -18,7 +20,21 @@ MAS_VERSION=$(script/version) ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" # Supports macOS 10.11 and later -OS_NAMES=(arm64_monterey monterey arm64_big_sur big_sur catalina mojave high_sierra sierra el_capitan) +OS_NAMES=( \ + sonoma \ + arm64_sonoma \ + ventura \ + arm64_ventura \ + monterey \ + arm64_monterey \ + big_sur \ + arm64_big_sur \ + catalina \ + mojave \ + high_sierra \ + sierra \ + el_capitan \ +) # Semantic version number split into a list using Ugly, bash 3 compatible syntax IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ /g'))" @@ -66,12 +82,12 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # # Uninstall if necessary -brew remove mas 2>/dev/null || true # ignore failure -brew remove mas-cli/tap/mas 2>/dev/null || true #ignore failure +brew remove mas 2>/dev/null || true +brew remove mas-cli/tap/mas 2>/dev/null || true # Uninstall if still found on path if command -v mas >/dev/null; then - script/uninstall || true # ignore failure + script/uninstall || true fi # Use formula from custom tap From bcd2411e5da9004236ebee34929e8b44e2e1daae Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 16:49:00 -0700 Subject: [PATCH 011/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20duplicate=20mon?= =?UTF-8?q?terey=20bottle=20reference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Homebrew/mas-tap.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Homebrew/mas-tap.rb b/Homebrew/mas-tap.rb index bba7dd8..59ad0bf 100644 --- a/Homebrew/mas-tap.rb +++ b/Homebrew/mas-tap.rb @@ -16,7 +16,6 @@ class Mas < Formula sha256 cellar: :any_skip_relocation, sonoma: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, ventura: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" - sha256 cellar: :any_skip_relocation, monterey: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, big_sur: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, catalina: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" sha256 cellar: :any_skip_relocation, mojave: "0d042a450d2623e3ea40db0b645454ee88d1a1763a7aa778eec5beea619b9a60" From a14384579edee0cc39192c3203f082d4ac04b8b4 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 25 Nov 2023 16:59:53 -0700 Subject: [PATCH 012/162] =?UTF-8?q?=F0=9F=94=A8=20Use=20brew=20--prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- script/install | 7 +------ script/uninstall | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 4d061d6..2e2a122 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CMD_NAME = mas SHELL = /bin/sh -PREFIX ?= /usr/local +PREFIX ?= $(shell brew --prefix) # trunk # SWIFT_VERSION = swift-DEVELOPMENT-SNAPSHOT-2020-04-23-a diff --git a/script/install b/script/install index f6ee7ce..1fc0b3b 100755 --- a/script/install +++ b/script/install @@ -13,12 +13,7 @@ ARCH=$(uname -m) RELEASE=.build/${ARCH}-apple-macosx/release MAS_VERSION=$(script/version) - -if [[ $(uname -m) == 'arm64' ]]; then - PREFIX=/opt/homebrew -else - PREFIX=/usr/local -fi +PREFIX=$(brew --prefix) while test -n "$1"; do if [[ "$1" == '--universal' ]]; then diff --git a/script/uninstall b/script/uninstall index b863d66..043e5d6 100755 --- a/script/uninstall +++ b/script/uninstall @@ -9,10 +9,8 @@ # Override default prefix path with optional 1st arg if test -n "$1"; then PREFIX="$1" -elif [[ $(uname -m) == 'arm64' ]]; then - PREFIX=/opt/homebrew else - PREFIX=/usr/local + PREFIX=$(brew --prefix) fi echo "==> 🔥 Uninstalling mas from $PREFIX" From 96ff7ecdae7092464ebab75a4c6ed3bba79002c6 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 28 Nov 2023 20:25:43 -0700 Subject: [PATCH 013/162] =?UTF-8?q?=F0=9F=94=A8=20Install=20universal=20bi?= =?UTF-8?q?nary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++++++- script/build | 5 ++++- script/install | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2e2a122..70c2db8 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,10 @@ updateHeaders: ## Updates private headers. build: ## Builds the project. script/build +.PHONY: build-universal +build-universal: ## Builds a "fat" universal binary. + script/build --universal + .PHONY: test test: build ## Runs tests. script/test @@ -91,9 +95,13 @@ run: build ${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS) .PHONY: install -install: ## Installs the project. +install: build ## Installs the project. script/install $(PREFIX) +.PHONY: install-universal +install-universal: build-universal ## Installs a universal binary. + script/install --universal + .PHONY: uninstall uninstall: ## Uninstalls the project. script/uninstall diff --git a/script/build b/script/build index 8f0d1ae..5c70383 100755 --- a/script/build +++ b/script/build @@ -9,7 +9,10 @@ # Build for the host architecture by default. ARCH=() if [[ "$1" == '--universal' ]]; then - ARCH=(--arch arm64 --arch x86_64) + ARCH=( \ + --arch arm64 \ + --arch x86_64 \ + ) fi # Disable the manifest cache on Xcode 12.5 and later. diff --git a/script/install b/script/install index 1fc0b3b..5237a7d 100755 --- a/script/install +++ b/script/install @@ -18,7 +18,7 @@ PREFIX=$(brew --prefix) while test -n "$1"; do if [[ "$1" == '--universal' ]]; then ARCH=universal - RELEASE=.build/release + RELEASE=.build/apple/Products/Release else # Override default prefix path with optional arg PREFIX="$1" @@ -30,4 +30,4 @@ done echo "==> 📲 Installing mas ($MAS_VERSION) for $ARCH to $PREFIX" ditto -v \ "$RELEASE/mas" \ - "$PREFIX/bin/" + "$PREFIX/bin/mas" From f162f6a8e22d997372e0b9fd078fff97884c799c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 00:06:10 -0700 Subject: [PATCH 014/162] =?UTF-8?q?=F0=9F=94=80=20Fix=20merge=20mistake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/MasKit/Controllers/MasStoreSearch.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sources/MasKit/Controllers/MasStoreSearch.swift b/Sources/MasKit/Controllers/MasStoreSearch.swift index b9c5ca7..f5a32e4 100644 --- a/Sources/MasKit/Controllers/MasStoreSearch.swift +++ b/Sources/MasKit/Controllers/MasStoreSearch.swift @@ -72,8 +72,6 @@ class MasStoreSearch: StoreSearch { loadSearchResults(url) }.then { results -> Guarantee in guard let result = results.first else { - return try JSONDecoder().decode(SearchResultList.self, from: data).results - } catch { return .value(nil) } From 666e505eb1df64240824a1edb3ffb70b9e67349a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 00:09:44 -0700 Subject: [PATCH 015/162] =?UTF-8?q?=F0=9F=8E=A8=20Format=20bash=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 28 ++++++++++++++-------------- script/build | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/script/bottle b/script/bottle index a048c6d..b4daad6 100755 --- a/script/bottle +++ b/script/bottle @@ -20,20 +20,20 @@ MAS_VERSION=$(script/version) ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" # Supports macOS 10.11 and later -OS_NAMES=( \ - sonoma \ - arm64_sonoma \ - ventura \ - arm64_ventura \ - monterey \ - arm64_monterey \ - big_sur \ - arm64_big_sur \ - catalina \ - mojave \ - high_sierra \ - sierra \ - el_capitan \ +OS_NAMES=( + sonoma + arm64_sonoma + ventura + arm64_ventura + monterey + arm64_monterey + big_sur + arm64_big_sur + catalina + mojave + high_sierra + sierra + el_capitan ) # Semantic version number split into a list using Ugly, bash 3 compatible syntax diff --git a/script/build b/script/build index 5c70383..ed9ea03 100755 --- a/script/build +++ b/script/build @@ -9,9 +9,9 @@ # Build for the host architecture by default. ARCH=() if [[ "$1" == '--universal' ]]; then - ARCH=( \ - --arch arm64 \ - --arch x86_64 \ + ARCH=( + --arch arm64 + --arch x86_64 ) fi From cf2d8d6e0919f36e7156a1ca21b2103c9195efce Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 17 Feb 2024 22:00:40 -0700 Subject: [PATCH 016/162] =?UTF-8?q?=F0=9F=94=A7=20Configure=20.actrc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .actrc | 6 ++++++ .gitignore | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 .actrc diff --git a/.actrc b/.actrc new file mode 100644 index 0000000..231c919 --- /dev/null +++ b/.actrc @@ -0,0 +1,6 @@ +--action-offline-mode +--container-architecture linux/amd64 +--platform macos-14=self-hosted +--pull=false +--reuse +--secret-file .secrets diff --git a/.gitignore b/.gitignore index 18eb50c..f34cb71 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ .envrc .fseventsd .rubygems/ +.secrets .swiftpm/ Carthage/ DerivedData @@ -33,6 +34,7 @@ Pods/ Temporary Items bin/ build/ +gha/ default.profraw releases/ xcuserdata From e20b14a09706bde9489333dc2be40f3969b75385 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 08:42:05 -0700 Subject: [PATCH 017/162] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20pr-checks=20wor?= =?UTF-8?q?kflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/{build-test.yml => pr-checks.yml} | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) rename .github/workflows/{build-test.yml => pr-checks.yml} (72%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/pr-checks.yml similarity index 72% rename from .github/workflows/build-test.yml rename to .github/workflows/pr-checks.yml index 9e42026..b109b1e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/pr-checks.yml @@ -1,15 +1,15 @@ # -# .github/workflows/build-test.yml +# .github/workflows/pr-checks.yml # # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables -name: Build, Test, and Lint +name: pr-checks on: - push: - branches: [ main ] pull_request: branches: [ main ] + push: + branches: [ main ] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -17,6 +17,7 @@ concurrency: jobs: build-test: + runs-on: macos-14 defaults: run: @@ -26,15 +27,7 @@ jobs: # https://github.com/actions/virtual-environments/issues/2187#issuecomment-790507204 shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} - name: Build, Test, and Lint - - # https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source - # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners - # https://github.com/mas-cli/mas/actions/runners - runs-on: macos-14 - steps: - # https://github.com/actions/checkout#usage - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version From 5b2994d27db451b318abd6a84f2db7e5f59e5bfc Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 08:55:03 -0700 Subject: [PATCH 018/162] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20danger-swift=20(3.?= =?UTF-8?q?18.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/danger.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index cbe8a05..db959dc 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,16 +1,24 @@ -name: Danger +# +# .github/workflows/danger.yml +# +# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables + +name: danger + on: pull_request: branches: [ main ] + jobs: danger: - name: Danger runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 + - name: Danger # https://github.com/orgs/danger/packages/container/package/danger-swift - uses: docker://ghcr.io/danger/danger-swift:3.12.3 + uses: docker://ghcr.io/danger/danger-swift:3.18.0 with: args: --failOnErrors --no-publish-check env: From b7aa6b7e9ab3e35f71b786df774007388145a587 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 10:22:30 -0700 Subject: [PATCH 019/162] =?UTF-8?q?=F0=9F=94=A7=20Configure=20.actrc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .actrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actrc b/.actrc index 231c919..a87405d 100644 --- a/.actrc +++ b/.actrc @@ -1,6 +1,6 @@ --action-offline-mode --container-architecture linux/amd64 ---platform macos-14=self-hosted +--platform macos-14=-self-hosted --pull=false --reuse --secret-file .secrets From 8d735e449986de1888869016cdafaeafa67810d6 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 10:40:49 -0700 Subject: [PATCH 020/162] =?UTF-8?q?=E2=9E=95=20act=20(0.2.59)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .mise.toml diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..0cf4a9e --- /dev/null +++ b/.mise.toml @@ -0,0 +1,7 @@ +# +# .mise.toml +# https://mise.jdx.dev/configuration.html +# + +[tools] +act = "0.2.59" From f7152f211de47c725c4fedc6bd5454bf1debfd9a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 10:46:53 -0700 Subject: [PATCH 021/162] =?UTF-8?q?=F0=9F=A5=85=20Handle=20version=20scrip?= =?UTF-8?q?t=20errors=20when=20invoked=20by=20act?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit | fatal: Not a valid object name HEAD | MAS_VERSION: 0.0.0 --- script/version | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/script/version b/script/version index 19c7b31..42b17cf 100755 --- a/script/version +++ b/script/version @@ -9,8 +9,13 @@ # This no longer works with MARKETING_VERSION build setting in Info.plist # agvtool what-marketing-version -terse1 -MAS_VERSION=$(git describe --abbrev=0 --tags) +if git describe 2>/dev/null; then + MAS_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || true) +else + MAS_VERSION=0.0.0 +fi MAS_VERSION=${MAS_VERSION#v} +echo "MAS_VERSION: ${MAS_VERSION}" SCRIPT_PATH=$(dirname "$(which "$0")") @@ -20,5 +25,3 @@ enum Package { static let version = "${MAS_VERSION}" } EOF - -echo "${MAS_VERSION}" From 65b434322377c6bfe37303d69c6cc64662cf32b1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 11:15:41 -0700 Subject: [PATCH 022/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unused=20travis?= =?UTF-8?q?-ci=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 97b425b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -# -# .travis.yml -# mas-cli -# -# https://travis-ci.com/mas-cli/mas -# https://docs.travis-ci.com/user/reference/osx/ -# https://docs.travis-ci.com/user/languages/objective-c/ -# - -# https://docs.travis-ci.com/user/build-config-validation -version: ~> 1.0 - -# https://docs.travis-ci.com/user/reference/osx/#macos-version -os: osx -osx_image: xcode11.5 # macOS 10.15.4 - -env: - global: - - LANG=en_US.UTF-8 - - LC_ALL=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - -# Bundler 2 -# https://docs.travis-ci.com/user/languages/ruby/#bundler-20 -before_install: - - gem install bundler - -install: - - script/bootstrap - -script: - - script/build - - script/test - - bundle exec danger - -before_deploy: - - script/package - -deploy: - provider: releases - api_key: - secure: SEAdxkLeRJ/z7cO4Y//8sxrYbNlzz3W4ip717gcMsuxp6LzsQtS7QW+/N3iSNuowgIKqTad0ZdiYHczwa+mTI/rjPDP1mxC4Bx+pQpZN+bizY9MNVcDDTSD6yCvI1vZl+dLQwUKKzW/lTKDk4yunOmxLV4xtDE7EDfyf1Zkypx0mQ6SoG2cFHZVDrDrU4c05oPtD/3dTvq2lVf5suBhjrRNLSOpIU4fPgc3PbPCL1MtIZRQpGfVPGWZLRMOHLXNIKFkP1qaa6Z2+R1iZjtqZ5isECikRNSPeBYm7OWx/EoGqRbC64YVIjTKi17rjEHDf46RxskPKa4Df6i2X4HCzhZBKcVB/Zu4HpjaR8gMcTCT0QnfHpDDgyAMVBPW84uyhfJ93GJaK7vk5NebY6IWg4d/mrisZ5XA4o6EXZSOSTbrZEZDn+2Knp9IIad169YYymo6ESr4zFwfxXG516ozYi8ROuWP0ZR+wxgBkm3b2mvryABgye45k/yqX/8Pd7RD/wB03RTOKkog4gQkyhrR9VSpuSVXfAm89Qg4Y+nzdDNoSR8i9xKN/c+rXFMnmuTItwiIqE30Nb58dISt2BEpFzDRh00ae1kOZ3coC0WsqW7hmdk46QvhhEOIYGVYOlUDU/8BownV37alfAiiQV0tjEwX7YMV+6qwraKmdnjOWISk= - file: - - mas-cli.zip - - mas.xcarchive.zip - skip_cleanup: true - on: - repo: mas-cli/mas - tags: true From fe5642f266a4e71fdd6717386df715e8dd98e63b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 11:16:05 -0700 Subject: [PATCH 023/162] =?UTF-8?q?=E2=9C=A8=20Add=20initial=20release=20w?= =?UTF-8?q?orkflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..64b3fcf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +# +# .github/workflows/release.yml +# + +name: release + +on: + release: + types: [published] + +jobs: + release: + runs-on: macos-14 + + steps: + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + + - name: Bootstrap + run: script/bootstrap From 3a0fe2fe92af0766318b526033a21821f2c976a4 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 11:36:03 -0700 Subject: [PATCH 024/162] =?UTF-8?q?=F0=9F=94=A7=20Configure=20yamllint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .yamllint.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .yamllint.yml diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..bf64f88 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,17 @@ +# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration +--- +extends: default +locale: en_US.UTF-8 + +ignore-from-file: .gitignore + +rules: + line-length: + max: 120 + level: warning + # https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.truthy + truthy: + allowed-values: ["true", "false"] + check-keys: false + # Disables fallse positives on GHA workflow `on:` + level: warning From 1aa7aee9b6ce84c5ebb7606f83f0669b8215a766 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 11:38:38 -0700 Subject: [PATCH 025/162] =?UTF-8?q?=E2=9E=95=20yamllint=20(1.35.1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mise.toml b/.mise.toml index 0cf4a9e..278c03d 100644 --- a/.mise.toml +++ b/.mise.toml @@ -5,3 +5,4 @@ [tools] act = "0.2.59" +yamllint = "1.35.1" From 0806fbad54ed1691fcb2783a5b5940734b5545c2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 11:41:27 -0700 Subject: [PATCH 026/162] =?UTF-8?q?=E2=9E=95=20prettier=20(3.2.5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mise.toml b/.mise.toml index 278c03d..c02d1fd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -5,4 +5,5 @@ [tools] act = "0.2.59" +"npm:prettier" = "3.2.5" yamllint = "1.35.1" From 8eab75ed9a1b780d9fd489ed474cd9c4033c2f50 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 12:13:42 -0700 Subject: [PATCH 027/162] =?UTF-8?q?=F0=9F=8E=A8=20Format=20YAML=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 1 + .github/release.yml | 11 +++++---- .github/workflows/danger.yml | 24 ++++++++------------ .github/workflows/pr-checks.yml | 39 ++++++++++++-------------------- .github/workflows/release.yml | 18 ++++++--------- .hound.yml | 4 ---- .periphery.yml | 1 + .swiftlint.yml | 8 +++---- Tests/MasKitTests/.swiftlint.yml | 7 +++--- 9 files changed, 47 insertions(+), 66 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ef58025..254c418 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,5 @@ # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates +--- version: 2 updates: - package-ecosystem: "github-actions" diff --git a/.github/release.yml b/.github/release.yml index 778688d..add94e5 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,12 +1,13 @@ # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +--- changelog: categories: - - title: '🚀 Features' + - title: "🚀 Features" labels: - - '🆕 feature request' - - title: '🐛 Bug Fixes' + - "🆕 feature request" + - title: "🐛 Bug Fixes" labels: - - '🐛 bug' + - "🐛 bug" - title: Changes labels: - - '*' + - "*" diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index db959dc..f278c8d 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -2,24 +2,20 @@ # .github/workflows/danger.yml # # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables - +--- name: danger - on: pull_request: - branches: [ main ] - + branches: [main] jobs: danger: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Danger - # https://github.com/orgs/danger/packages/container/package/danger-swift - uses: docker://ghcr.io/danger/danger-swift:3.18.0 - with: - args: --failOnErrors --no-publish-check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - name: Danger + # https://github.com/orgs/danger/packages/container/package/danger-swift + uses: docker://ghcr.io/danger/danger-swift:3.18.0 + with: + args: --failOnErrors --no-publish-check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index b109b1e..451df14 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -2,23 +2,19 @@ # .github/workflows/pr-checks.yml # # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables - +--- name: pr-checks - on: pull_request: - branches: [ main ] + branches: [main] push: - branches: [ main ] - + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - jobs: build-test: runs-on: macos-14 - defaults: run: # Prefixes all `run` commands with the following command to force them to run outside Rosetta. @@ -26,21 +22,16 @@ jobs: # https://github.com/rolpdog/cffi-mirror/blob/release-1.15/.github/workflows/ci.yaml#L81-L141 # https://github.com/actions/virtual-environments/issues/2187#issuecomment-790507204 shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} - steps: - - uses: actions/checkout@v4 - with: - # A fetch-depth of 0 includes all history and tags for script/version - fetch-depth: 0 - - - name: Bootstrap - run: script/bootstrap - - - name: Build - run: script/build - - - name: Test - run: script/test - - - name: Lint - run: script/lint + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + - name: Bootstrap + run: script/bootstrap + - name: Build + run: script/build + - name: Test + run: script/test + - name: Lint + run: script/lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64b3fcf..415fad9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,18 @@ # # .github/workflows/release.yml # - +--- name: release - on: release: types: [published] - jobs: release: runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - with: - # A fetch-depth of 0 includes all history and tags for script/version - fetch-depth: 0 - - - name: Bootstrap - run: script/bootstrap + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + - name: Bootstrap + run: script/bootstrap diff --git a/.hound.yml b/.hound.yml index 79acba6..e3790af 100644 --- a/.hound.yml +++ b/.hound.yml @@ -6,15 +6,11 @@ # --- fail_on_violations: false - erblint: enabled: false - rubocop: enabled: false - shellcheck: enabled: true - swiftlint: enabled: false diff --git a/.periphery.yml b/.periphery.yml index bc809cc..f35a82f 100644 --- a/.periphery.yml +++ b/.periphery.yml @@ -1,2 +1,3 @@ +--- retain_public: true strict: true diff --git a/.swiftlint.yml b/.swiftlint.yml index 852c115..604021a 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -4,12 +4,10 @@ # # https://github.com/realm/SwiftLint#configuration # - +--- disabled_rules: -- trailing_comma - + - trailing_comma excluded: -- docs - + - docs opening_brace: allow_multiline_func: true diff --git a/Tests/MasKitTests/.swiftlint.yml b/Tests/MasKitTests/.swiftlint.yml index daa6dd0..d6780ba 100644 --- a/Tests/MasKitTests/.swiftlint.yml +++ b/Tests/MasKitTests/.swiftlint.yml @@ -4,8 +4,9 @@ # # https://github.com/realm/SwiftLint#configuration # + --- disabled_rules: -- force_cast -- force_try -- function_body_length + - force_cast + - force_try + - function_body_length From 08697a84cd0430eee24377ee32eb46d57426ff1a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 13:16:07 -0700 Subject: [PATCH 028/162] =?UTF-8?q?=F0=9F=91=A2=20Use=20mise=20to=20instal?= =?UTF-8?q?l=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Brewfile | 1 + Brewfile.lock.json | 243 ++++++++++++++++++++++++++++++--------------- script/bootstrap | 6 ++ 3 files changed, 169 insertions(+), 81 deletions(-) diff --git a/Brewfile b/Brewfile index f849bab..54e9332 100644 --- a/Brewfile +++ b/Brewfile @@ -1,4 +1,5 @@ brew "markdownlint-cli" +brew "mise" brew "shellcheck" brew "shfmt" brew "swiftformat" diff --git a/Brewfile.lock.json b/Brewfile.lock.json index 0858043..b8b7a40 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -2,132 +2,221 @@ "entries": { "brew": { "markdownlint-cli": { - "version": "0.32.2", + "version": "0.39.0", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { - "all": { + "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:7be52e16473a658becde9b817f86c868bcb9e41e79856d9dce542218b9515860", - "sha256": "7be52e16473a658becde9b817f86c868bcb9e41e79856d9dce542218b9515860" + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f", + "sha256": "7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f", + "sha256": "7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f", + "sha256": "7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f", + "sha256": "0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f", + "sha256": "0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f", + "sha256": "0af1b50fb5bef4a0c47e1bd233e39262586885b48bc4c5a60592c5f42c2edf9f" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f", + "sha256": "7bc1310bfbeff34386c2b309988569bc6494b333edf9bf26d027fbecc1342c2f" + } + } + } + }, + "mise": { + "version": "2024.2.16", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:cf2658e28f73f665dffee065fe2d5d937428b84a946045729261eb1d909097ab", + "sha256": "cf2658e28f73f665dffee065fe2d5d937428b84a946045729261eb1d909097ab" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:9b33461f6e4d3dec5874d3cf33ba2f50c56405a4a1614702413714ece30aeca9", + "sha256": "9b33461f6e4d3dec5874d3cf33ba2f50c56405a4a1614702413714ece30aeca9" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:118252faee191298da1484d2a0e9fb4e9db88a02616b73a08f060941332d840f", + "sha256": "118252faee191298da1484d2a0e9fb4e9db88a02616b73a08f060941332d840f" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:ccbcdc667eb9ebfaea72708a299d4377d426c6bc269476cb8517f1a7e2fd30a0", + "sha256": "ccbcdc667eb9ebfaea72708a299d4377d426c6bc269476cb8517f1a7e2fd30a0" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:5c8ca4220d2ad61e1f55a618a2060da4db64cde0fcb70a09aa4cddee48f35766", + "sha256": "5c8ca4220d2ad61e1f55a618a2060da4db64cde0fcb70a09aa4cddee48f35766" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:264e93049b3665c1068f693929fb53e7015ce8b9811080ecfa78b6a94721b2e0", + "sha256": "264e93049b3665c1068f693929fb53e7015ce8b9811080ecfa78b6a94721b2e0" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:503709469df1ccf64a42386bd933d8f307b9c52d3e2bc77106ed96bf06c369c8", + "sha256": "503709469df1ccf64a42386bd933d8f307b9c52d3e2bc77106ed96bf06c369c8" } } } }, "shellcheck": { - "version": "0.8.0", + "version": "0.9.0", "bottle": { - "rebuild": 0, + "rebuild": 1, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:0688df1adf51536205cde96e4910b26c88b10eb2f967a8255c726f9d0cb57d2a", + "sha256": "0688df1adf51536205cde96e4910b26c88b10eb2f967a8255c726f9d0cb57d2a" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:42ac0d4c4c44a3fd85a52caa0d655c32f28e609713530ba69a52d182b61351e4", + "sha256": "42ac0d4c4c44a3fd85a52caa0d655c32f28e609713530ba69a52d182b61351e4" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:625466bcd245a36da12ee088877d582c7e9fec1622418d1165a7d7d8f204ecc3", - "sha256": "625466bcd245a36da12ee088877d582c7e9fec1622418d1165a7d7d8f204ecc3" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:4d9fc87309f3997d443d5a5e2c6ec72f3586cbeecdeb002f52f64414f106110e", + "sha256": "4d9fc87309f3997d443d5a5e2c6ec72f3586cbeecdeb002f52f64414f106110e" }, - "arm64_big_sur": { + "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:883ba5ee45554568cd1ce106dc6c090ec0745f576a4a6708332de951b03c7423", - "sha256": "883ba5ee45554568cd1ce106dc6c090ec0745f576a4a6708332de951b03c7423" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:dec4133905b1115275e6ce2d9cd5ef966cbac0e5912fc32e3c89356922ea0ec1", + "sha256": "dec4133905b1115275e6ce2d9cd5ef966cbac0e5912fc32e3c89356922ea0ec1" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:89d1c2a187c42d41e99856895989e2bf57a9f82e8a0265dd30d3f417baf273dd", + "sha256": "89d1c2a187c42d41e99856895989e2bf57a9f82e8a0265dd30d3f417baf273dd" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:cfd8c8e8d8927dfd4b83593f539690a6083b075b0a1ff8a66578e8bb810d3db9", - "sha256": "cfd8c8e8d8927dfd4b83593f539690a6083b075b0a1ff8a66578e8bb810d3db9" - }, - "big_sur": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:d88edc1ae7db555ec5da01d4a1272da8260eb62073d2cdfa5fa3dce37d51fbe6", - "sha256": "d88edc1ae7db555ec5da01d4a1272da8260eb62073d2cdfa5fa3dce37d51fbe6" - }, - "catalina": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:24a67cd4f2b66a02cb77a1c705d7dcf25b4410209435a0b1136398da1fa6f766", - "sha256": "24a67cd4f2b66a02cb77a1c705d7dcf25b4410209435a0b1136398da1fa6f766" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:f1506e3dfd48ac61184f37b5b6cb48328018bc37e415f78dd4348d2730ad9cf7", + "sha256": "f1506e3dfd48ac61184f37b5b6cb48328018bc37e415f78dd4348d2730ad9cf7" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:961b2f3d75cf86dd5bc767cf689eee8f8e88bb30d716cf208b4bb89d61e5a553", - "sha256": "961b2f3d75cf86dd5bc767cf689eee8f8e88bb30d716cf208b4bb89d61e5a553" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:d0f7c834a0266325e8dab25a04aeadc67664701b767d3ed2529286fb0fb66823", + "sha256": "d0f7c834a0266325e8dab25a04aeadc67664701b767d3ed2529286fb0fb66823" } } } }, "shfmt": { - "version": "3.5.1", + "version": "3.8.0", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34", + "sha256": "78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34", + "sha256": "78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:633116b598a60ad576a79753208e13388f6a2460139c8aca44e5a25befdb017c", - "sha256": "633116b598a60ad576a79753208e13388f6a2460139c8aca44e5a25befdb017c" + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34", + "sha256": "78a5017f23e2d4b9fd9312ce1e4e06c09cfb838d47e78cfb02ddb4190acb6b34" }, - "arm64_big_sur": { + "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:1b0653c0a44f7db5e78c5c6d67de534a52c4f588fb65e3acbb8211d06b871bd9", - "sha256": "1b0653c0a44f7db5e78c5c6d67de534a52c4f588fb65e3acbb8211d06b871bd9" + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62", + "sha256": "0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62", + "sha256": "0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:e7168603f81cf1357c2460c5c476fa66bf5421183d4dedeafe9cf38550fe8855", - "sha256": "e7168603f81cf1357c2460c5c476fa66bf5421183d4dedeafe9cf38550fe8855" - }, - "big_sur": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:0e0683566d83cceecd4d02596e3c899a640918ff067b6e15e10f8aee424f1759", - "sha256": "0e0683566d83cceecd4d02596e3c899a640918ff067b6e15e10f8aee424f1759" - }, - "catalina": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:4fabb118ba0da244f2b0ffe280b28e343712fac23e738ddf1db29fad68526d73", - "sha256": "4fabb118ba0da244f2b0ffe280b28e343712fac23e738ddf1db29fad68526d73" + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62", + "sha256": "0d7952151f13e850fa40b03d6ba3f39daa8ec9401735aa91d6cd8e950f880d62" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:faa60f70812132e10f94477676499a1e2bacb0d06fbe437e8480a997695c2203", - "sha256": "faa60f70812132e10f94477676499a1e2bacb0d06fbe437e8480a997695c2203" + "url": "https://ghcr.io/v2/homebrew/core/shfmt/blobs/sha256:772a5dfe3e281fc51f6200313fb62b454314bf4978a8fe70ba2026a4fe5af5c4", + "sha256": "772a5dfe3e281fc51f6200313fb62b454314bf4978a8fe70ba2026a4fe5af5c4" } } } }, "swiftformat": { - "version": "0.49.18", + "version": "0.53.2", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:e23df7cc20f91e8a54c665b5da4952f13d53cfa658751ed9d6efbbec39f425fd", + "sha256": "e23df7cc20f91e8a54c665b5da4952f13d53cfa658751ed9d6efbbec39f425fd" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:bf9654736aac1bcd6201d42277f5feaa261bf82e54dc75277cccc6f001b04657", + "sha256": "bf9654736aac1bcd6201d42277f5feaa261bf82e54dc75277cccc6f001b04657" + }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:6362f6087bc3821f4271c3d17b3a4f180b1e1326646ddfb60f6d27bfb5a2a357", - "sha256": "6362f6087bc3821f4271c3d17b3a4f180b1e1326646ddfb60f6d27bfb5a2a357" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:b9e78f333f16c6ef8eaf00c9f56685d90c455552e49691473a6e8184256bfd38", + "sha256": "b9e78f333f16c6ef8eaf00c9f56685d90c455552e49691473a6e8184256bfd38" }, - "arm64_big_sur": { + "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:e94cf1b66df0d712bbfbf509b98efaf31d39a61b82999314e1f3c0e45195c51a", - "sha256": "e94cf1b66df0d712bbfbf509b98efaf31d39a61b82999314e1f3c0e45195c51a" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:d6aba634d12b4e23da0c4cb5f8d7d1b36036fd966f243764b5c624a4bf57a794", + "sha256": "d6aba634d12b4e23da0c4cb5f8d7d1b36036fd966f243764b5c624a4bf57a794" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ac23688353c12e6e50a4f6ad388232ae7ef23c849ad7280c97ede5c6a2ec3b0b", + "sha256": "ac23688353c12e6e50a4f6ad388232ae7ef23c849ad7280c97ede5c6a2ec3b0b" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:456e0c95a565adbb45a29747abfadf41c838a7f09fae052a874e59429a94ef14", - "sha256": "456e0c95a565adbb45a29747abfadf41c838a7f09fae052a874e59429a94ef14" - }, - "big_sur": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:d00204be714789fa8b35d4c6f6eea5813604aa09f3911635059973aa827d2e8c", - "sha256": "d00204be714789fa8b35d4c6f6eea5813604aa09f3911635059973aa827d2e8c" - }, - "catalina": { - "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:b07f7221f3c5225ad0037293cecb95bde4f0dba4fa19797d84a3376dd1ad02ea", - "sha256": "b07f7221f3c5225ad0037293cecb95bde4f0dba4fa19797d84a3376dd1ad02ea" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ba227da0de2d6451e1407acc3b447f035578deb7c8f8bcd78645309cc9423e79", + "sha256": "ba227da0de2d6451e1407acc3b447f035578deb7c8f8bcd78645309cc9423e79" }, "x86_64_linux": { "cellar": "/home/linuxbrew/.linuxbrew/Cellar", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:c4a4ebd2f3f54b8f399551efaf47b3e419db2c729ffaf18a09e64bbf62d82f38", - "sha256": "c4a4ebd2f3f54b8f399551efaf47b3e419db2c729ffaf18a09e64bbf62d82f38" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:f1c2591afe87f93ff9db7b9bf755200b41e9eb14ae0641cd6290cb85e597c467", + "sha256": "f1c2591afe87f93ff9db7b9bf755200b41e9eb14ae0641cd6290cb85e597c467" } } } @@ -135,12 +224,12 @@ }, "tap": { "peripheryapp/periphery": { - "revision": "020a0b79994d454dbc8dbd886009137fd741b836" + "revision": "4f73aefe6e01ba2543b9ee50f7653d866784fd61" } }, "cask": { "periphery": { - "version": "2.9.0", + "version": "2.18.0", "options": { "full_name": "periphery" } @@ -149,21 +238,13 @@ }, "system": { "macos": { - "monterey": { - "HOMEBREW_VERSION": "3.5.3-75-g39c9e2d", + "sonoma": { + "HOMEBREW_VERSION": "4.2.8-158-g5d3fae3", "HOMEBREW_PREFIX": "/opt/homebrew", - "Homebrew/homebrew-core": "00e5383db36fddc6b26df896229289b42462e63e", - "CLT": "13.4.0.0.1.1651278267", - "Xcode": "13.4.1", - "macOS": "12.4" - }, - "ventura": { - "HOMEBREW_VERSION": "3.6.2-17-g0b602f6", - "HOMEBREW_PREFIX": "/opt/homebrew", - "Homebrew/homebrew-core": "9f43be0861992b9109035ac00e999f66598ba6c2", - "CLT": "14.0.0.0.1.1661618636", - "Xcode": "14.0", - "macOS": "13.0" + "Homebrew/homebrew-core": "api", + "CLT": "15.1.0.0.1.1700200546", + "Xcode": "15.2", + "macOS": "14.3.1" } } } diff --git a/script/bootstrap b/script/bootstrap index 9177fc7..66535bc 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -15,6 +15,12 @@ main() { rm -f Brewfile.lock.json brew bundle install --no-upgrade --verbose + if [[ ! -x "$(command -v mise)" ]]; then + brew install mise + fi + mise install + mise ls + # Already installed on GitHub Actions runner. if [[ ! -x "$(command -v swiftlint)" ]]; then brew install swiftlint From 7415f738d0870e09774f08369d1dcda96299a90a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 13:16:50 -0700 Subject: [PATCH 029/162] =?UTF-8?q?=F0=9F=94=A8=20Include=20YAML=20in=20li?= =?UTF-8?q?nt,=20format=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/format | 17 ++++++++--------- script/lint | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/script/format b/script/format index dc1287c..fbf97ca 100755 --- a/script/format +++ b/script/format @@ -13,18 +13,13 @@ echo "==> 🚨 Formatting mas" -for LINTER in markdownlint shfmt swiftformat swiftlint; do +for LINTER in markdownlint prettier shfmt swiftformat swiftlint yamllint; do if [[ ! -x "$(command -v ${LINTER})" ]]; then echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'." exit 1 fi done -echo -echo "--> 🖊 Markdown" -markdownlint --config .markdownlint.json --fix .github . - -echo echo "--> 🕊️ Swift" for SOURCE in Package.swift Sources Tests; do swiftformat ${SOURCE} @@ -32,8 +27,12 @@ for SOURCE in Package.swift Sources Tests; do swiftlint lint --fix --strict ${SOURCE} done -echo +echo "--> 〽️ Markdown" +markdownlint --config .markdownlint.json --fix .github . + +echo "--> 🖊 YAML" +# shellcheck disable=SC2046 +prettier --write $(yamllint --list-files .) + echo "--> 📜 Bash" shfmt -i 2 -l -w contrib/ script/ - -script/lint diff --git a/script/lint b/script/lint index e3c3668..e6f9795 100755 --- a/script/lint +++ b/script/lint @@ -12,21 +12,13 @@ echo "==> 🚨 Linting mas" -for LINTER in git markdownlint periphery shfmt swiftformat swiftlint; do +for LINTER in git markdownlint periphery shfmt swiftformat swiftlint yamllint; do if [[ ! -x "$(command -v ${LINTER})" ]]; then echo "error: ${LINTER} is not installed. Run 'script/bootstrap' or 'brew install ${LINTER}'." exit 1 fi done -echo "--> 🌳 Git" -git diff --check - -echo -echo "--> 🖊 Markdown" -markdownlint --config .markdownlint.json .github . - -echo echo "--> 🕊️ Swift" for SOURCE in Package.swift Sources Tests; do swiftformat --lint ${SOURCE} @@ -35,7 +27,15 @@ for SOURCE in Package.swift Sources Tests; do done periphery scan -echo +echo "--> 🌳 Git" +git diff --check + +echo "--> 〽️ Markdown" +markdownlint --config .markdownlint.json .github . + +echo "--> 🖊 YAML" +yamllint . + echo "--> 📜 Bash" shellcheck --shell=bash script/* shfmt -d -i 2 -l contrib/ script/ From 30ba6adf9ca5429b9999e3a85d77622a6a09c908 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:05:37 -0700 Subject: [PATCH 030/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unused=20hound?= =?UTF-8?q?=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hound.yml | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .hound.yml diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index e3790af..0000000 --- a/.hound.yml +++ /dev/null @@ -1,16 +0,0 @@ -# -# .hound.yml -# mas -# -# http://help.houndci.com/configuration/swiftlint -# ---- -fail_on_violations: false -erblint: - enabled: false -rubocop: - enabled: false -shellcheck: - enabled: true -swiftlint: - enabled: false From ec9fa6e5fc7753166e31c13d5d54ac6e364eb304 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:09:23 -0700 Subject: [PATCH 031/162] =?UTF-8?q?=E2=8F=B2=EF=B8=8F=20TEMP:=20Trigger=20?= =?UTF-8?q?release=20workflow=20on=20push=20for=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 415fad9..78cb082 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ --- name: release on: + push: release: types: [published] jobs: From 973b32853ef9700ec42e276e1066e39f19946b23 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:24:53 -0700 Subject: [PATCH 032/162] =?UTF-8?q?=F0=9F=94=8A=20Enable=20mise=20verbose?= =?UTF-8?q?=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bootstrap | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 66535bc..93a88ac 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -18,8 +18,9 @@ main() { if [[ ! -x "$(command -v mise)" ]]; then brew install mise fi - mise install - mise ls + mise settings set experimental true + mise install --verbose + mise ls --verbose # Already installed on GitHub Actions runner. if [[ ! -x "$(command -v swiftlint)" ]]; then From d3e8a3b3fb56bcec21d93de177c0c7e36c417574 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:32:54 -0700 Subject: [PATCH 033/162] =?UTF-8?q?=F0=9F=94=A7=20Enable=20experimental=20?= =?UTF-8?q?mise=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 Enable experimental mise features --- .mise.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.mise.toml b/.mise.toml index c02d1fd..8808927 100644 --- a/.mise.toml +++ b/.mise.toml @@ -7,3 +7,6 @@ act = "0.2.59" "npm:prettier" = "3.2.5" yamllint = "1.35.1" + +[settings] +experimental = true From bbbbb0167be5f6955b9cb9064400779376bb96de Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:34:47 -0700 Subject: [PATCH 034/162] =?UTF-8?q?=F0=9F=94=87=20Hide=20output=20from=20g?= =?UTF-8?q?it=20describe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version b/script/version index 42b17cf..7d49186 100755 --- a/script/version +++ b/script/version @@ -9,7 +9,7 @@ # This no longer works with MARKETING_VERSION build setting in Info.plist # agvtool what-marketing-version -terse1 -if git describe 2>/dev/null; then +if git describe >/dev/null 2>&1; then MAS_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || true) else MAS_VERSION=0.0.0 From 4d5816cbc36fec1931d7832813657b4318ff12ea Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:38:42 -0700 Subject: [PATCH 035/162] =?UTF-8?q?=F0=9F=94=8A=20Log=20mise=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bootstrap | 1 + 1 file changed, 1 insertion(+) diff --git a/script/bootstrap b/script/bootstrap index 93a88ac..291cfc0 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -18,6 +18,7 @@ main() { if [[ ! -x "$(command -v mise)" ]]; then brew install mise fi + mise config mise settings set experimental true mise install --verbose mise ls --verbose From ebfd624935463127297b6f239a567a8490c11402 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 14:40:44 -0700 Subject: [PATCH 036/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20experimental=20?= =?UTF-8?q?mise=20subcommands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bootstrap | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/bootstrap b/script/bootstrap index 291cfc0..c429499 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -18,10 +18,9 @@ main() { if [[ ! -x "$(command -v mise)" ]]; then brew install mise fi - mise config mise settings set experimental true mise install --verbose - mise ls --verbose + mise list --verbose # Already installed on GitHub Actions runner. if [[ ! -x "$(command -v swiftlint)" ]]; then From 2c39d305ea055ae4f48c2a7cce315cb49209bb5c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 18:31:00 -0700 Subject: [PATCH 037/162] =?UTF-8?q?=F0=9F=94=87=20Remove=20extra=20chars?= =?UTF-8?q?=20from=20stdout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version b/script/version index 7d49186..21756bb 100755 --- a/script/version +++ b/script/version @@ -15,7 +15,7 @@ else MAS_VERSION=0.0.0 fi MAS_VERSION=${MAS_VERSION#v} -echo "MAS_VERSION: ${MAS_VERSION}" +echo "${MAS_VERSION}" SCRIPT_PATH=$(dirname "$(which "$0")") From 74f233402335154e2d451cec3a96edc27b280e53 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 19:45:04 -0700 Subject: [PATCH 038/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Build=20mas=20package=20and=20bottles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78cb082..ee29a7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,3 +17,19 @@ jobs: fetch-depth: 0 - name: Bootstrap run: script/bootstrap + + # Important to trigger a universal build first as package just works with + # the `mas` binary in finds in the build dir. + - name: Build Universal + run: script/build --universal + - name: macOS Package + run: script/package + - name: Upload mas.pkg + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: mas.pkg + path: .build/mas.pkg + + - name: Homebrew Bottles for mas tap + run: script/bottle From 81ed7d0cf9ecfc87820e48feb305735111ad912b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 20:10:04 -0700 Subject: [PATCH 039/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Upload=20bottles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee29a7b..3e1a401 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,4 +32,9 @@ jobs: path: .build/mas.pkg - name: Homebrew Bottles for mas tap - run: script/bottle + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: homebrew-bottles + path: | + .build/bottles/mas-*.bottle.tar.gz From 9298dae4607d245e597befea784ec82a88058fcb Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 20:14:31 -0700 Subject: [PATCH 040/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Build=20bottles=20before=20upload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e1a401..2cc7641 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,23 +15,25 @@ jobs: with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 - - name: Bootstrap + - name: 👢 Bootstrap run: script/bootstrap # Important to trigger a universal build first as package just works with # the `mas` binary in finds in the build dir. - - name: Build Universal + - name: 🏗️ Build Universal run: script/build --universal - - name: macOS Package + - name: 📦 macOS Package run: script/package - - name: Upload mas.pkg + - name: 🚀 Upload mas.pkg uses: actions/upload-artifact@v3 with: if-no-files-found: error name: mas.pkg path: .build/mas.pkg - - name: Homebrew Bottles for mas tap + - name: 🍼 Homebrew Bottles for mas tap + run: script/bottle + - name: 🚀 Upload Bottles uses: actions/upload-artifact@v3 with: if-no-files-found: error From 2d46b71c66b4315e6c9fd7c907039167c5073b3f Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 21:52:15 -0700 Subject: [PATCH 041/162] =?UTF-8?q?=F0=9F=94=A8=20Organize=20make=20target?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removed broken danger target (no script) --- Makefile | 100 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 70c2db8..624cd6c 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ help: ## (default) Displays this message ################################################################################ # -# Targets +# ℹ️ Info Targets # .PHONY: version @@ -65,26 +65,36 @@ init: ## Installs tools. - swiftenv install $(SWIFT_VERSION) swiftenv local $(SWIFT_VERSION) +################################################################################ +# +# 👢 Bootstrap +# + .PHONY: bootstrap bootstrap: ## Installs tools. script/bootstrap +################################################################################ +# +# 👩🏻‍💻 Development Targets +# + .PHONY: clean clean: ## Cleans built products. script/clean -.PHONY: updateHeaders -updateHeaders: ## Updates private headers. - script/update_headers +.PHONY: lint +lint: ## Lints source code. + script/lint + +.PHONY: format +format: ## Formats source code. + script/format .PHONY: build build: ## Builds the project. script/build -.PHONY: build-universal -build-universal: ## Builds a "fat" universal binary. - script/build --universal - .PHONY: test test: build ## Runs tests. script/test @@ -94,41 +104,14 @@ test: build ## Runs tests. run: build ${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS) -.PHONY: install -install: build ## Installs the project. - script/install $(PREFIX) +.PHONY: updateHeaders +updateHeaders: ## Updates private macOS headers. + script/update_headers -.PHONY: install-universal -install-universal: build-universal ## Installs a universal binary. - script/install --universal - -.PHONY: uninstall -uninstall: ## Uninstalls the project. - script/uninstall - -.PHONY: format -format: ## Formats source code. - script/format - -.PHONY: lint -lint: ## Lints source code. - script/lint - -.PHONY: danger -danger: ## Runs danger. - script/danger - -.PHONY: bottle -bottle: ## Builds Homebrew bottle for the current system. - script/bottle - -.PHONY: package -package: build ## Packages the project. - script/package - -.PHONY: packageInstall -packageInstall: package ## Installs the package. - script/package_install +################################################################################ +# +# 🕊️ Swift Package Targets +# .PHONY: describe describe: ## Describes the Swift package. @@ -145,3 +128,36 @@ dependencies: resolve ## Lists SwiftPM dependencies. .PHONY: update update: resolve ## Updates SwiftPM dependencies. swift package update + +################################################################################ +# +# 🚀 Release Targets +# + +.PHONY: build-universal +build-universal: ## Builds a "fat" universal binary. + script/build --universal + +.PHONY: install +install: build ## Installs the binary. + script/install $(PREFIX) + +.PHONY: install-universal +install-universal: build-universal ## Installs a universal binary. + script/install --universal + +.PHONY: uninstall +uninstall: ## Uninstalls the binary. + script/uninstall + +.PHONY: package +package: build ## Packages the project. + script/package + +.PHONY: packageInstall +packageInstall: package ## Installs the package. + script/package_install + +.PHONY: bottle +bottle: ## Builds Homebrew bottle for the current system. + script/bottle From 9088bad9b958dc6514b095d8fd49074f3dcded9a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 23:08:13 -0700 Subject: [PATCH 042/162] =?UTF-8?q?=F0=9F=8E=AF=20Rename=20update-headers?= =?UTF-8?q?=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 624cd6c..3028561 100644 --- a/Makefile +++ b/Makefile @@ -104,8 +104,8 @@ test: build ## Runs tests. run: build ${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS) -.PHONY: updateHeaders -updateHeaders: ## Updates private macOS headers. +.PHONY: update-headers +update-headers: ## Updates private macOS headers. script/update_headers ################################################################################ From b1fe872f6242a891b611b42d4134c628c74d5555 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 23:11:46 -0700 Subject: [PATCH 043/162] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20swift=20d?= =?UTF-8?q?ependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CwlCatchException (2.1.2) - CwlPreconditionTesting (2.2.0) - PromiseKit (6.22.1) --- Package.resolved | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Package.resolved b/Package.resolved index ba46a29..14f75d7 100644 --- a/Package.resolved +++ b/Package.resolved @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git", "state": { "branch": null, - "revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea", - "version": "2.1.1" + "revision": "3b123999de19bf04905bc1dfdb76f817b0f2cc00", + "version": "2.1.2" } }, { @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git", "state": { "branch": null, - "revision": "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688", - "version": "2.1.0" + "revision": "dc9af4781f2afdd1e68e90f80b8603be73ea7abc", + "version": "2.2.0" } }, { @@ -42,8 +42,8 @@ "repositoryURL": "https://github.com/mxcl/PromiseKit.git", "state": { "branch": null, - "revision": "43772616c46a44a9977e41924ae01d0e55f2f9ca", - "version": "6.18.1" + "revision": "8a98e31a47854d3180882c8068cc4d9381bf382d", + "version": "6.22.1" } }, { From 7a39573f49e33c9710d250f720252162d0c2c275 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 23:16:30 -0700 Subject: [PATCH 044/162] =?UTF-8?q?=F0=9F=8E=AF=20Rename=20package-install?= =?UTF-8?q?=20target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3028561..935a718 100644 --- a/Makefile +++ b/Makefile @@ -154,8 +154,8 @@ uninstall: ## Uninstalls the binary. package: build ## Packages the project. script/package -.PHONY: packageInstall -packageInstall: package ## Installs the package. +.PHONY: package-install +package-install: package ## Installs the package. script/package_install .PHONY: bottle From bb985c853ca853513e18bcc279fe7edac146c679 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 23:30:26 -0700 Subject: [PATCH 045/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20incomplete=20br?= =?UTF-8?q?ew=5Fupdate=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_update | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100755 script/brew_update diff --git a/script/brew_update b/script/brew_update deleted file mode 100755 index a6ce2eb..0000000 --- a/script/brew_update +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e -# -# script/build_artifacts -# mas -# -# Runs all related scripts for generating all artifacts. -# - -MAS_VERSION=$(script/version) - -echo "Updating mas $MAS_VERSION Homebrew formula" - -script/brew_formula_update -script/bottle From 4a9626d03002019640f674af2803fcfceecaf3b7 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 18 Feb 2024 23:31:03 -0700 Subject: [PATCH 046/162] =?UTF-8?q?=F0=9F=9A=A7=20brew=5Fformula=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 10 +++++++++- script/brew_formula_update | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 935a718..0744125 100644 --- a/Makefile +++ b/Makefile @@ -159,5 +159,13 @@ package-install: package ## Installs the package. script/package_install .PHONY: bottle -bottle: ## Builds Homebrew bottle for the current system. +bottle: ## Builds Homebrew bottles. script/bottle + +.PHONY: brew_formula_update +brew_formula_update: ## Updates homebrew-core formula. + script/brew_formula_update + +.PHONY: brew_release_validate +brew_release_validate: ## Builds Homebrew bottle for the current system. + script/brew_release_validate diff --git a/script/brew_formula_update b/script/brew_formula_update index f4e3948..2502ca2 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -12,7 +12,7 @@ BREW_CORE_PATH="$(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula" function usage { - echo "Usage: brew_formula_bump [v1.0] [sha1_hash]" + echo "Usage: brew_formula_update [v1.0] [sha1_hash]" echo "- version will be inferred using version script if not provided" echo "- sha will be inferred from the current commit if not provided" exit 1 @@ -32,6 +32,10 @@ else REVISION=$(git rev-parse "$MAS_VERSION") fi +if test ! -f "$BREW_CORE_PATH/mas.rb"; then + brew install mas +fi + echo "Checking to see if this update can be a simple bump." diff "Homebrew/mas.rb" "$BREW_CORE_PATH/mas.rb" From e5b471d03ee217987f90e4bd6d81c9b210d0059a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Mar 2024 21:35:52 -0700 Subject: [PATCH 047/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Set=20CORE=5FFORMU?= =?UTF-8?q?LA=5FPATH=20using=20brew=20=E2=80=94repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 2502ca2..e43511a 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -9,7 +9,7 @@ # brew bump-formula-pr --help # -BREW_CORE_PATH="$(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula" +CORE_FORMULA_PATH="$(brew --repository homebrew/core)/Formula" function usage { echo "Usage: brew_formula_update [v1.0] [sha1_hash]" @@ -32,12 +32,12 @@ else REVISION=$(git rev-parse "$MAS_VERSION") fi -if test ! -f "$BREW_CORE_PATH/mas.rb"; then +if test ! -f "$CORE_FORMULA_PATH/mas.rb"; then brew install mas fi echo "Checking to see if this update can be a simple bump." -diff "Homebrew/mas.rb" "$BREW_CORE_PATH/mas.rb" +diff "Homebrew/mas.rb" "$CORE_FORMULA_PATH/mas.rb" # diff exit status status=$? @@ -64,7 +64,7 @@ if test $status -ne 0; then exit $status fi -pushd "$BREW_CORE_PATH" || exit 2 +pushd "$CORE_FORMULA_PATH" || exit 2 echo "Updating formula" if test $formula_revisions -eq 1; then From f76c19fdc4a1da4f36b4b2d1d42992c91e11d33a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Mar 2024 21:43:58 -0700 Subject: [PATCH 048/162] =?UTF-8?q?=F0=9F=8C=8D=20Enable=20HOMEBREW=5FNO?= =?UTF-8?q?=5FINSTALL=5FFROM=5FAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/brew_formula_update b/script/brew_formula_update index e43511a..4ce8f99 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -32,6 +32,10 @@ else REVISION=$(git rev-parse "$MAS_VERSION") fi +# Force brew to use the local repository instead of the API. +# Disable API before any install, reinstall or upgrade commands. +export HOMEBREW_NO_INSTALL_FROM_API=1 + if test ! -f "$CORE_FORMULA_PATH/mas.rb"; then brew install mas fi From 4ef176cbc76a47c494ddf938a037e856443a9d62 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 08:17:50 -0700 Subject: [PATCH 049/162] =?UTF-8?q?=F0=9F=A9=B9=20Remove=20extra=20end=20p?= =?UTF-8?q?aren=20from=20CURRENT=5FOS=5FVERSION=5FMINOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/bottle b/script/bottle index b4daad6..7f002ab 100755 --- a/script/bottle +++ b/script/bottle @@ -37,7 +37,7 @@ OS_NAMES=( ) # Semantic version number split into a list using Ugly, bash 3 compatible syntax -IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ /g'))" +IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ /g')" CURRENT_OS_VERSION_MAJOR=${CURRENT_OS_VERSION[0]} CURRENT_OS_VERSION_MINOR=${CURRENT_OS_VERSION[1]} From 5f3692693ed06d0ab41bf62f2663d011776e4366 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 08:33:05 -0700 Subject: [PATCH 050/162] =?UTF-8?q?=F0=9F=94=A8=20Ensure=20a=20clean=20tap?= =?UTF-8?q?=20of=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 4ce8f99..77dd935 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -9,7 +9,9 @@ # brew bump-formula-pr --help # -CORE_FORMULA_PATH="$(brew --repository homebrew/core)/Formula" +CORE_TAP_PATH="$(brew --repository homebrew/core)" +CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" +MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/mas.rb" function usage { echo "Usage: brew_formula_update [v1.0] [sha1_hash]" @@ -36,12 +38,18 @@ fi # Disable API before any install, reinstall or upgrade commands. export HOMEBREW_NO_INSTALL_FROM_API=1 -if test ! -f "$CORE_FORMULA_PATH/mas.rb"; then +# Ensure core is tapped and clean +if test -d "${CORE_TAP_PATH}"; then + brew untap homebrew/core +fi +brew tap homebrew/core + +if test ! -f "${MAS_FORMULA_PATH}"; then brew install mas fi echo "Checking to see if this update can be a simple bump." -diff "Homebrew/mas.rb" "$CORE_FORMULA_PATH/mas.rb" +diff "Homebrew/mas.rb" "${MAS_FORMULA_PATH}" # diff exit status status=$? From 405b8d65b5c77a0a2c1b07b19d29e04bddc24f37 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 08:40:08 -0700 Subject: [PATCH 051/162] =?UTF-8?q?=F0=9F=91=BD=20Update=20MAS=5FFORMULA?= =?UTF-8?q?=5FPATH=20in=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 77dd935..d4ecdaa 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -11,7 +11,7 @@ CORE_TAP_PATH="$(brew --repository homebrew/core)" CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" -MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/mas.rb" +MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" function usage { echo "Usage: brew_formula_update [v1.0] [sha1_hash]" From 124ad1e7105dad9a78b7bd317b824648aeef4ceb Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 10:22:19 -0700 Subject: [PATCH 052/162] =?UTF-8?q?=F0=9F=91=94=20Tap=20core=20only=20when?= =?UTF-8?q?=20missing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index d4ecdaa..3027ffe 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -14,19 +14,25 @@ CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" function usage { - echo "Usage: brew_formula_update [v1.0] [sha1_hash]" + echo "Usage: brew_formula_update [0.0] [sha1_hash]" echo "- version will be inferred using version script if not provided" echo "- sha will be inferred from the current commit if not provided" exit 1 } +if [[ $# -gt 3 ]]; then + usage +fi + # arg 1 - version tag if test -n "$1"; then - MAS_VERSION="$1" + MAS_VERSION="v$1" else MAS_VERSION="v$(script/version)" fi +echo "MAS_VERSION: $MAS_VERSION" + # arg 2 - revision (commit hash) if test -n "$2"; then REVISION="$2" @@ -34,15 +40,16 @@ else REVISION=$(git rev-parse "$MAS_VERSION") fi +echo "REVISION: $REVISION" + # Force brew to use the local repository instead of the API. # Disable API before any install, reinstall or upgrade commands. export HOMEBREW_NO_INSTALL_FROM_API=1 -# Ensure core is tapped and clean +# Ensure core is tapped if test -d "${CORE_TAP_PATH}"; then - brew untap homebrew/core + brew tap homebrew/core fi -brew tap homebrew/core if test ! -f "${MAS_FORMULA_PATH}"; then brew install mas From 1d046268a6207d00657ee4841f70bfcbcc4a3115 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 10:36:03 -0700 Subject: [PATCH 053/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=20Add=20brew?= =?UTF-8?q?=5Fformula=5Fupdate=20to=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2cc7641..dacb963 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,3 +40,6 @@ jobs: name: homebrew-bottles path: | .build/bottles/mas-*.bottle.tar.gz + + - name: 🍺 Update Homebrew mas formula + run: script/brew_formula_update From d932b8c2941cd5b3bd5a08e9a4de0abeb68367b6 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 10:36:27 -0700 Subject: [PATCH 054/162] =?UTF-8?q?=F0=9F=94=A8=20Fix=20core=20tap=20detec?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 4 ++-- script/version | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 3027ffe..56b3f93 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -47,11 +47,11 @@ echo "REVISION: $REVISION" export HOMEBREW_NO_INSTALL_FROM_API=1 # Ensure core is tapped -if test -d "${CORE_TAP_PATH}"; then +if ! test -d "${CORE_TAP_PATH}"; then brew tap homebrew/core fi -if test ! -f "${MAS_FORMULA_PATH}"; then +if ! test -f "${MAS_FORMULA_PATH}"; then brew install mas fi diff --git a/script/version b/script/version index 21756bb..5107dd8 100755 --- a/script/version +++ b/script/version @@ -12,7 +12,7 @@ if git describe >/dev/null 2>&1; then MAS_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || true) else - MAS_VERSION=0.0.0 + MAS_VERSION=1.0.0 fi MAS_VERSION=${MAS_VERSION#v} echo "${MAS_VERSION}" From a8868300f57a000a0395b245b523b66ee53a2944 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 10:50:35 -0700 Subject: [PATCH 055/162] =?UTF-8?q?=F0=9F=94=A8=20Add=20brew=5Fbuild=5Fint?= =?UTF-8?q?eractive=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_build_interactive | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 script/brew_build_interactive diff --git a/script/brew_build_interactive b/script/brew_build_interactive new file mode 100755 index 0000000..90947b0 --- /dev/null +++ b/script/brew_build_interactive @@ -0,0 +1,11 @@ +#!/bin/bash -e +# +# script/brew_build_interactive +# mas +# +# https://docs.brew.sh/Formula-Cookbook#check-the-build-system +# + +HOMEBREW_NO_INSTALL_FROM_API=1 \ + brew reinstall \ + --interactive mas From 80c85f5200dfce4a42de0b8a8cc5166caabe3897 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 11:22:34 -0700 Subject: [PATCH 056/162] =?UTF-8?q?=F0=9F=91=80=20Add=20Package.swift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - Sources/MasKit/Package.swift | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Sources/MasKit/Package.swift diff --git a/.gitignore b/.gitignore index f34cb71..f274733 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,3 @@ gha/ default.profraw releases/ xcuserdata -Sources/MasKit/Package.swift diff --git a/Sources/MasKit/Package.swift b/Sources/MasKit/Package.swift new file mode 100644 index 0000000..eb9441f --- /dev/null +++ b/Sources/MasKit/Package.swift @@ -0,0 +1,4 @@ +// Generated by: script/version +enum Package { + static let version = "1.8.6" +} From 67e678452ffe94deb109570aff3e8309306d2201 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 11:23:14 -0700 Subject: [PATCH 057/162] =?UTF-8?q?=F0=9F=94=A8=20Add=20version=5Fbump=20s?= =?UTF-8?q?cript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved swift package manifest manipulation out of version script --- script/version | 9 --------- script/version_bump | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) create mode 100755 script/version_bump diff --git a/script/version b/script/version index 5107dd8..d954703 100755 --- a/script/version +++ b/script/version @@ -16,12 +16,3 @@ else fi MAS_VERSION=${MAS_VERSION#v} echo "${MAS_VERSION}" - -SCRIPT_PATH=$(dirname "$(which "$0")") - -cat <"${SCRIPT_PATH}/../Sources/MasKit/Package.swift" -// Generated by: script/version -enum Package { - static let version = "${MAS_VERSION}" -} -EOF diff --git a/script/version_bump b/script/version_bump new file mode 100755 index 0000000..0ecdb4c --- /dev/null +++ b/script/version_bump @@ -0,0 +1,35 @@ +#!/bin/bash -e +# +# script/version_bump +# mas +# +# Increments the marketing version of mas. +# + +last_tag=$(script/version) +echo "Last git tag: $last_tag" + +# arg 1 - version tag +if test -n "$1"; then + # auto-increment + MAS_VERSION=$1 +else + next_tag=$last_tag + MAS_VERSION=$next_tag +fi + +echo "MAS_VERSION: $MAS_VERSION" + +# Write new version into swift package +SCRIPT_PATH=$(dirname "$(which "$0")") +PACKAGE_MANIFEST="${SCRIPT_PATH}/../Sources/MasKit/Package.swift" +cat <"${PACKAGE_MANIFEST}" +// Generated by: script/version +enum Package { + static let version = "${MAS_VERSION}" +} +EOF + +echo +cat "${PACKAGE_MANIFEST}" + From e753f23b3f753034b14d2169fd3fcb27791b60b1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 11:27:13 -0700 Subject: [PATCH 058/162] =?UTF-8?q?=F0=9F=94=8A=20Log=20release=20event=20?= =?UTF-8?q?details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dacb963..0066da4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,12 +5,19 @@ name: release on: push: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release release: types: [published] jobs: release: runs-on: macos-14 steps: + + - run: | + echo "release event" + echo "Name: ${{ github.event.release.name }}" + echo "Description: ${{ github.event.release.body }}" + - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version From cc07b31d92abaf1de7397b564a5927e9fab6fcc1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 12:32:04 -0700 Subject: [PATCH 059/162] =?UTF-8?q?=F0=9F=94=8A=20Log=20dry=20vs=20wet=20r?= =?UTF-8?q?un?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0066da4..a3b0ed7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ --- name: release on: + # The `push` event is used only for testing while making changes to this workflow. + # This will be detected by the `github.event.release.name` being empty which + # switches the logic into "dry run" mode. + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push push: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release release: @@ -13,10 +17,23 @@ jobs: runs-on: macos-14 steps: - - run: | - echo "release event" - echo "Name: ${{ github.event.release.name }}" - echo "Description: ${{ github.event.release.body }}" + # Logs event details and sets `DRY_RUN` env var + # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable + - name: 🔈 Log release event + if: ${{ github.event.release.name != '' }} + run: | + echo "Triggered by a release publication event (wet run)" + echo "release.name: ${{ github.event.release.name }}" + echo "release.body: ${{ github.event.release.body }}" + echo "DRY_RUN=false" >> $GITHUB_ENV + - name: 🚩 Enable dry run + if: ${{ github.event.release.name == '' }} + run: | + echo "dry run" + echo "DRY_RUN=true" >> $GITHUB_ENV + - name: 🔈 Log dry run + run: | + echo "DRY_RUN: ${DRY_RUN}" - uses: actions/checkout@v4 with: From e30cacbdf2818b7fc8f9e3526b76982d60865d7c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 12:52:37 -0700 Subject: [PATCH 060/162] =?UTF-8?q?=F0=9F=9A=A9=20Default=20DRY=5FRUN=20to?= =?UTF-8?q?=20true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3b0ed7..424a661 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,8 @@ on: jobs: release: runs-on: macos-14 + env: + DRY_RUN: true steps: # Logs event details and sets `DRY_RUN` env var @@ -25,12 +27,7 @@ jobs: echo "Triggered by a release publication event (wet run)" echo "release.name: ${{ github.event.release.name }}" echo "release.body: ${{ github.event.release.body }}" - echo "DRY_RUN=false" >> $GITHUB_ENV - - name: 🚩 Enable dry run - if: ${{ github.event.release.name == '' }} - run: | - echo "dry run" - echo "DRY_RUN=true" >> $GITHUB_ENV + echo "DRY_RUN=false" >>$GITHUB_ENV - name: 🔈 Log dry run run: | echo "DRY_RUN: ${DRY_RUN}" @@ -50,6 +47,7 @@ jobs: run: script/package - name: 🚀 Upload mas.pkg uses: actions/upload-artifact@v3 + if: ${{ env.DRY_RUN == 'false' }} with: if-no-files-found: error name: mas.pkg @@ -59,6 +57,7 @@ jobs: run: script/bottle - name: 🚀 Upload Bottles uses: actions/upload-artifact@v3 + if: ${{ env.DRY_RUN == 'false' }} with: if-no-files-found: error name: homebrew-bottles From d321c2b1e9104ece0ff6f94a29727e5cc601f98a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 12:56:35 -0700 Subject: [PATCH 061/162] =?UTF-8?q?=F0=9F=94=A7=20Run=20bash=20outside=20R?= =?UTF-8?q?osetta=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)! --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 424a661..73921b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,10 @@ on: jobs: release: runs-on: macos-14 + defaults: + run: + # Prefixes all `run` commands with the following command to force them to run outside Rosetta. + shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} env: DRY_RUN: true steps: From 72042aa1ba498eedd06ba52c95c19d70bee596b9 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 9 Mar 2024 13:11:14 -0700 Subject: [PATCH 062/162] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20act=20(0.2.60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index 8808927..f502ff5 100644 --- a/.mise.toml +++ b/.mise.toml @@ -4,7 +4,7 @@ # [tools] -act = "0.2.59" +act = "0.2.60" "npm:prettier" = "3.2.5" yamllint = "1.35.1" From 6a80ac3702d61e5cdc8cc11c538a12d8f454f92e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 08:06:51 -0600 Subject: [PATCH 063/162] =?UTF-8?q?=E2=9E=95=20sd=20(1.0.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Brewfile | 1 + Brewfile.lock.json | 144 +++++++++++++++++++++++++++++---------------- 2 files changed, 95 insertions(+), 50 deletions(-) diff --git a/Brewfile b/Brewfile index 54e9332..7aa6f5f 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,6 @@ brew "markdownlint-cli" brew "mise" +brew "sd" brew "shellcheck" brew "shfmt" brew "swiftformat" diff --git a/Brewfile.lock.json b/Brewfile.lock.json index b8b7a40..af635aa 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -46,89 +46,133 @@ } }, "mise": { - "version": "2024.2.16", + "version": "2024.3.1", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:cf2658e28f73f665dffee065fe2d5d937428b84a946045729261eb1d909097ab", - "sha256": "cf2658e28f73f665dffee065fe2d5d937428b84a946045729261eb1d909097ab" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:c2243fa2e76a710d882b2ee3a7430c2ff2d22be0a299a7848a4be9cab3931483", + "sha256": "c2243fa2e76a710d882b2ee3a7430c2ff2d22be0a299a7848a4be9cab3931483" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:9b33461f6e4d3dec5874d3cf33ba2f50c56405a4a1614702413714ece30aeca9", - "sha256": "9b33461f6e4d3dec5874d3cf33ba2f50c56405a4a1614702413714ece30aeca9" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:132f9bffe79baee2560b6d1585485dfd63891c7f786690ba460956f7803298fa", + "sha256": "132f9bffe79baee2560b6d1585485dfd63891c7f786690ba460956f7803298fa" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:118252faee191298da1484d2a0e9fb4e9db88a02616b73a08f060941332d840f", - "sha256": "118252faee191298da1484d2a0e9fb4e9db88a02616b73a08f060941332d840f" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:f58e42399f4d39272b1eda361ea18b7afb91fe56d93c1d7689b3b5cf13df6dbf", + "sha256": "f58e42399f4d39272b1eda361ea18b7afb91fe56d93c1d7689b3b5cf13df6dbf" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:ccbcdc667eb9ebfaea72708a299d4377d426c6bc269476cb8517f1a7e2fd30a0", - "sha256": "ccbcdc667eb9ebfaea72708a299d4377d426c6bc269476cb8517f1a7e2fd30a0" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:ee7eece11a1db1ab2ce2b9c6b7b49ec64a9f7ed3a3b3c59fb6440ebf341f249c", + "sha256": "ee7eece11a1db1ab2ce2b9c6b7b49ec64a9f7ed3a3b3c59fb6440ebf341f249c" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:5c8ca4220d2ad61e1f55a618a2060da4db64cde0fcb70a09aa4cddee48f35766", - "sha256": "5c8ca4220d2ad61e1f55a618a2060da4db64cde0fcb70a09aa4cddee48f35766" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:9b9b95abef174fa48dab6c996a56a9a1217e435436c9f62be23cd7533bc732f2", + "sha256": "9b9b95abef174fa48dab6c996a56a9a1217e435436c9f62be23cd7533bc732f2" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:264e93049b3665c1068f693929fb53e7015ce8b9811080ecfa78b6a94721b2e0", - "sha256": "264e93049b3665c1068f693929fb53e7015ce8b9811080ecfa78b6a94721b2e0" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:8d21135e20ec4fcf07c27f35075dafd999bbfef927f55661ac2f0e8be2d27741", + "sha256": "8d21135e20ec4fcf07c27f35075dafd999bbfef927f55661ac2f0e8be2d27741" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:503709469df1ccf64a42386bd933d8f307b9c52d3e2bc77106ed96bf06c369c8", - "sha256": "503709469df1ccf64a42386bd933d8f307b9c52d3e2bc77106ed96bf06c369c8" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:8c8910125f93c06e70669a396272165a06108022bd49efcdf4fefbc07eef6f2c", + "sha256": "8c8910125f93c06e70669a396272165a06108022bd49efcdf4fefbc07eef6f2c" + } + } + } + }, + "sd": { + "version": "1.0.0", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:6bc773a70934364157591cd888e617601a42ed1f615fda8f77364fa45631d08d", + "sha256": "6bc773a70934364157591cd888e617601a42ed1f615fda8f77364fa45631d08d" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:946a44f567e3528d380fbbee742c3abeed9952f53f7de172a846b63d2e21d5b1", + "sha256": "946a44f567e3528d380fbbee742c3abeed9952f53f7de172a846b63d2e21d5b1" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:60f079d38aa238a1e7109c6a0f988fe7033449d20f05db3b87219cbfd945fe58", + "sha256": "60f079d38aa238a1e7109c6a0f988fe7033449d20f05db3b87219cbfd945fe58" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:f83ebe2505106e8c94c4b92d15c0ac3390dc637039043dbafad3e382fa8c61b0", + "sha256": "f83ebe2505106e8c94c4b92d15c0ac3390dc637039043dbafad3e382fa8c61b0" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:0200b81c386198d39ed7b03e85c771e141d9604075d82aa4caed5d5a775486c8", + "sha256": "0200b81c386198d39ed7b03e85c771e141d9604075d82aa4caed5d5a775486c8" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:a8fee9e7b0202a27d8dcc599ebd391637107134f139dbe88d6b22c880e63d8a1", + "sha256": "a8fee9e7b0202a27d8dcc599ebd391637107134f139dbe88d6b22c880e63d8a1" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/sd/blobs/sha256:4c098bdfaff013f7a6b6b96a65b9cfef86926e1cd901b363e1bdb84734ee6e3f", + "sha256": "4c098bdfaff013f7a6b6b96a65b9cfef86926e1cd901b363e1bdb84734ee6e3f" } } } }, "shellcheck": { - "version": "0.9.0", + "version": "0.10.0", "bottle": { - "rebuild": 1, + "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:0688df1adf51536205cde96e4910b26c88b10eb2f967a8255c726f9d0cb57d2a", - "sha256": "0688df1adf51536205cde96e4910b26c88b10eb2f967a8255c726f9d0cb57d2a" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:ef742b6992cfcdcd7289718ac64b27174e421d29ce3ad9b81e1856349059b117", + "sha256": "ef742b6992cfcdcd7289718ac64b27174e421d29ce3ad9b81e1856349059b117" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:42ac0d4c4c44a3fd85a52caa0d655c32f28e609713530ba69a52d182b61351e4", - "sha256": "42ac0d4c4c44a3fd85a52caa0d655c32f28e609713530ba69a52d182b61351e4" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:6e60ee03edb09ac5bc852b8eb813849fa654400e21ffb4c746989678172f5a26", + "sha256": "6e60ee03edb09ac5bc852b8eb813849fa654400e21ffb4c746989678172f5a26" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:4d9fc87309f3997d443d5a5e2c6ec72f3586cbeecdeb002f52f64414f106110e", - "sha256": "4d9fc87309f3997d443d5a5e2c6ec72f3586cbeecdeb002f52f64414f106110e" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:d5e8407806dbf757e71930ce2cb9b0d23bae286f0c058d9ff246d851dd7aa871", + "sha256": "d5e8407806dbf757e71930ce2cb9b0d23bae286f0c058d9ff246d851dd7aa871" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:dec4133905b1115275e6ce2d9cd5ef966cbac0e5912fc32e3c89356922ea0ec1", - "sha256": "dec4133905b1115275e6ce2d9cd5ef966cbac0e5912fc32e3c89356922ea0ec1" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:b53cf1e5464406ee49743fc2db84850b6d34d3a2098cf729e629b23f9d6dd6e0", + "sha256": "b53cf1e5464406ee49743fc2db84850b6d34d3a2098cf729e629b23f9d6dd6e0" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:89d1c2a187c42d41e99856895989e2bf57a9f82e8a0265dd30d3f417baf273dd", - "sha256": "89d1c2a187c42d41e99856895989e2bf57a9f82e8a0265dd30d3f417baf273dd" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:15ba88c48a5ae3b08e085791e3c5e514d9d78ce88414c96bd21ed33f29fb4aca", + "sha256": "15ba88c48a5ae3b08e085791e3c5e514d9d78ce88414c96bd21ed33f29fb4aca" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:f1506e3dfd48ac61184f37b5b6cb48328018bc37e415f78dd4348d2730ad9cf7", - "sha256": "f1506e3dfd48ac61184f37b5b6cb48328018bc37e415f78dd4348d2730ad9cf7" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:b3d14cb62e325d0f7221cd24a7fb4533936feae4ed4dce00e8983ec6e55123f8", + "sha256": "b3d14cb62e325d0f7221cd24a7fb4533936feae4ed4dce00e8983ec6e55123f8" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:d0f7c834a0266325e8dab25a04aeadc67664701b767d3ed2529286fb0fb66823", - "sha256": "d0f7c834a0266325e8dab25a04aeadc67664701b767d3ed2529286fb0fb66823" + "url": "https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:6d0867f144686a5caa025cb15ecac49286654b78e7b89979a54eedc9a0cc9b6b", + "sha256": "6d0867f144686a5caa025cb15ecac49286654b78e7b89979a54eedc9a0cc9b6b" } } } @@ -178,45 +222,45 @@ } }, "swiftformat": { - "version": "0.53.2", + "version": "0.53.4", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:e23df7cc20f91e8a54c665b5da4952f13d53cfa658751ed9d6efbbec39f425fd", - "sha256": "e23df7cc20f91e8a54c665b5da4952f13d53cfa658751ed9d6efbbec39f425fd" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:97458313969207e9c5bd456f826573350ab3b9ca2fdaa53561cb8a07e31b354f", + "sha256": "97458313969207e9c5bd456f826573350ab3b9ca2fdaa53561cb8a07e31b354f" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:bf9654736aac1bcd6201d42277f5feaa261bf82e54dc75277cccc6f001b04657", - "sha256": "bf9654736aac1bcd6201d42277f5feaa261bf82e54dc75277cccc6f001b04657" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:77ac50bf35361686eb90a857fbe24ae8b90d30fea9631b155418c70835c7f550", + "sha256": "77ac50bf35361686eb90a857fbe24ae8b90d30fea9631b155418c70835c7f550" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:b9e78f333f16c6ef8eaf00c9f56685d90c455552e49691473a6e8184256bfd38", - "sha256": "b9e78f333f16c6ef8eaf00c9f56685d90c455552e49691473a6e8184256bfd38" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:b3c4fffad70c3844ca7551629fb0b4bef694d4ba3ae861895d9ea67b7602bb30", + "sha256": "b3c4fffad70c3844ca7551629fb0b4bef694d4ba3ae861895d9ea67b7602bb30" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:d6aba634d12b4e23da0c4cb5f8d7d1b36036fd966f243764b5c624a4bf57a794", - "sha256": "d6aba634d12b4e23da0c4cb5f8d7d1b36036fd966f243764b5c624a4bf57a794" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:1766d47e2caa79a65aa2bb2d7bf4981a6ce8413d4f4b99e798b2cac930d2917d", + "sha256": "1766d47e2caa79a65aa2bb2d7bf4981a6ce8413d4f4b99e798b2cac930d2917d" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ac23688353c12e6e50a4f6ad388232ae7ef23c849ad7280c97ede5c6a2ec3b0b", - "sha256": "ac23688353c12e6e50a4f6ad388232ae7ef23c849ad7280c97ede5c6a2ec3b0b" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:32596ab299daf61a756c09d055bc4bdc5d63b190787c1432fdbffa8236a2e964", + "sha256": "32596ab299daf61a756c09d055bc4bdc5d63b190787c1432fdbffa8236a2e964" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:ba227da0de2d6451e1407acc3b447f035578deb7c8f8bcd78645309cc9423e79", - "sha256": "ba227da0de2d6451e1407acc3b447f035578deb7c8f8bcd78645309cc9423e79" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:445e31123eddec655474956d1b3a3f81676ecf1d63a227fe891016b673e4c3dc", + "sha256": "445e31123eddec655474956d1b3a3f81676ecf1d63a227fe891016b673e4c3dc" }, "x86_64_linux": { "cellar": "/home/linuxbrew/.linuxbrew/Cellar", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:f1c2591afe87f93ff9db7b9bf755200b41e9eb14ae0641cd6290cb85e597c467", - "sha256": "f1c2591afe87f93ff9db7b9bf755200b41e9eb14ae0641cd6290cb85e597c467" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:15bb574d7afea06b1cefee619fb33c7dd135c3c85bce2c02fc4ee6989f578501", + "sha256": "15bb574d7afea06b1cefee619fb33c7dd135c3c85bce2c02fc4ee6989f578501" } } } @@ -239,12 +283,12 @@ "system": { "macos": { "sonoma": { - "HOMEBREW_VERSION": "4.2.8-158-g5d3fae3", + "HOMEBREW_VERSION": "4.2.11-103-gcd1f040", "HOMEBREW_PREFIX": "/opt/homebrew", "Homebrew/homebrew-core": "api", - "CLT": "15.1.0.0.1.1700200546", - "Xcode": "15.2", - "macOS": "14.3.1" + "CLT": "15.3.0.0.1.1708646388", + "Xcode": "15.3", + "macOS": "14.4" } } } From a0e941799d10c74fd451d85ea81afc39d6cb2ad2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 08:07:39 -0600 Subject: [PATCH 064/162] =?UTF-8?q?=F0=9F=94=A8=20Write=20new=20version=20?= =?UTF-8?q?in=20brew=20formulae?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version_bump | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/script/version_bump b/script/version_bump index 0ecdb4c..84e725a 100755 --- a/script/version_bump +++ b/script/version_bump @@ -6,23 +6,43 @@ # Increments the marketing version of mas. # + +# SCRIPT_PATH=$(dirname "$(which "$0")") +PROJECT_PATH="$(git rev-parse --show-toplevel)" +PACKAGE_MANIFEST="${PROJECT_PATH}/Sources/MasKit/Package.swift" +LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" +LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" + +function usage { + echo "Usage: version_bump v0.0 [sha1_hash]" + echo "- existing tag name" + echo "- sha will be inferred from the given tag if not provided" + exit 1 +} + +if [[ $# -lt 1 ]]; then + usage +fi + last_tag=$(script/version) echo "Last git tag: $last_tag" # arg 1 - version tag if test -n "$1"; then - # auto-increment MAS_VERSION=$1 +fi + +# arg 2 - revision (commit hash) +if test -n "$2"; then + REVISION="$2" else - next_tag=$last_tag - MAS_VERSION=$next_tag + REVISION=$(git rev-parse "$MAS_VERSION") fi echo "MAS_VERSION: $MAS_VERSION" +echo "REVISION: $REVISION" # Write new version into swift package -SCRIPT_PATH=$(dirname "$(which "$0")") -PACKAGE_MANIFEST="${SCRIPT_PATH}/../Sources/MasKit/Package.swift" cat <"${PACKAGE_MANIFEST}" // Generated by: script/version enum Package { @@ -33,3 +53,12 @@ EOF echo cat "${PACKAGE_MANIFEST}" +# Write new version into brew formulae +for file in $LOCAL_MAS_FORMULA_PATH $LOCAL_TAP_FORMULA_PATH; do + echo "$file" + # echo sed -i "5s/(\w+tag:\w+\"\)v[^\"]\",/$0$MAS_VERSION\"/" "$file" + # sed -i '' -E "s/(\w+tag:\w+\")v,/\1$MAS_VERSION\"/" "$file" + sd '( +tag: +)"[^"]+"' "\$1\"$MAS_VERSION\"" "$file" + sd '( +revision: +)"[^"]+"' "\$1\"$REVISION\"" "$file" +done + From da8142dc99a25f0b596c26b778dc2fcc1b2462d4 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 09:03:03 -0600 Subject: [PATCH 065/162] =?UTF-8?q?=F0=9F=94=A8=20Trigger=20version=5Fbump?= =?UTF-8?q?,=20create=20branch,=20commit=20in=20brew=5Fformula=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 168 ++++++++++++++++++++++++++++++++----- script/version | 2 +- script/version_bump | 2 +- 3 files changed, 150 insertions(+), 22 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 56b3f93..61f502f 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -11,7 +11,7 @@ CORE_TAP_PATH="$(brew --repository homebrew/core)" CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" -MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" +CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" function usage { echo "Usage: brew_formula_update [0.0] [sha1_hash]" @@ -26,7 +26,7 @@ fi # arg 1 - version tag if test -n "$1"; then - MAS_VERSION="v$1" + MAS_VERSION="$1" else MAS_VERSION="v$(script/version)" fi @@ -42,38 +42,162 @@ fi echo "REVISION: $REVISION" -# Force brew to use the local repository instead of the API. -# Disable API before any install, reinstall or upgrade commands. -export HOMEBREW_NO_INSTALL_FROM_API=1 +################################################################################ +# +# Update Version +# + +script/version_bump "$MAS_VERSION" "$REVISION" + +PROJECT_PATH="$(git rev-parse --show-toplevel)" +LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" + +git branch "releases/release-$MAS_VERSION" + +git add \ + "${PROJECT_PATH}/Sources/MasKit/Package.swift" \ + "${LOCAL_MAS_FORMULA_PATH}" \ + "${PROJECT_PATH}/Homebrew/mas-tap.rb" + +git commit --message="🔖 Version $MAS_VERSION" + +################################################################################ +# +# Preflight checks +# + +# Uninstall if necessary +brew remove mas 2>/dev/null || true +brew remove mas-cli/tap/mas 2>/dev/null || true + +# Uninstall if still found on path +if command -v mas >/dev/null; then + script/uninstall || true +fi # Ensure core is tapped if ! test -d "${CORE_TAP_PATH}"; then brew tap homebrew/core fi -if ! test -f "${MAS_FORMULA_PATH}"; then - brew install mas -fi +brew update +################################################################################ +# +# Build the formula for the current macOS version and architecture. +# + +# Force brew to use the local repository instead of the API. +# Disable API before any install, reinstall or upgrade commands. +export HOMEBREW_NO_INSTALL_FROM_API=1 + +# Install mas from source +brew reinstall mas + +# Audit formula +brew audit --strict mas-cli/tap/mas +brew style mas-cli/tap/mas + +################################################################################ +# +# Update Homebrew +# echo "Checking to see if this update can be a simple bump." -diff "Homebrew/mas.rb" "${MAS_FORMULA_PATH}" +diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" # diff exit status -status=$? -formula_revisions=0 -if test $status -ne 0; then - echo "There are changes in the local formula (Homebrew/mas.rb) that haven't been released yet." - #exit $status - formula_revisions=1 -fi +# status=$? +# formula_revisions=0 +# if test $status -ne 0; then +# echo "There are changes in the local formula (Homebrew/mas.rb) that haven't been released yet." +# #exit $status +# formula_revisions=1 +# fi echo "==> 🧪 Updating homebrew-core formula mas ($MAS_VERSION, $REVISION)" +# brew bump-formula-pr --help +# Usage: brew bump-formula-pr [options] [formula] + +# Create a pull request to update formula with a new URL or a new tag. + +# If a URL is specified, the SHA-256 checksum of the new download should also +# be specified. A best effort to determine the SHA-256 will be made if not +# supplied by the user. + +# If a tag is specified, the Git commit revision corresponding to that tag +# should also be specified. A best effort to determine the revision will be made +# if the value is not supplied by the user. + +# If a version is specified, a best effort to determine the URL and SHA-256 +# or the tag and revision will be made if both values are not supplied by the +# user. + +# Note: this command cannot be used to transition a formula from a +# URL-and-SHA-256 style specification into a tag-and-revision style specification, +# nor vice versa. It must use whichever style specification the formula already +# uses. + +# -n, --dry-run Print what would be done rather than doing +# it. +# --write-only Make the expected file modifications without +# taking any Git actions. +# --commit When passed with --write-only, generate a +# new commit after writing changes to the +# formula file. +# --no-audit Don't run brew audit before opening the PR. +# --strict Run brew audit --strict before opening the +# PR. +# --online Run brew audit --online before opening the +# PR. +# --no-browse Print the pull request URL instead of opening +# in a browser. +# --no-fork Don't try to fork the repository. +# --mirror Use the specified URL as a mirror URL. If +# URL is a comma-separated list of URLs, +# multiple mirrors will be added. +# --fork-org Use the specified GitHub organization for +# forking. +# --version Use the specified version to override the +# value parsed from the URL or tag. Note that +# --version=0 can be used to delete an +# existing version override from a formula if +# it has become redundant. +# --message Prepend message to the default pull request +# message. +# --url Specify the URL for the new download. If a +# URL is specified, the SHA-256 checksum of +# the new download should also be specified. +# --sha256 Specify the SHA-256 checksum of the new +# download. +# --tag Specify the new git commit tag for the +# formula. +# --revision Specify the new commit revision +# corresponding to the specified git tag or +# specified version. +# -f, --force Remove all mirrors if --mirror was not +# specified. +# --install-dependencies Install missing dependencies required to +# update resources. +# --python-package-name Use the specified package-name when finding +# Python resources for formula. If no package +# name is specified, it will be inferred from +# the formula's stable URL. +# --python-extra-packages Include these additional Python packages when +# finding resources. +# --python-exclude-packages Exclude these Python packages when finding +# resources. +# -d, --debug Display any debugging information. +# -q, --quiet Make some output more quiet. +# -v, --verbose Make some output more verbose. +# -h, --help Show this message. + echo "Validating formula" brew bump-formula-pr \ --tag="$MAS_VERSION" \ --revision="$REVISION" \ --strict \ + --verbose \ mas # brew exit status @@ -85,15 +209,19 @@ fi pushd "$CORE_FORMULA_PATH" || exit 2 +dry_run='' echo "Updating formula" -if test $formula_revisions -eq 1; then - # Options to - dry_run="--dry-run --write" -fi +# if test $formula_revisions -eq 1; then +# # Options to +# dry_run="--dry-run --write" +# fi brew bump-formula-pr \ --tag="$MAS_VERSION" \ --revision="$REVISION" \ + --commit \ + --fork-org mas-cli \ + --online \ --strict \ --verbose \ "$dry_run" \ diff --git a/script/version b/script/version index d954703..561b9e3 100755 --- a/script/version +++ b/script/version @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ue # # script/version # mas diff --git a/script/version_bump b/script/version_bump index 84e725a..1c09ddb 100755 --- a/script/version_bump +++ b/script/version_bump @@ -46,7 +46,7 @@ echo "REVISION: $REVISION" cat <"${PACKAGE_MANIFEST}" // Generated by: script/version enum Package { - static let version = "${MAS_VERSION}" + static let version = "${MAS_VERSION#v}" } EOF From 1fd27c12391c1678a2a0351475ad0f023f47b78c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 09:05:39 -0600 Subject: [PATCH 066/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Derive=20MAS=5FVERSION=20from=20release,?= =?UTF-8?q?=20pass=20to=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 14 ++++++++++++-- script/brew_formula_update | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73921b4..bb52ef0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,20 +21,30 @@ jobs: shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} env: DRY_RUN: true + MAS_VERSION: 0.0.0 + RELEASE_COMMIT: abcd steps: # Logs event details and sets `DRY_RUN` env var # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable + # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=published#release - name: 🔈 Log release event if: ${{ github.event.release.name != '' }} run: | echo "Triggered by a release publication event (wet run)" echo "release.name: ${{ github.event.release.name }}" + echo "release.tag_name: ${{ github.event.release.tag_name }}" + echo "release.target_commitish: ${{ github.event.release.target_commitish }}" echo "release.body: ${{ github.event.release.body }}" echo "DRY_RUN=false" >>$GITHUB_ENV - - name: 🔈 Log dry run + echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_REF} + echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_REF} + + - name: 🔈 Log environment variables run: | echo "DRY_RUN: ${DRY_RUN}" + echo "MAS_VERSION: ${MAS_VERSION}" + echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" - uses: actions/checkout@v4 with: @@ -69,4 +79,4 @@ jobs: .build/bottles/mas-*.bottle.tar.gz - name: 🍺 Update Homebrew mas formula - run: script/brew_formula_update + run: script/brew_formula_update ${{ env.MAS_VERSION }} diff --git a/script/brew_formula_update b/script/brew_formula_update index 61f502f..e76a02a 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -49,11 +49,12 @@ echo "REVISION: $REVISION" script/version_bump "$MAS_VERSION" "$REVISION" +git branch "releases/release-$MAS_VERSION" +git switch "releases/release-$MAS_VERSION" + PROJECT_PATH="$(git rev-parse --show-toplevel)" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" -git branch "releases/release-$MAS_VERSION" - git add \ "${PROJECT_PATH}/Sources/MasKit/Package.swift" \ "${LOCAL_MAS_FORMULA_PATH}" \ From 11734da12a08a2db05525d2dceb4a66fdc7c64de Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 09:23:53 -0600 Subject: [PATCH 067/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Create=20PR=20on=20mas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 154 +++++++++++-------------------------- 1 file changed, 45 insertions(+), 109 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index e76a02a..8956e7a 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -13,6 +13,11 @@ CORE_TAP_PATH="$(brew --repository homebrew/core)" CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" +PROJECT_PATH="$(git rev-parse --show-toplevel)" +SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" +LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" +LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" + function usage { echo "Usage: brew_formula_update [0.0] [sha1_hash]" echo "- version will be inferred using version script if not provided" @@ -25,42 +30,42 @@ if [[ $# -gt 3 ]]; then fi # arg 1 - version tag -if test -n "$1"; then - MAS_VERSION="$1" +if test -n "${1}"; then + MAS_VERSION="${1}" else MAS_VERSION="v$(script/version)" fi -echo "MAS_VERSION: $MAS_VERSION" +echo "MAS_VERSION: ${MAS_VERSION}" # arg 2 - revision (commit hash) -if test -n "$2"; then - REVISION="$2" +if test -n "${2}"; then + REVISION="${2}" else - REVISION=$(git rev-parse "$MAS_VERSION") + REVISION=$(git rev-parse "${MAS_VERSION}") fi -echo "REVISION: $REVISION" +echo "REVISION: ${REVISION}" ################################################################################ # # Update Version # -script/version_bump "$MAS_VERSION" "$REVISION" +script/version_bump "${MAS_VERSION}" "$REVISION" -git branch "releases/release-$MAS_VERSION" -git switch "releases/release-$MAS_VERSION" +cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" -PROJECT_PATH="$(git rev-parse --show-toplevel)" -LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" +branch_name="releases/release-${MAS_VERSION}" +git branch "${branch_name}" +git switch "${branch_name}" git add \ - "${PROJECT_PATH}/Sources/MasKit/Package.swift" \ + "${SWIFT_PACKAGE}" \ "${LOCAL_MAS_FORMULA_PATH}" \ - "${PROJECT_PATH}/Homebrew/mas-tap.rb" + "${LOCAL_TAP_FORMULA_PATH}" -git commit --message="🔖 Version $MAS_VERSION" +git commit --message="🔖 Version ${MAS_VERSION}" ################################################################################ # @@ -106,109 +111,24 @@ brew style mas-cli/tap/mas echo "Checking to see if this update can be a simple bump." diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" -# diff exit status -# status=$? -# formula_revisions=0 -# if test $status -ne 0; then -# echo "There are changes in the local formula (Homebrew/mas.rb) that haven't been released yet." -# #exit $status -# formula_revisions=1 -# fi - -echo "==> 🧪 Updating homebrew-core formula mas ($MAS_VERSION, $REVISION)" - -# brew bump-formula-pr --help -# Usage: brew bump-formula-pr [options] [formula] - -# Create a pull request to update formula with a new URL or a new tag. - -# If a URL is specified, the SHA-256 checksum of the new download should also -# be specified. A best effort to determine the SHA-256 will be made if not -# supplied by the user. - -# If a tag is specified, the Git commit revision corresponding to that tag -# should also be specified. A best effort to determine the revision will be made -# if the value is not supplied by the user. - -# If a version is specified, a best effort to determine the URL and SHA-256 -# or the tag and revision will be made if both values are not supplied by the -# user. - -# Note: this command cannot be used to transition a formula from a -# URL-and-SHA-256 style specification into a tag-and-revision style specification, -# nor vice versa. It must use whichever style specification the formula already -# uses. - -# -n, --dry-run Print what would be done rather than doing -# it. -# --write-only Make the expected file modifications without -# taking any Git actions. -# --commit When passed with --write-only, generate a -# new commit after writing changes to the -# formula file. -# --no-audit Don't run brew audit before opening the PR. -# --strict Run brew audit --strict before opening the -# PR. -# --online Run brew audit --online before opening the -# PR. -# --no-browse Print the pull request URL instead of opening -# in a browser. -# --no-fork Don't try to fork the repository. -# --mirror Use the specified URL as a mirror URL. If -# URL is a comma-separated list of URLs, -# multiple mirrors will be added. -# --fork-org Use the specified GitHub organization for -# forking. -# --version Use the specified version to override the -# value parsed from the URL or tag. Note that -# --version=0 can be used to delete an -# existing version override from a formula if -# it has become redundant. -# --message Prepend message to the default pull request -# message. -# --url Specify the URL for the new download. If a -# URL is specified, the SHA-256 checksum of -# the new download should also be specified. -# --sha256 Specify the SHA-256 checksum of the new -# download. -# --tag Specify the new git commit tag for the -# formula. -# --revision Specify the new commit revision -# corresponding to the specified git tag or -# specified version. -# -f, --force Remove all mirrors if --mirror was not -# specified. -# --install-dependencies Install missing dependencies required to -# update resources. -# --python-package-name Use the specified package-name when finding -# Python resources for formula. If no package -# name is specified, it will be inferred from -# the formula's stable URL. -# --python-extra-packages Include these additional Python packages when -# finding resources. -# --python-exclude-packages Exclude these Python packages when finding -# resources. -# -d, --debug Display any debugging information. -# -q, --quiet Make some output more quiet. -# -v, --verbose Make some output more verbose. -# -h, --help Show this message. +echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" echo "Validating formula" brew bump-formula-pr \ - --tag="$MAS_VERSION" \ - --revision="$REVISION" \ + --tag="${MAS_VERSION}" \ + --revision="${REVISION}" \ --strict \ --verbose \ mas # brew exit status status=$? -if test $status -ne 0; then +if test ${status} -ne 0; then echo "Formula did not validate using 'brew bump-formula-pr'" - exit $status + exit ${status} fi -pushd "$CORE_FORMULA_PATH" || exit 2 +pushd "${CORE_FORMULA_PATH}" || exit 2 dry_run='' echo "Updating formula" @@ -218,12 +138,28 @@ echo "Updating formula" # fi brew bump-formula-pr \ - --tag="$MAS_VERSION" \ - --revision="$REVISION" \ + --tag="${MAS_VERSION}" \ + --revision="${REVISION}" \ --commit \ --fork-org mas-cli \ --online \ --strict \ --verbose \ - "$dry_run" \ + "${dry_run}" \ mas + +################################################################################ +# +# Create pr on mas-cli/mas +# + +gh pr create \ + --assignee phatblat \ + --base main \ + --draft \ + --fill + +################################################################################ +# +# Create pr on mas-cli/homebrew-tap +# From d84dd58088d54cc683c2de83938740dc466d865f Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 10:05:36 -0600 Subject: [PATCH 068/162] =?UTF-8?q?=F0=9F=9A=A9=20Add=20dry=20run=20suppor?= =?UTF-8?q?t=20to=20brew=5Fformula=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 77 ++++++++++++++++++++++++++------------ script/version_bump | 29 ++++++-------- 2 files changed, 64 insertions(+), 42 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index 8956e7a..ddc9850 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -19,18 +19,37 @@ LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" function usage { - echo "Usage: brew_formula_update [0.0] [sha1_hash]" - echo "- version will be inferred using version script if not provided" - echo "- sha will be inferred from the current commit if not provided" + echo "Usage: brew_formula_update [-d] v0.0 [sha1_hash]" + echo " -d option enables dry run mode" + echo " version will be inferred using version script if not provided" + echo " sha will be inferred from the current commit if not provided" exit 1 } +# Max 3 arguments if [[ $# -gt 3 ]]; then - usage + usage 1>&2 fi +echo='' +dry_run='' + +# Detect presence of `-d` dry run option +while getopts "d" o; do + case "${o}" in + d) + echo='echo (DRY-RUN):' + dry_run='-d' + ;; + *) + usage 1>&2 + ;; + esac +done +shift $((OPTIND-1)) + # arg 1 - version tag -if test -n "${1}"; then +if [[ -n "${1}" ]]; then MAS_VERSION="${1}" else MAS_VERSION="v$(script/version)" @@ -39,10 +58,15 @@ fi echo "MAS_VERSION: ${MAS_VERSION}" # arg 2 - revision (commit hash) -if test -n "${2}"; then +if [[ -n "${2}" ]]; then REVISION="${2}" else - REVISION=$(git rev-parse "${MAS_VERSION}") + if [[ $dry_run == '-d' ]]; then + REVISION=fake-revision + else + # Derive revision from version. Fails if MAS_VERSION is not a tag. + REVISION=$(git rev-parse "${MAS_VERSION}") + fi fi echo "REVISION: ${REVISION}" @@ -54,18 +78,18 @@ echo "REVISION: ${REVISION}" script/version_bump "${MAS_VERSION}" "$REVISION" -cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" +# cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" branch_name="releases/release-${MAS_VERSION}" -git branch "${branch_name}" -git switch "${branch_name}" +$echo git branch "${branch_name}" +$echo git switch "${branch_name}" -git add \ +$echo git add \ "${SWIFT_PACKAGE}" \ "${LOCAL_MAS_FORMULA_PATH}" \ "${LOCAL_TAP_FORMULA_PATH}" -git commit --message="🔖 Version ${MAS_VERSION}" +$echo git commit --message="🔖 Version ${MAS_VERSION}" ################################################################################ # @@ -82,7 +106,7 @@ if command -v mas >/dev/null; then fi # Ensure core is tapped -if ! test -d "${CORE_TAP_PATH}"; then +if ! [[ -d "${CORE_TAP_PATH}" ]]; then brew tap homebrew/core fi @@ -108,36 +132,41 @@ brew style mas-cli/tap/mas # # Update Homebrew # -echo "Checking to see if this update can be a simple bump." -diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" + +# echo "Checking to see if this update can be a simple bump." +# diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" +if [[ $dry_run == '-d' ]]; then + # -n, --dry-run Print what would be done rather than doing + # it. + # --write-only Make the expected file modifications without + # taking any Git actions. + dry_run="--dry-run" +fi + echo "Validating formula" brew bump-formula-pr \ --tag="${MAS_VERSION}" \ --revision="${REVISION}" \ --strict \ --verbose \ + "${dry_run}" \ mas # brew exit status status=$? -if test ${status} -ne 0; then +if [[ ${status} -ne 0 ]]; then echo "Formula did not validate using 'brew bump-formula-pr'" exit ${status} fi pushd "${CORE_FORMULA_PATH}" || exit 2 -dry_run='' -echo "Updating formula" -# if test $formula_revisions -eq 1; then -# # Options to -# dry_run="--dry-run --write" -# fi +echo "Updating homebrew/core formula with a PR" -brew bump-formula-pr \ +$echo brew bump-formula-pr \ --tag="${MAS_VERSION}" \ --revision="${REVISION}" \ --commit \ @@ -153,7 +182,7 @@ brew bump-formula-pr \ # Create pr on mas-cli/mas # -gh pr create \ +$echo gh pr create \ --assignee phatblat \ --base main \ --draft \ diff --git a/script/version_bump b/script/version_bump index 1c09ddb..4ea2a52 100755 --- a/script/version_bump +++ b/script/version_bump @@ -6,8 +6,6 @@ # Increments the marketing version of mas. # - -# SCRIPT_PATH=$(dirname "$(which "$0")") PROJECT_PATH="$(git rev-parse --show-toplevel)" PACKAGE_MANIFEST="${PROJECT_PATH}/Sources/MasKit/Package.swift" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" @@ -24,23 +22,20 @@ if [[ $# -lt 1 ]]; then usage fi -last_tag=$(script/version) -echo "Last git tag: $last_tag" - # arg 1 - version tag -if test -n "$1"; then - MAS_VERSION=$1 +if test -n "${1}"; then + MAS_VERSION=${1} fi # arg 2 - revision (commit hash) -if test -n "$2"; then - REVISION="$2" +if test -n "${2}"; then + REVISION="${2}" else - REVISION=$(git rev-parse "$MAS_VERSION") + REVISION=$(git rev-parse "${MAS_VERSION}") fi -echo "MAS_VERSION: $MAS_VERSION" -echo "REVISION: $REVISION" +echo "MAS_VERSION: ${MAS_VERSION}" +echo "REVISION: ${REVISION}" # Write new version into swift package cat <"${PACKAGE_MANIFEST}" @@ -54,11 +49,9 @@ echo cat "${PACKAGE_MANIFEST}" # Write new version into brew formulae -for file in $LOCAL_MAS_FORMULA_PATH $LOCAL_TAP_FORMULA_PATH; do - echo "$file" - # echo sed -i "5s/(\w+tag:\w+\"\)v[^\"]\",/$0$MAS_VERSION\"/" "$file" - # sed -i '' -E "s/(\w+tag:\w+\")v,/\1$MAS_VERSION\"/" "$file" - sd '( +tag: +)"[^"]+"' "\$1\"$MAS_VERSION\"" "$file" - sd '( +revision: +)"[^"]+"' "\$1\"$REVISION\"" "$file" +for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do + echo "${file}" + sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" + sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" done From 76c8314004a1502fd4a2e91ed7e7ab6e80f0d90a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 11:19:12 -0600 Subject: [PATCH 069/162] =?UTF-8?q?=F0=9F=9A=A9=20Pass=20DRY=5FRUN=20to=20?= =?UTF-8?q?brew=5Fformula=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 18 ++++++++++++------ script/brew_formula_update | 7 +++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb52ef0..34152f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: env: DRY_RUN: true MAS_VERSION: 0.0.0 - RELEASE_COMMIT: abcd + RELEASE_COMMIT: fake-commit-hash steps: # Logs event details and sets `DRY_RUN` env var @@ -51,14 +51,17 @@ jobs: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 - name: 👢 Bootstrap - run: script/bootstrap + run: | + script/bootstrap # Important to trigger a universal build first as package just works with # the `mas` binary in finds in the build dir. - name: 🏗️ Build Universal - run: script/build --universal + run: | + script/build --universal - name: 📦 macOS Package - run: script/package + run: | + script/package - name: 🚀 Upload mas.pkg uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} @@ -68,7 +71,8 @@ jobs: path: .build/mas.pkg - name: 🍼 Homebrew Bottles for mas tap - run: script/bottle + run: | + script/bottle - name: 🚀 Upload Bottles uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} @@ -79,4 +83,6 @@ jobs: .build/bottles/mas-*.bottle.tar.gz - name: 🍺 Update Homebrew mas formula - run: script/brew_formula_update ${{ env.MAS_VERSION }} + run: | + DRY_RUN=${{ env.DRY_RUN }} \ + script/brew_formula_update ${{ env.MAS_VERSION }} diff --git a/script/brew_formula_update b/script/brew_formula_update index ddc9850..a49a4a8 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -48,6 +48,13 @@ while getopts "d" o; do done shift $((OPTIND-1)) +# DRY_RUN environment variable +# shellcheck disable=SC2153 +if [[ $DRY_RUN == 'true' ]]; then + echo='echo (DRY-RUN):' + dry_run='-d' +fi + # arg 1 - version tag if [[ -n "${1}" ]]; then MAS_VERSION="${1}" From 6c65f4e09638aa13be8ddc338a69299a1060a77c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 11:22:09 -0600 Subject: [PATCH 070/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Move=20homebrew/core=20update=20before=20m?= =?UTF-8?q?as=20tap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34152f7..56e26e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,11 @@ jobs: name: mas.pkg path: .build/mas.pkg + - name: 🍺 Update Homebrew mas formula + run: | + DRY_RUN=${{ env.DRY_RUN }} \ + script/brew_formula_update ${{ env.MAS_VERSION }} + - name: 🍼 Homebrew Bottles for mas tap run: | script/bottle @@ -82,7 +87,3 @@ jobs: path: | .build/bottles/mas-*.bottle.tar.gz - - name: 🍺 Update Homebrew mas formula - run: | - DRY_RUN=${{ env.DRY_RUN }} \ - script/brew_formula_update ${{ env.MAS_VERSION }} From fc4ffae87fae8c3cf2af98155f9bec4ba42248cf Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 11:38:19 -0600 Subject: [PATCH 071/162] =?UTF-8?q?=F0=9F=93=8C=20Pin=20MAS=5FVERSION=20to?= =?UTF-8?q?=20v1.8.7-beta.1=20in=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56e26e8..4c99e00 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,9 @@ jobs: shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} env: DRY_RUN: true - MAS_VERSION: 0.0.0 - RELEASE_COMMIT: fake-commit-hash + # Dry run version pinned to real release for testing brew build system + MAS_VERSION: v1.8.7-beta.1 + RELEASE_COMMIT: f8be3e9aaa6c78490277976f17041f2577f5dc21 steps: # Logs event details and sets `DRY_RUN` env var From b8803ba230a66c05b060d6729e49ba5376a70654 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 11:43:13 -0600 Subject: [PATCH 072/162] =?UTF-8?q?=F0=9F=94=A8=20Use=20real=20revision,?= =?UTF-8?q?=20write=20brew=20formula=20before=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index a49a4a8..dceca31 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -68,12 +68,8 @@ echo "MAS_VERSION: ${MAS_VERSION}" if [[ -n "${2}" ]]; then REVISION="${2}" else - if [[ $dry_run == '-d' ]]; then - REVISION=fake-revision - else - # Derive revision from version. Fails if MAS_VERSION is not a tag. - REVISION=$(git rev-parse "${MAS_VERSION}") - fi + # Derive revision from version. Fails if MAS_VERSION is not a tag. + REVISION=$(git rev-parse "${MAS_VERSION}") fi echo "REVISION: ${REVISION}" @@ -85,8 +81,6 @@ echo "REVISION: ${REVISION}" script/version_bump "${MAS_VERSION}" "$REVISION" -# cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" - branch_name="releases/release-${MAS_VERSION}" $echo git branch "${branch_name}" $echo git switch "${branch_name}" @@ -124,12 +118,18 @@ brew update # Build the formula for the current macOS version and architecture. # -# Force brew to use the local repository instead of the API. -# Disable API before any install, reinstall or upgrade commands. -export HOMEBREW_NO_INSTALL_FROM_API=1 +# Update mas formula in core +cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" # Install mas from source -brew reinstall mas +# HOMEBREW_NO_INSTALL_FROM_API: +# Force brew to use the local repository instead of the API. +# Disable API before any install, reinstall or upgrade commands. + +HOMEBREW_NO_INSTALL_FROM_API=1 \ + brew install mas \ + --build-from-source \ + --verbose # Audit formula brew audit --strict mas-cli/tap/mas From b6fa1c8a123c608393eb0a829abf11ee63a4d653 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 11:49:14 -0600 Subject: [PATCH 073/162] =?UTF-8?q?=F0=9F=94=A8=20Validate=20core=20formul?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of tap --- script/brew_formula_update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index dceca31..ed83129 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -132,8 +132,8 @@ HOMEBREW_NO_INSTALL_FROM_API=1 \ --verbose # Audit formula -brew audit --strict mas-cli/tap/mas -brew style mas-cli/tap/mas +brew audit --strict mas +brew style mas ################################################################################ # From 9a094b1684f40acb4dca59e06281304e54be65f9 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 12:22:15 -0600 Subject: [PATCH 074/162] =?UTF-8?q?=F0=9F=94=A8=20Revert=20core=20formula?= =?UTF-8?q?=20after=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_formula_update | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/brew_formula_update b/script/brew_formula_update index ed83129..8fcc549 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -118,7 +118,7 @@ brew update # Build the formula for the current macOS version and architecture. # -# Update mas formula in core +# Update mas formula in core (temporary) cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" # Install mas from source @@ -135,6 +135,12 @@ HOMEBREW_NO_INSTALL_FROM_API=1 \ brew audit --strict mas brew style mas +# Revert core formula change after testing +pushd "${CORE_TAP_PATH}" +git diff +git checkout . +popd + ################################################################################ # # Update Homebrew From 6f658ed2d62cf70b7f05fc1eb8afe65ab82f717a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 12:24:09 -0600 Subject: [PATCH 075/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Move=20defaults=20?= =?UTF-8?q?to=20workflow=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c99e00..2de472b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,10 @@ # --- name: release +defaults: + run: + # Prefixes all `run` commands with the following command to force them to run outside Rosetta. + shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} on: # The `push` event is used only for testing while making changes to this workflow. # This will be detected by the `github.event.release.name` being empty which @@ -15,10 +19,6 @@ on: jobs: release: runs-on: macos-14 - defaults: - run: - # Prefixes all `run` commands with the following command to force them to run outside Rosetta. - shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} env: DRY_RUN: true # Dry run version pinned to real release for testing brew build system From 30a4987d39b1a73eccf117a93cc13fc4ee370f1e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 12:26:16 -0600 Subject: [PATCH 076/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Move=20env=20to=20?= =?UTF-8?q?workflow=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2de472b..b26a41e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,11 @@ defaults: run: # Prefixes all `run` commands with the following command to force them to run outside Rosetta. shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} +env: + DRY_RUN: true + # Dry run version pinned to real release for testing brew build system + MAS_VERSION: v1.8.7-beta.1 + RELEASE_COMMIT: f8be3e9aaa6c78490277976f17041f2577f5dc21 on: # The `push` event is used only for testing while making changes to this workflow. # This will be detected by the `github.event.release.name` being empty which @@ -19,11 +24,6 @@ on: jobs: release: runs-on: macos-14 - env: - DRY_RUN: true - # Dry run version pinned to real release for testing brew build system - MAS_VERSION: v1.8.7-beta.1 - RELEASE_COMMIT: f8be3e9aaa6c78490277976f17041f2577f5dc21 steps: # Logs event details and sets `DRY_RUN` env var From 87a00742c8b43246bffb75773108818862b8643d Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 12:41:53 -0600 Subject: [PATCH 077/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Update=20GITHUB=5FENV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b26a41e..08eddc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,8 +38,8 @@ jobs: echo "release.target_commitish: ${{ github.event.release.target_commitish }}" echo "release.body: ${{ github.event.release.body }}" echo "DRY_RUN=false" >>$GITHUB_ENV - echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_REF} - echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_REF} + echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_ENV} + echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_ENV} - name: 🔈 Log environment variables run: | From c0950b130b351b9d4c29c99e97d65556c3c63ab0 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 19:32:02 -0600 Subject: [PATCH 078/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Split=20workflow?= =?UTF-8?q?=20into=204=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 46 +++- script/bottle | 17 +- .../{brew_formula_update => brew_core_update} | 38 ++- script/brew_tap_update | 237 ++++++++++++++++++ script/version | 9 +- 5 files changed, 328 insertions(+), 19 deletions(-) rename script/{brew_formula_update => brew_core_update} (86%) create mode 100755 script/brew_tap_update diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08eddc1..8bc483f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ on: release: types: [published] jobs: - release: + debug-event: runs-on: macos-14 steps: @@ -47,10 +47,16 @@ jobs: echo "MAS_VERSION: ${MAS_VERSION}" echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" + pkg-installer: + runs-on: macos-14 + needs: debug-event + steps: + - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + - name: 👢 Bootstrap run: | script/bootstrap @@ -60,9 +66,11 @@ jobs: - name: 🏗️ Build Universal run: | script/build --universal + - name: 📦 macOS Package run: | script/package + - name: 🚀 Upload mas.pkg uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} @@ -71,14 +79,48 @@ jobs: name: mas.pkg path: .build/mas.pkg + homebrew-core: + runs-on: macos-14 + needs: debug-event + steps: + + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + + - name: 👢 Bootstrap + run: | + script/bootstrap + - name: 🍺 Update Homebrew mas formula run: | DRY_RUN=${{ env.DRY_RUN }} \ - script/brew_formula_update ${{ env.MAS_VERSION }} + script/brew_core_update ${{ env.MAS_VERSION }} + + homebrew-tap: + runs-on: macos-14 + needs: [debug-event, homebrew-core] + steps: + + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + + - name: 👢 Bootstrap + run: | + script/bootstrap + + - name: 🚰 Update mas tap formula + run: | + DRY_RUN=${{ env.DRY_RUN }} \ + script/brew_tap_update ${{ env.MAS_VERSION }} - name: 🍼 Homebrew Bottles for mas tap run: | script/bottle + - name: 🚀 Upload Bottles uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} diff --git a/script/bottle b/script/bottle index 7f002ab..f6fe129 100755 --- a/script/bottle +++ b/script/bottle @@ -16,6 +16,7 @@ BUILD_DIR="$PWD/.build" BOTTLE_DIR="$BUILD_DIR/bottles" +CORE_TAP_PATH="$(brew --repository homebrew/core)" MAS_VERSION=$(script/version) ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" @@ -41,8 +42,8 @@ IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ CURRENT_OS_VERSION_MAJOR=${CURRENT_OS_VERSION[0]} CURRENT_OS_VERSION_MINOR=${CURRENT_OS_VERSION[1]} -echo "CURRENT_OS_VERSION_MAJOR: $CURRENT_OS_VERSION_MAJOR" -echo "CURRENT_OS_VERSION_MINOR: $CURRENT_OS_VERSION_MINOR" +echo "CURRENT_OS_VERSION_MAJOR: ${CURRENT_OS_VERSION_MAJOR}" +echo "CURRENT_OS_VERSION_MINOR: ${CURRENT_OS_VERSION_MINOR}" case "${CURRENT_OS_VERSION_MAJOR}" in 14) @@ -107,23 +108,23 @@ echo "==> 🍼 Bottling mas ${MAS_VERSION} 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 +brew bottle --verbose --no-rebuild --root-url="${ROOT_URL}" mas-cli/tap/mas if ! test -e "${OLD_FILENAME}"; then echo "Bottle not found: ${OLD_FILENAME}" echo "If an old version is showing in the log and filename, then make sure the formula has been updated in:" - echo "/Library/Taps/homebrew/homebrew-core" + echo "${CORE_TAP_PATH}" exit 1 fi SHA256=$(shasum --algorithm 256 "${OLD_FILENAME}" | cut -f 1 -d ' ' -) -mkdir -p "$BOTTLE_DIR" +mkdir -p "${BOTTLE_DIR}" # Start of bottle block BOTTLE_BLOCK=$( cat <<-EOF bottle do - root_url "$ROOT_URL" + root_url "${ROOT_URL}" EOF ) @@ -139,10 +140,10 @@ for os in "${OS_NAMES[@]}"; do # Append each os # BOTTLE_BLOCK="$(printf "${BOTTLE_BLOCK}\n sha256 cellar: :any_skip_relocation, %-15s %s" "${os}:" "${SHA256}")" - BOTTLE_BLOCK="$BOTTLE_BLOCK"$( + BOTTLE_BLOCK="${BOTTLE_BLOCK}"$( cat <<-EOF - sha256 cellar: :any_skip_relocation, $os: "$SHA256" + sha256 cellar: :any_skip_relocation, ${os}: "${SHA256}" EOF ) done diff --git a/script/brew_formula_update b/script/brew_core_update similarity index 86% rename from script/brew_formula_update rename to script/brew_core_update index 8fcc549..5e04b50 100755 --- a/script/brew_formula_update +++ b/script/brew_core_update @@ -1,6 +1,6 @@ #!/bin/bash -e # -# script/brew_formula_update +# script/brew_core_update # mas # # Updates mas Homebrew core formula: @@ -10,7 +10,9 @@ # CORE_TAP_PATH="$(brew --repository homebrew/core)" -CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula" +MAS_TAP_PATH="$(brew --repository mas-cli/tap)" +MAS_TAP_PATH_FORMULA="${MAS_TAP_PATH}/Formula/mas.rb" +CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" PROJECT_PATH="$(git rev-parse --show-toplevel)" @@ -175,7 +177,7 @@ if [[ ${status} -ne 0 ]]; then exit ${status} fi -pushd "${CORE_FORMULA_PATH}" || exit 2 +pushd "${CORE_FORMULA_PATH}" echo "Updating homebrew/core formula with a PR" @@ -190,6 +192,8 @@ $echo brew bump-formula-pr \ "${dry_run}" \ mas +popd + ################################################################################ # # Create pr on mas-cli/mas @@ -205,3 +209,31 @@ $echo gh pr create \ # # Create pr on mas-cli/homebrew-tap # + +# Ensure mas is tapped +if ! [[ -d "${MAS_TAP_PATH}" ]]; then + brew tap mas-cli/tap +fi + +# Update tap formula version +cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" + +pushd "${MAS_TAP_PATH}" + +branch_name="releases/release-${MAS_VERSION}" +$echo git branch "${branch_name}" +$echo git switch "${branch_name}" + +$echo git add \ + "${MAS_TAP_PATH_FORMULA}" + +$echo git commit --message="🔖 Version ${MAS_VERSION}" + +$echo gh pr create \ + --assignee phatblat \ + --base main \ + --draft \ + --fill + +popd + diff --git a/script/brew_tap_update b/script/brew_tap_update new file mode 100755 index 0000000..d55e62a --- /dev/null +++ b/script/brew_tap_update @@ -0,0 +1,237 @@ +#!/bin/bash -e +# +# script/brew_tap_update +# mas +# +# Updates mas custom tap formula: +# https://github.com/mas-cli/homebrew-tap/blob/main/Formula/mas.rb +# + +CORE_TAP_PATH="$(brew --repository homebrew/core)" +MAS_TAP_PATH="$(brew --repository mas-cli/tap)" +MAS_TAP_PATH_FORMULA="${MAS_TAP_PATH}/Formula/mas.rb" +CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" +CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" + +PROJECT_PATH="$(git rev-parse --show-toplevel)" +SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" +LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" +LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" + +function usage { + echo "Usage: brew_formula_update [-d] v0.0 [sha1_hash]" + echo " -d option enables dry run mode" + echo " version will be inferred using version script if not provided" + echo " sha will be inferred from the current commit if not provided" + exit 1 +} + +# Max 3 arguments +if [[ $# -gt 3 ]]; then + usage 1>&2 +fi + +echo='' +dry_run='' + +# Detect presence of `-d` dry run option +while getopts "d" o; do + case "${o}" in + d) + echo='echo (DRY-RUN):' + dry_run='-d' + ;; + *) + usage 1>&2 + ;; + esac +done +shift $((OPTIND-1)) + +# DRY_RUN environment variable +# shellcheck disable=SC2153 +if [[ $DRY_RUN == 'true' ]]; then + echo='echo (DRY-RUN):' + dry_run='-d' +fi + +# arg 1 - version tag +if [[ -n "${1}" ]]; then + MAS_VERSION="${1}" +else + MAS_VERSION="v$(script/version)" +fi + +echo "MAS_VERSION: ${MAS_VERSION}" + +# arg 2 - revision (commit hash) +if [[ -n "${2}" ]]; then + REVISION="${2}" +else + # Derive revision from version. Fails if MAS_VERSION is not a tag. + REVISION=$(git rev-parse "${MAS_VERSION}") +fi + +echo "REVISION: ${REVISION}" + +################################################################################ +# +# Update Version +# + +script/version_bump "${MAS_VERSION}" "$REVISION" + +branch_name="releases/release-${MAS_VERSION}" +$echo git branch "${branch_name}" +$echo git switch "${branch_name}" + +$echo git add \ + "${SWIFT_PACKAGE}" \ + "${LOCAL_MAS_FORMULA_PATH}" \ + "${LOCAL_TAP_FORMULA_PATH}" + +$echo git commit --message="🔖 Version ${MAS_VERSION}" + +################################################################################ +# +# Preflight checks +# + +# Uninstall if necessary +brew remove mas 2>/dev/null || true +brew remove mas-cli/tap/mas 2>/dev/null || true + +# Uninstall if still found on path +if command -v mas >/dev/null; then + script/uninstall || true +fi + +# Ensure core is tapped +if ! [[ -d "${CORE_TAP_PATH}" ]]; then + brew tap homebrew/core +fi + +brew update + +################################################################################ +# +# Build the formula for the current macOS version and architecture. +# + +# Update mas formula in core (temporary) +cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" + +# Install mas from source +# HOMEBREW_NO_INSTALL_FROM_API: +# Force brew to use the local repository instead of the API. +# Disable API before any install, reinstall or upgrade commands. + +HOMEBREW_NO_INSTALL_FROM_API=1 \ + brew install mas \ + --build-from-source \ + --verbose + +# Audit formula +brew audit --strict mas +brew style mas + +# Revert core formula change after testing +pushd "${CORE_TAP_PATH}" +git diff +git checkout . +popd + +################################################################################ +# +# Update Homebrew +# + +# echo "Checking to see if this update can be a simple bump." +# diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" + +echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" + +if [[ $dry_run == '-d' ]]; then + # -n, --dry-run Print what would be done rather than doing + # it. + # --write-only Make the expected file modifications without + # taking any Git actions. + dry_run="--dry-run" +fi + +echo "Validating formula" +brew bump-formula-pr \ + --tag="${MAS_VERSION}" \ + --revision="${REVISION}" \ + --strict \ + --verbose \ + "${dry_run}" \ + mas + +# brew exit status +status=$? +if [[ ${status} -ne 0 ]]; then + echo "Formula did not validate using 'brew bump-formula-pr'" + exit ${status} +fi + +pushd "${CORE_FORMULA_PATH}" + +echo "Updating homebrew/core formula with a PR" + +$echo brew bump-formula-pr \ + --tag="${MAS_VERSION}" \ + --revision="${REVISION}" \ + --commit \ + --fork-org mas-cli \ + --online \ + --strict \ + --verbose \ + "${dry_run}" \ + mas + +popd + +################################################################################ +# +# Create pr on mas-cli/mas +# + +$echo gh pr create \ + --assignee phatblat \ + --base main \ + --draft \ + --fill + +################################################################################ +# +# Create pr on mas-cli/homebrew-tap +# + +# Ensure mas is tapped +if ! [[ -d "${MAS_TAP_PATH}" ]]; then + brew tap mas-cli/tap +fi + +# Update tap formula version +cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" + +pushd "${MAS_TAP_PATH}" + +branch_name="releases/release-${MAS_VERSION}" +$echo git branch "${branch_name}" +$echo git switch "${branch_name}" + +$echo git add \ + "${MAS_TAP_PATH_FORMULA}" + +$echo git commit --message="🔖 Version ${MAS_VERSION}" + +$echo gh pr create \ + --assignee phatblat \ + --base main \ + --draft \ + --fill + +popd + diff --git a/script/version b/script/version index 561b9e3..604e784 100755 --- a/script/version +++ b/script/version @@ -6,13 +6,10 @@ # Displays the current marketing version of mas. # -# This no longer works with MARKETING_VERSION build setting in Info.plist -# agvtool what-marketing-version -terse1 - if git describe >/dev/null 2>&1; then - MAS_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || true) -else - MAS_VERSION=1.0.0 + last_tag=$(git describe --abbrev=0 --tags 2>/dev/null || true) + # Use MAS_VERSION environment varible unless unset + MAS_VERSION=${MAS_VERSION:-$last_tag} fi MAS_VERSION=${MAS_VERSION#v} echo "${MAS_VERSION}" From b49d9db2dc066797564aa6870d75774f5c2e68cb Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 19:48:06 -0600 Subject: [PATCH 079/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20tap=20logic=20f?= =?UTF-8?q?rom=20brew=5Fcore=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index 5e04b50..2297ead 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -10,8 +10,6 @@ # CORE_TAP_PATH="$(brew --repository homebrew/core)" -MAS_TAP_PATH="$(brew --repository mas-cli/tap)" -MAS_TAP_PATH_FORMULA="${MAS_TAP_PATH}/Formula/mas.rb" CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" @@ -21,7 +19,7 @@ LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" function usage { - echo "Usage: brew_formula_update [-d] v0.0 [sha1_hash]" + echo "Usage: brew_core_update [-d] v0.0 [sha1_hash]" echo " -d option enables dry run mode" echo " version will be inferred using version script if not provided" echo " sha will be inferred from the current commit if not provided" @@ -205,35 +203,3 @@ $echo gh pr create \ --draft \ --fill -################################################################################ -# -# Create pr on mas-cli/homebrew-tap -# - -# Ensure mas is tapped -if ! [[ -d "${MAS_TAP_PATH}" ]]; then - brew tap mas-cli/tap -fi - -# Update tap formula version -cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" - -pushd "${MAS_TAP_PATH}" - -branch_name="releases/release-${MAS_VERSION}" -$echo git branch "${branch_name}" -$echo git switch "${branch_name}" - -$echo git add \ - "${MAS_TAP_PATH_FORMULA}" - -$echo git commit --message="🔖 Version ${MAS_VERSION}" - -$echo gh pr create \ - --assignee phatblat \ - --base main \ - --draft \ - --fill - -popd - From 20ba23e24701a3ae0b95ddc59b93fc9cc33fdf10 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 19:48:25 -0600 Subject: [PATCH 080/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20core=20logic=20?= =?UTF-8?q?from=20brew=5Ftap=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_tap_update | 134 ++--------------------------------------- 1 file changed, 4 insertions(+), 130 deletions(-) diff --git a/script/brew_tap_update b/script/brew_tap_update index d55e62a..6cce0c2 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -7,19 +7,14 @@ # https://github.com/mas-cli/homebrew-tap/blob/main/Formula/mas.rb # -CORE_TAP_PATH="$(brew --repository homebrew/core)" MAS_TAP_PATH="$(brew --repository mas-cli/tap)" MAS_TAP_PATH_FORMULA="${MAS_TAP_PATH}/Formula/mas.rb" -CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" -CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" PROJECT_PATH="$(git rev-parse --show-toplevel)" -SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" -LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" function usage { - echo "Usage: brew_formula_update [-d] v0.0 [sha1_hash]" + echo "Usage: brew_tap_update [-d] v0.0 [sha1_hash]" echo " -d option enables dry run mode" echo " version will be inferred using version script if not provided" echo " sha will be inferred from the current commit if not provided" @@ -79,130 +74,9 @@ echo "REVISION: ${REVISION}" # Update Version # -script/version_bump "${MAS_VERSION}" "$REVISION" - branch_name="releases/release-${MAS_VERSION}" -$echo git branch "${branch_name}" $echo git switch "${branch_name}" -$echo git add \ - "${SWIFT_PACKAGE}" \ - "${LOCAL_MAS_FORMULA_PATH}" \ - "${LOCAL_TAP_FORMULA_PATH}" - -$echo git commit --message="🔖 Version ${MAS_VERSION}" - -################################################################################ -# -# Preflight checks -# - -# Uninstall if necessary -brew remove mas 2>/dev/null || true -brew remove mas-cli/tap/mas 2>/dev/null || true - -# Uninstall if still found on path -if command -v mas >/dev/null; then - script/uninstall || true -fi - -# Ensure core is tapped -if ! [[ -d "${CORE_TAP_PATH}" ]]; then - brew tap homebrew/core -fi - -brew update - -################################################################################ -# -# Build the formula for the current macOS version and architecture. -# - -# Update mas formula in core (temporary) -cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" - -# Install mas from source -# HOMEBREW_NO_INSTALL_FROM_API: -# Force brew to use the local repository instead of the API. -# Disable API before any install, reinstall or upgrade commands. - -HOMEBREW_NO_INSTALL_FROM_API=1 \ - brew install mas \ - --build-from-source \ - --verbose - -# Audit formula -brew audit --strict mas -brew style mas - -# Revert core formula change after testing -pushd "${CORE_TAP_PATH}" -git diff -git checkout . -popd - -################################################################################ -# -# Update Homebrew -# - -# echo "Checking to see if this update can be a simple bump." -# diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" - -echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" - -if [[ $dry_run == '-d' ]]; then - # -n, --dry-run Print what would be done rather than doing - # it. - # --write-only Make the expected file modifications without - # taking any Git actions. - dry_run="--dry-run" -fi - -echo "Validating formula" -brew bump-formula-pr \ - --tag="${MAS_VERSION}" \ - --revision="${REVISION}" \ - --strict \ - --verbose \ - "${dry_run}" \ - mas - -# brew exit status -status=$? -if [[ ${status} -ne 0 ]]; then - echo "Formula did not validate using 'brew bump-formula-pr'" - exit ${status} -fi - -pushd "${CORE_FORMULA_PATH}" - -echo "Updating homebrew/core formula with a PR" - -$echo brew bump-formula-pr \ - --tag="${MAS_VERSION}" \ - --revision="${REVISION}" \ - --commit \ - --fork-org mas-cli \ - --online \ - --strict \ - --verbose \ - "${dry_run}" \ - mas - -popd - -################################################################################ -# -# Create pr on mas-cli/mas -# - -$echo gh pr create \ - --assignee phatblat \ - --base main \ - --draft \ - --fill - ################################################################################ # # Create pr on mas-cli/homebrew-tap @@ -213,15 +87,15 @@ if ! [[ -d "${MAS_TAP_PATH}" ]]; then brew tap mas-cli/tap fi -# Update tap formula version -cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" - pushd "${MAS_TAP_PATH}" branch_name="releases/release-${MAS_VERSION}" $echo git branch "${branch_name}" $echo git switch "${branch_name}" +# Update tap formula version +cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" + $echo git add \ "${MAS_TAP_PATH_FORMULA}" From 37cf3116b14ef31b71866d3e3d16ec34fdde9bae Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 10 Mar 2024 19:53:07 -0600 Subject: [PATCH 081/162] =?UTF-8?q?=F0=9F=94=A8=20Invoke=20bottle=20script?= =?UTF-8?q?=20from=20brew=5Ftap=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 6 +++--- script/brew_tap_update | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/script/bottle b/script/bottle index f6fe129..494f059 100755 --- a/script/bottle +++ b/script/bottle @@ -14,8 +14,8 @@ # Variables # -BUILD_DIR="$PWD/.build" -BOTTLE_DIR="$BUILD_DIR/bottles" +BUILD_DIR="${PWD}/.build" +BOTTLE_DIR="${BUILD_DIR}/bottles" CORE_TAP_PATH="$(brew --repository homebrew/core)" MAS_VERSION=$(script/version) ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" @@ -37,7 +37,7 @@ OS_NAMES=( el_capitan ) -# Semantic version number split into a list using Ugly, bash 3 compatible syntax +# Semantic version number split into a list using ugly, bash 3 compatible syntax IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ /g')" CURRENT_OS_VERSION_MAJOR=${CURRENT_OS_VERSION[0]} CURRENT_OS_VERSION_MINOR=${CURRENT_OS_VERSION[1]} diff --git a/script/brew_tap_update b/script/brew_tap_update index 6cce0c2..c6d2848 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -79,7 +79,7 @@ $echo git switch "${branch_name}" ################################################################################ # -# Create pr on mas-cli/homebrew-tap +# Create branch on mas-cli/homebrew-tap # # Ensure mas is tapped @@ -101,6 +101,18 @@ $echo git add \ $echo git commit --message="🔖 Version ${MAS_VERSION}" +popd + +# Build in mas project +script/bottle + +################################################################################ +# +# Create PR on mas-cli/homebrew-tap +# + +pushd "${MAS_TAP_PATH}" + $echo gh pr create \ --assignee phatblat \ --base main \ From 1b7d6fd81bc3862ee88890e007831c3cea909eab Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 30 Mar 2024 11:03:55 -0600 Subject: [PATCH 082/162] =?UTF-8?q?=F0=9F=94=A8=20Add=20frozen=20(-f)=20op?= =?UTF-8?q?tion=20to=20bootstrap=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GHA jobs use -f so pinned version of tools are installed, if necessary. New bootstrap-update make target upgrades tools --- .github/workflows/pr-checks.yml | 2 +- .github/workflows/release.yml | 6 +++--- Makefile | 4 ++++ script/bootstrap | 33 +++++++++++++++++++++++++++++++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 451df14..3d8ff77 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -28,7 +28,7 @@ jobs: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 - name: Bootstrap - run: script/bootstrap + run: script/bootstrap -f - name: Build run: script/build - name: Test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8bc483f..b2bc4fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,7 +59,7 @@ jobs: - name: 👢 Bootstrap run: | - script/bootstrap + script/bootstrap -f # Important to trigger a universal build first as package just works with # the `mas` binary in finds in the build dir. @@ -91,7 +91,7 @@ jobs: - name: 👢 Bootstrap run: | - script/bootstrap + script/bootstrap -f - name: 🍺 Update Homebrew mas formula run: | @@ -110,7 +110,7 @@ jobs: - name: 👢 Bootstrap run: | - script/bootstrap + script/bootstrap -f - name: 🚰 Update mas tap formula run: | diff --git a/Makefile b/Makefile index 0744125..f3cbb7c 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,10 @@ init: ## Installs tools. .PHONY: bootstrap bootstrap: ## Installs tools. + script/bootstrap -f + +.PHONY: bootstrap-update +bootstrap-update: ## Upgrades and installs tools. script/bootstrap ################################################################################ diff --git a/script/bootstrap b/script/bootstrap index c429499..5ae8b6b 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -6,14 +6,43 @@ # Installs development dependencies and builds project dependencies. # +function usage { + echo "Usage: bootstrap [-f]" + echo " -f option enables frozen mode" + exit 1 +} + +frozen='' + +# Detect presence of `-f` frozen option +while getopts "f" opt; do + echo "${opt}" + case "${opt}" in + f) + frozen='-f' + ;; + *) + usage 1>&2 + ;; + esac +done + main() { script/clean + echo "==> 👢 Bootstrapping" # Install Homebrew tools - rm -f Brewfile.lock.json - brew bundle install --no-upgrade --verbose + if [[ "${frozen}" == "-f" ]]; then + # --no-lock Don't touch Brewfile.lock.json + brew bundle install --no-lock --no-upgrade --verbose + else + # Allow upgrades + rm -f Brewfile.lock.json + brew bundle install --verbose + fi + if [[ ! -x "$(command -v mise)" ]]; then brew install mise From eb353fa4f575b6b401c4d479f0137c2470227336 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 30 Mar 2024 11:34:30 -0600 Subject: [PATCH 083/162] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20start=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit formerly debug-event --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2bc4fb..db8f231 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ on: release: types: [published] jobs: - debug-event: + start: runs-on: macos-14 steps: @@ -49,7 +49,7 @@ jobs: pkg-installer: runs-on: macos-14 - needs: debug-event + needs: start steps: - uses: actions/checkout@v4 @@ -81,7 +81,7 @@ jobs: homebrew-core: runs-on: macos-14 - needs: debug-event + needs: start steps: - uses: actions/checkout@v4 @@ -100,7 +100,7 @@ jobs: homebrew-tap: runs-on: macos-14 - needs: [debug-event, homebrew-core] + needs: [start, homebrew-core] steps: - uses: actions/checkout@v4 From 246636cb1042bcf5da566a002f034cac28131ccc Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 30 Mar 2024 11:39:32 -0600 Subject: [PATCH 084/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20Finder=20open?= =?UTF-8?q?=20command=20from=20bottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 2 -- 1 file changed, 2 deletions(-) diff --git a/script/bottle b/script/bottle index 494f059..9acb396 100755 --- a/script/bottle +++ b/script/bottle @@ -161,5 +161,3 @@ ls -l "${BOTTLE_DIR}" echo "${BOTTLE_BLOCK}" brew remove mas-cli/tap/mas - -open "${BOTTLE_DIR}" From 9ae76659a37807ffe10a10d5d2d1236b5ae199a7 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 30 Mar 2024 11:40:42 -0600 Subject: [PATCH 085/162] =?UTF-8?q?=F0=9F=94=87=20Remove=20getops=20loggin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bootstrap | 1 - 1 file changed, 1 deletion(-) diff --git a/script/bootstrap b/script/bootstrap index 5ae8b6b..f05934e 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -16,7 +16,6 @@ frozen='' # Detect presence of `-f` frozen option while getopts "f" opt; do - echo "${opt}" case "${opt}" in f) frozen='-f' From 283ddb6cde48a816f4dcdba5aed0eeb4c9b2778e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 07:51:00 -0600 Subject: [PATCH 086/162] =?UTF-8?q?=F0=9F=94=A7=20Set=20json=20indent=20si?= =?UTF-8?q?ze=20to=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index cf084a8..1f913cd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -27,6 +27,7 @@ indent_style = tab # JSON files contain newlines inconsistently [*.json] +indent_size = 2 insert_final_newline = ignore # Makefiles always use tabs for indentation From 13514f0f0d9749701e9c946ebb3ec09beab211af Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 08:11:22 -0600 Subject: [PATCH 087/162] =?UTF-8?q?=F0=9F=A4=A1=20Add=20mock=20release=20e?= =?UTF-8?q?vent.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .actrc | 2 ++ .github/event.json | 12 ++++++++++++ .github/workflows/release.yml | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .github/event.json diff --git a/.actrc b/.actrc index a87405d..9a978b4 100644 --- a/.actrc +++ b/.actrc @@ -1,5 +1,7 @@ --action-offline-mode +--eventpath .github/event.json --container-architecture linux/amd64 +--log-prefix-job-id --platform macos-14=-self-hosted --pull=false --reuse diff --git a/.github/event.json b/.github/event.json new file mode 100644 index 0000000..85ba787 --- /dev/null +++ b/.github/event.json @@ -0,0 +1,12 @@ +{ + "inputs": { + "NAME": "Manual Workflow", + "SOME_VALUE": "ABC" + }, + "release": { + "name": "v1.8.6-beta.1: macOS only test build", + "tag_name": "v1.8.7-beta.1", + "target_commitish": "f8be3e9aaa6c78490277976f17041f2577f5dc21", + "body": "This is a pre-release to facilitate testing for the following fix:\n\n - 🖥️ Only search, outdated and update macOS apps (#505, #496, #491, #336)" + } +} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db8f231..a4b9fb0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,8 @@ jobs: echo "release.name: ${{ github.event.release.name }}" echo "release.tag_name: ${{ github.event.release.tag_name }}" echo "release.target_commitish: ${{ github.event.release.target_commitish }}" - echo "release.body: ${{ github.event.release.body }}" + echo -e "release.body: \n${{ github.event.release.body }}" + echo "DRY_RUN=false" >>$GITHUB_ENV echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_ENV} echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_ENV} From a6d747c575380e65caa2d25eb3ab95b57fb0becd Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 08:28:47 -0600 Subject: [PATCH 088/162] =?UTF-8?q?=F0=9F=94=92=20Update=20brew=20lockfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Brewfile.lock.json | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Brewfile.lock.json b/Brewfile.lock.json index af635aa..597781d 100644 --- a/Brewfile.lock.json +++ b/Brewfile.lock.json @@ -46,45 +46,45 @@ } }, "mise": { - "version": "2024.3.1", + "version": "2024.3.11", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:c2243fa2e76a710d882b2ee3a7430c2ff2d22be0a299a7848a4be9cab3931483", - "sha256": "c2243fa2e76a710d882b2ee3a7430c2ff2d22be0a299a7848a4be9cab3931483" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:2ccc2946ac8d9af9fdde8ce0ef8d9271010eee24f8824086134533480b95b69f", + "sha256": "2ccc2946ac8d9af9fdde8ce0ef8d9271010eee24f8824086134533480b95b69f" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:132f9bffe79baee2560b6d1585485dfd63891c7f786690ba460956f7803298fa", - "sha256": "132f9bffe79baee2560b6d1585485dfd63891c7f786690ba460956f7803298fa" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:8e87fe7f49fa24545c99bcefc1fd1a22edfa6426b8c59e349bd445ced8544dd2", + "sha256": "8e87fe7f49fa24545c99bcefc1fd1a22edfa6426b8c59e349bd445ced8544dd2" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:f58e42399f4d39272b1eda361ea18b7afb91fe56d93c1d7689b3b5cf13df6dbf", - "sha256": "f58e42399f4d39272b1eda361ea18b7afb91fe56d93c1d7689b3b5cf13df6dbf" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:2c0deb90ea8214e22f4f10fa53ef8d90b66c769f4784807ce99614c6c3a97b43", + "sha256": "2c0deb90ea8214e22f4f10fa53ef8d90b66c769f4784807ce99614c6c3a97b43" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:ee7eece11a1db1ab2ce2b9c6b7b49ec64a9f7ed3a3b3c59fb6440ebf341f249c", - "sha256": "ee7eece11a1db1ab2ce2b9c6b7b49ec64a9f7ed3a3b3c59fb6440ebf341f249c" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:458438873c3a621d77849261f7ef57173670bdf0a64e018592e1682685be28ce", + "sha256": "458438873c3a621d77849261f7ef57173670bdf0a64e018592e1682685be28ce" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:9b9b95abef174fa48dab6c996a56a9a1217e435436c9f62be23cd7533bc732f2", - "sha256": "9b9b95abef174fa48dab6c996a56a9a1217e435436c9f62be23cd7533bc732f2" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:55196d84f5fc7d1b56dd03943dd8744a23e064b78928ebc4de85d8659a71c9ca", + "sha256": "55196d84f5fc7d1b56dd03943dd8744a23e064b78928ebc4de85d8659a71c9ca" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:8d21135e20ec4fcf07c27f35075dafd999bbfef927f55661ac2f0e8be2d27741", - "sha256": "8d21135e20ec4fcf07c27f35075dafd999bbfef927f55661ac2f0e8be2d27741" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:31c0c0ca68d7b2d3d12492c97a7e36547c88cddc8c6e195a3a4fb7b443a74f31", + "sha256": "31c0c0ca68d7b2d3d12492c97a7e36547c88cddc8c6e195a3a4fb7b443a74f31" }, "x86_64_linux": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:8c8910125f93c06e70669a396272165a06108022bd49efcdf4fefbc07eef6f2c", - "sha256": "8c8910125f93c06e70669a396272165a06108022bd49efcdf4fefbc07eef6f2c" + "url": "https://ghcr.io/v2/homebrew/core/mise/blobs/sha256:97e003f7841847029e38986685ec809b9a6eab9b66409e6baad4e568860a23aa", + "sha256": "97e003f7841847029e38986685ec809b9a6eab9b66409e6baad4e568860a23aa" } } } @@ -222,45 +222,45 @@ } }, "swiftformat": { - "version": "0.53.4", + "version": "0.53.5", "bottle": { "rebuild": 0, "root_url": "https://ghcr.io/v2/homebrew/core", "files": { "arm64_sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:97458313969207e9c5bd456f826573350ab3b9ca2fdaa53561cb8a07e31b354f", - "sha256": "97458313969207e9c5bd456f826573350ab3b9ca2fdaa53561cb8a07e31b354f" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:04e089d4b1ae1217dd6c8133b3c661add56d7c4f4f24ee67becd3cf8f54e6e80", + "sha256": "04e089d4b1ae1217dd6c8133b3c661add56d7c4f4f24ee67becd3cf8f54e6e80" }, "arm64_ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:77ac50bf35361686eb90a857fbe24ae8b90d30fea9631b155418c70835c7f550", - "sha256": "77ac50bf35361686eb90a857fbe24ae8b90d30fea9631b155418c70835c7f550" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:19a6ce102e7df1cdee150dee619025aa3b2a4980070bee4f8cdd6976c0936d46", + "sha256": "19a6ce102e7df1cdee150dee619025aa3b2a4980070bee4f8cdd6976c0936d46" }, "arm64_monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:b3c4fffad70c3844ca7551629fb0b4bef694d4ba3ae861895d9ea67b7602bb30", - "sha256": "b3c4fffad70c3844ca7551629fb0b4bef694d4ba3ae861895d9ea67b7602bb30" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:745ba037da0e1fe62f2f22faa45a17655b89d8870bacd9db32597ce1fd779509", + "sha256": "745ba037da0e1fe62f2f22faa45a17655b89d8870bacd9db32597ce1fd779509" }, "sonoma": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:1766d47e2caa79a65aa2bb2d7bf4981a6ce8413d4f4b99e798b2cac930d2917d", - "sha256": "1766d47e2caa79a65aa2bb2d7bf4981a6ce8413d4f4b99e798b2cac930d2917d" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:6830f0bd5d06dca19d2bcd614e6d0c87e7a3d703d33bce90d0448a83310dddcc", + "sha256": "6830f0bd5d06dca19d2bcd614e6d0c87e7a3d703d33bce90d0448a83310dddcc" }, "ventura": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:32596ab299daf61a756c09d055bc4bdc5d63b190787c1432fdbffa8236a2e964", - "sha256": "32596ab299daf61a756c09d055bc4bdc5d63b190787c1432fdbffa8236a2e964" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:dacbfeca6cbe99fc73448f08c0289f135e807bc220ac1dcb61952410f1b43535", + "sha256": "dacbfeca6cbe99fc73448f08c0289f135e807bc220ac1dcb61952410f1b43535" }, "monterey": { "cellar": ":any_skip_relocation", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:445e31123eddec655474956d1b3a3f81676ecf1d63a227fe891016b673e4c3dc", - "sha256": "445e31123eddec655474956d1b3a3f81676ecf1d63a227fe891016b673e4c3dc" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:a5e30f5378aca201ca8bc7a350ebac28b3202366be1b37cf254f77c27761753a", + "sha256": "a5e30f5378aca201ca8bc7a350ebac28b3202366be1b37cf254f77c27761753a" }, "x86_64_linux": { "cellar": "/home/linuxbrew/.linuxbrew/Cellar", - "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:15bb574d7afea06b1cefee619fb33c7dd135c3c85bce2c02fc4ee6989f578501", - "sha256": "15bb574d7afea06b1cefee619fb33c7dd135c3c85bce2c02fc4ee6989f578501" + "url": "https://ghcr.io/v2/homebrew/core/swiftformat/blobs/sha256:909ae79dbe735c9377355e202d07a58aeff1af1707ba7a3c843cf7c3b10f68a9", + "sha256": "909ae79dbe735c9377355e202d07a58aeff1af1707ba7a3c843cf7c3b10f68a9" } } } @@ -283,12 +283,12 @@ "system": { "macos": { "sonoma": { - "HOMEBREW_VERSION": "4.2.11-103-gcd1f040", + "HOMEBREW_VERSION": "4.2.15-75-g221fde4", "HOMEBREW_PREFIX": "/opt/homebrew", "Homebrew/homebrew-core": "api", "CLT": "15.3.0.0.1.1708646388", "Xcode": "15.3", - "macOS": "14.4" + "macOS": "14.4.1" } } } From 700a1e1463e8d6c0b0532205aa950b5fa4dc5a05 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 10:07:33 -0600 Subject: [PATCH 089/162] =?UTF-8?q?=E2=9E=95=20python=20(3.11)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mise.toml b/.mise.toml index f502ff5..db0b65f 100644 --- a/.mise.toml +++ b/.mise.toml @@ -6,6 +6,7 @@ [tools] act = "0.2.60" "npm:prettier" = "3.2.5" +python = "3.11" yamllint = "1.35.1" [settings] From 28dcc76ec18a05517f2a3e51404de786e1df38e2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 10:11:02 -0600 Subject: [PATCH 090/162] =?UTF-8?q?=F0=9F=9A=A8=20Resolve=20linter=20error?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 1 - script/bootstrap | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4b9fb0..000264a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -130,4 +130,3 @@ jobs: name: homebrew-bottles path: | .build/bottles/mas-*.bottle.tar.gz - diff --git a/script/bootstrap b/script/bootstrap index f05934e..426a97e 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -29,7 +29,6 @@ done main() { script/clean - echo "==> 👢 Bootstrapping" # Install Homebrew tools From 87fd066403e32de6beadc96ad7ceb492fea017bc Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 10:51:46 -0600 Subject: [PATCH 091/162] =?UTF-8?q?=F0=9F=9A=A8=20Remove=20unused=20dry=5F?= =?UTF-8?q?run=20variable=20from=20brew=5Ftap=5Fupdate=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_tap_update | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/script/brew_tap_update b/script/brew_tap_update index c6d2848..6af1350 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -26,28 +26,24 @@ if [[ $# -gt 3 ]]; then usage 1>&2 fi -echo='' -dry_run='' +echo='echo' # Detect presence of `-d` dry run option while getopts "d" o; do case "${o}" in d) echo='echo (DRY-RUN):' - dry_run='-d' ;; *) usage 1>&2 ;; esac done -shift $((OPTIND-1)) # DRY_RUN environment variable # shellcheck disable=SC2153 if [[ $DRY_RUN == 'true' ]]; then echo='echo (DRY-RUN):' - dry_run='-d' fi # arg 1 - version tag From 34ab84f30ed7d766e3fa8e11498821f4ab31d004 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 11:05:04 -0600 Subject: [PATCH 092/162] =?UTF-8?q?=F0=9F=9A=A8=20Format=20scripts=20and?= =?UTF-8?q?=20yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ---- script/bootstrap | 1 - script/bottle | 38 +++++++++++++++++------------------ script/brew_build_interactive | 2 +- script/brew_core_update | 7 +++---- script/brew_tap_update | 1 - script/format | 7 ++++++- script/lint | 7 ++++++- script/version_bump | 5 ++--- 9 files changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 000264a..7f68776 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,6 @@ jobs: start: runs-on: macos-14 steps: - # Logs event details and sets `DRY_RUN` env var # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=published#release @@ -52,7 +51,6 @@ jobs: runs-on: macos-14 needs: start steps: - - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version @@ -84,7 +82,6 @@ jobs: runs-on: macos-14 needs: start steps: - - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version @@ -103,7 +100,6 @@ jobs: runs-on: macos-14 needs: [start, homebrew-core] steps: - - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version diff --git a/script/bootstrap b/script/bootstrap index 426a97e..e6aac8e 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -41,7 +41,6 @@ main() { brew bundle install --verbose fi - if [[ ! -x "$(command -v mise)" ]]; then brew install mise fi diff --git a/script/bottle b/script/bottle index 9acb396..8d65637 100755 --- a/script/bottle +++ b/script/bottle @@ -46,25 +46,25 @@ echo "CURRENT_OS_VERSION_MAJOR: ${CURRENT_OS_VERSION_MAJOR}" echo "CURRENT_OS_VERSION_MINOR: ${CURRENT_OS_VERSION_MINOR}" case "${CURRENT_OS_VERSION_MAJOR}" in -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 better." - exit 1 - ;; + 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 better." + exit 1 + ;; esac # Prefix platform with architecture diff --git a/script/brew_build_interactive b/script/brew_build_interactive index 90947b0..654bb49 100755 --- a/script/brew_build_interactive +++ b/script/brew_build_interactive @@ -8,4 +8,4 @@ HOMEBREW_NO_INSTALL_FROM_API=1 \ brew reinstall \ - --interactive mas + --interactive mas diff --git a/script/brew_core_update b/script/brew_core_update index 2297ead..feed52a 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -46,7 +46,7 @@ while getopts "d" o; do ;; esac done -shift $((OPTIND-1)) +shift $((OPTIND - 1)) # DRY_RUN environment variable # shellcheck disable=SC2153 @@ -128,8 +128,8 @@ cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" HOMEBREW_NO_INSTALL_FROM_API=1 \ brew install mas \ - --build-from-source \ - --verbose + --build-from-source \ + --verbose # Audit formula brew audit --strict mas @@ -202,4 +202,3 @@ $echo gh pr create \ --base main \ --draft \ --fill - diff --git a/script/brew_tap_update b/script/brew_tap_update index 6af1350..4f6f07a 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -116,4 +116,3 @@ $echo gh pr create \ --fill popd - diff --git a/script/format b/script/format index fbf97ca..f1f6265 100755 --- a/script/format +++ b/script/format @@ -35,4 +35,9 @@ echo "--> 🖊 YAML" prettier --write $(yamllint --list-files .) echo "--> 📜 Bash" -shfmt -i 2 -l -w contrib/ script/ +shfmt \ + --write \ + --list \ + --indent 2 \ + --case-indent \ + contrib/ script/ diff --git a/script/lint b/script/lint index e6f9795..c95292d 100755 --- a/script/lint +++ b/script/lint @@ -38,4 +38,9 @@ yamllint . echo "--> 📜 Bash" shellcheck --shell=bash script/* -shfmt -d -i 2 -l contrib/ script/ +shfmt \ + --diff \ + --list \ + --indent 2 \ + --case-indent \ + contrib/ script/ diff --git a/script/version_bump b/script/version_bump index 4ea2a52..83ad244 100755 --- a/script/version_bump +++ b/script/version_bump @@ -51,7 +51,6 @@ cat "${PACKAGE_MANIFEST}" # Write new version into brew formulae for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do echo "${file}" - sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" - sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" + sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" + sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" done - From 388358ab99752bd1d96fa2397378e6211158b2e2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 11:56:02 -0600 Subject: [PATCH 093/162] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20python=20(3.12.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mise.toml b/.mise.toml index db0b65f..b8b1ccb 100644 --- a/.mise.toml +++ b/.mise.toml @@ -6,7 +6,7 @@ [tools] act = "0.2.60" "npm:prettier" = "3.2.5" -python = "3.11" +python = "3.12.2" yamllint = "1.35.1" [settings] From 08d64b38da2cb87228a9a959b5bb9542fd994b77 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 11:59:14 -0600 Subject: [PATCH 094/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20lint=20and=20to?= =?UTF-8?q?ols=20from=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-checks.yml | 2 -- .mise.toml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 3d8ff77..88be230 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -33,5 +33,3 @@ jobs: run: script/build - name: Test run: script/test - - name: Lint - run: script/lint diff --git a/.mise.toml b/.mise.toml index b8b1ccb..c0c7b45 100644 --- a/.mise.toml +++ b/.mise.toml @@ -6,8 +6,6 @@ [tools] act = "0.2.60" "npm:prettier" = "3.2.5" -python = "3.12.2" -yamllint = "1.35.1" [settings] experimental = true From f79165e2077af223f4110048127808b2204a157f Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 13:16:30 -0600 Subject: [PATCH 095/162] =?UTF-8?q?=F0=9F=9A=80=20Replace=20upload-artifac?= =?UTF-8?q?t=20action=20with=20gh=20CLI=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Actually uploading to a release now --- .github/workflows/release.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f68776..818ccca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=published#release - name: 🔈 Log release event + # This step will only run for a real 'release' event. if: ${{ github.event.release.name != '' }} run: | echo "Triggered by a release publication event (wet run)" @@ -71,12 +72,10 @@ jobs: script/package - name: 🚀 Upload mas.pkg - uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} - with: - if-no-files-found: error - name: mas.pkg - path: .build/mas.pkg + run: | + gh release upload ${MAS_VERSION} \ + .build/mas.pkg homebrew-core: runs-on: macos-14 @@ -119,10 +118,7 @@ jobs: script/bottle - name: 🚀 Upload Bottles - uses: actions/upload-artifact@v3 if: ${{ env.DRY_RUN == 'false' }} - with: - if-no-files-found: error - name: homebrew-bottles - path: | + run: | + gh release upload ${MAS_VERSION} \ .build/bottles/mas-*.bottle.tar.gz From 557b56161bf1726edacdfaeb83f4a686648914e1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 13:38:20 -0600 Subject: [PATCH 096/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20push=20hook=20a?= =?UTF-8?q?nd=20env=20values=20used=20for=20testing=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 818ccca..dafc945 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,18 +7,7 @@ defaults: run: # Prefixes all `run` commands with the following command to force them to run outside Rosetta. shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} -env: - DRY_RUN: true - # Dry run version pinned to real release for testing brew build system - MAS_VERSION: v1.8.7-beta.1 - RELEASE_COMMIT: f8be3e9aaa6c78490277976f17041f2577f5dc21 on: - # The `push` event is used only for testing while making changes to this workflow. - # This will be detected by the `github.event.release.name` being empty which - # switches the logic into "dry run" mode. - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push - push: - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release release: types: [published] jobs: From 0c151ddf60f10cfdae31f272bb5c19ece69fd79e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 13:44:40 -0600 Subject: [PATCH 097/162] =?UTF-8?q?=E2=8F=AE=EF=B8=8F=20Restore=20.hound.y?= =?UTF-8?q?ml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hound.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .hound.yml diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 0000000..79acba6 --- /dev/null +++ b/.hound.yml @@ -0,0 +1,20 @@ +# +# .hound.yml +# mas +# +# http://help.houndci.com/configuration/swiftlint +# +--- +fail_on_violations: false + +erblint: + enabled: false + +rubocop: + enabled: false + +shellcheck: + enabled: true + +swiftlint: + enabled: false From b33f7abca46eac390247e0602e4f772b2249d2ad Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 14:40:41 -0600 Subject: [PATCH 098/162] =?UTF-8?q?=F0=9F=9A=A8=20Quote=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 2 +- script/version_bump | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index feed52a..4188dec 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -79,7 +79,7 @@ echo "REVISION: ${REVISION}" # Update Version # -script/version_bump "${MAS_VERSION}" "$REVISION" +script/version_bump "${MAS_VERSION}" "${REVISION}" branch_name="releases/release-${MAS_VERSION}" $echo git branch "${branch_name}" diff --git a/script/version_bump b/script/version_bump index 83ad244..7d14047 100755 --- a/script/version_bump +++ b/script/version_bump @@ -24,7 +24,7 @@ fi # arg 1 - version tag if test -n "${1}"; then - MAS_VERSION=${1} + MAS_VERSION="${1}" fi # arg 2 - revision (commit hash) From d3066609d5d4131d55d618190977ec6896382c66 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 14:46:52 -0600 Subject: [PATCH 099/162] =?UTF-8?q?=F0=9F=94=A8=20Set=20PREFIX=20to=20/usr?= =?UTF-8?q?/local=20in=20install=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes install script when executed in sandbox ==> script/install /opt/homebrew/Cellar/mas/1.8.7-beta.2 script/install: line 16: brew: command not found --- script/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/install b/script/install index 5237a7d..b3faa71 100755 --- a/script/install +++ b/script/install @@ -13,7 +13,7 @@ ARCH=$(uname -m) RELEASE=.build/${ARCH}-apple-macosx/release MAS_VERSION=$(script/version) -PREFIX=$(brew --prefix) +PREFIX=/usr/local while test -n "$1"; do if [[ "$1" == '--universal' ]]; then From b227aca6dc770e69282e55d5bcd42e84d1b7a0ff Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 15:00:00 -0600 Subject: [PATCH 100/162] =?UTF-8?q?=F0=9F=94=8A=20Log=20commands=20in=20ho?= =?UTF-8?q?mebrew=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 2 +- script/brew_tap_update | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index 4188dec..cb2cdea 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # # script/brew_core_update # mas diff --git a/script/brew_tap_update b/script/brew_tap_update index 4f6f07a..92b495c 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # # script/brew_tap_update # mas From 4c01f142554cbafdd09cc5e6e1cd05f5d8e19dd1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 14:57:06 -0600 Subject: [PATCH 101/162] =?UTF-8?q?=F0=9F=94=A8=20Change=20brew=5Fcore=5Fu?= =?UTF-8?q?pdate=20dry=20run=20to=20only=20run=20bump-formula-pr=20once?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dry_run --- script/brew_core_update | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index cb2cdea..a0d90f7 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -151,13 +151,6 @@ popd echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" -if [[ $dry_run == '-d' ]]; then - # -n, --dry-run Print what would be done rather than doing - # it. - # --write-only Make the expected file modifications without - # taking any Git actions. - dry_run="--dry-run" -fi echo "Validating formula" brew bump-formula-pr \ @@ -165,7 +158,9 @@ brew bump-formula-pr \ --revision="${REVISION}" \ --strict \ --verbose \ - "${dry_run}" \ + --no-browse \ + --fork-org mas-cli \ + --dry-run \ mas # brew exit status @@ -175,6 +170,10 @@ if [[ ${status} -ne 0 ]]; then exit ${status} fi +if [[ $dry_run == '-d' ]]; then + exit 0 +fi + pushd "${CORE_FORMULA_PATH}" echo "Updating homebrew/core formula with a PR" @@ -182,12 +181,12 @@ echo "Updating homebrew/core formula with a PR" $echo brew bump-formula-pr \ --tag="${MAS_VERSION}" \ --revision="${REVISION}" \ - --commit \ - --fork-org mas-cli \ - --online \ --strict \ --verbose \ - "${dry_run}" \ + --online \ + --no-browse \ + --fork-org mas-cli \ + --commit \ mas popd From aa4ce7cdde21e77ff8a90a6fcbc8421f29fc2a3b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 31 Mar 2024 15:13:30 -0600 Subject: [PATCH 102/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20--commit=20opti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 1 - 1 file changed, 1 deletion(-) diff --git a/script/brew_core_update b/script/brew_core_update index a0d90f7..9a7a99e 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -186,7 +186,6 @@ $echo brew bump-formula-pr \ --online \ --no-browse \ --fork-org mas-cli \ - --commit \ mas popd From 442dc96f271fbbc22a394236ffb7df3cb9a4ecf4 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Mon, 29 Jul 2024 17:12:24 -0600 Subject: [PATCH 103/162] =?UTF-8?q?=F0=9F=99=88=20Ignore=20.vscode/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f274733..073f705 100644 --- a/.gitignore +++ b/.gitignore @@ -28,13 +28,14 @@ .rubygems/ .secrets .swiftpm/ +.vscode/ Carthage/ DerivedData Pods/ Temporary Items bin/ build/ -gha/ default.profraw +gha/ releases/ xcuserdata From 9ae9cbaf4bfbc943ca197c926f934ea58ccc47a1 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Mon, 29 Jul 2024 17:16:25 -0600 Subject: [PATCH 104/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Move=20homebrew-tap=20before=20homebrew-co?= =?UTF-8?q?re=20in=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dafc945..353a15b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,24 +66,6 @@ jobs: gh release upload ${MAS_VERSION} \ .build/mas.pkg - homebrew-core: - runs-on: macos-14 - needs: start - steps: - - uses: actions/checkout@v4 - with: - # A fetch-depth of 0 includes all history and tags for script/version - fetch-depth: 0 - - - name: 👢 Bootstrap - run: | - script/bootstrap -f - - - name: 🍺 Update Homebrew mas formula - run: | - DRY_RUN=${{ env.DRY_RUN }} \ - script/brew_core_update ${{ env.MAS_VERSION }} - homebrew-tap: runs-on: macos-14 needs: [start, homebrew-core] @@ -111,3 +93,22 @@ jobs: run: | gh release upload ${MAS_VERSION} \ .build/bottles/mas-*.bottle.tar.gz + + homebrew-core: + runs-on: macos-14 + needs: start + steps: + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + + - name: 👢 Bootstrap + run: | + script/bootstrap -f + + - name: 🍺 Update Homebrew mas formula + run: | + DRY_RUN=${{ env.DRY_RUN }} \ + script/brew_core_update ${{ env.MAS_VERSION }} + From 56a3ffcdf758d20a56d60e5942d4e82d36597f85 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Mon, 29 Jul 2024 17:38:02 -0600 Subject: [PATCH 105/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Update=20job=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 353a15b..6914b2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,7 @@ jobs: homebrew-tap: runs-on: macos-14 - needs: [start, homebrew-core] + needs: [start] steps: - uses: actions/checkout@v4 with: @@ -96,7 +96,7 @@ jobs: homebrew-core: runs-on: macos-14 - needs: start + needs: [start, homebrew-tap] steps: - uses: actions/checkout@v4 with: From 78757ab57f11e8c0c5fa17dcaa41149f2276e2f3 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Mon, 29 Jul 2024 17:47:03 -0600 Subject: [PATCH 106/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20bottle=20step?= =?UTF-8?q?=20from=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is already part of brew_tap_update --- .github/workflows/release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6914b2e..474d852 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,10 +84,6 @@ jobs: DRY_RUN=${{ env.DRY_RUN }} \ script/brew_tap_update ${{ env.MAS_VERSION }} - - name: 🍼 Homebrew Bottles for mas tap - run: | - script/bottle - - name: 🚀 Upload Bottles if: ${{ env.DRY_RUN == 'false' }} run: | From 76d380d5023568fe52c2a1b3fe9a82e6b369a451 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Mon, 29 Jul 2024 18:05:50 -0600 Subject: [PATCH 107/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Add=20version-update=20job=20to=20release?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Need to call version_bump before both homebrew jobs --- .github/workflows/release.yml | 30 +++++++++++++++++++++++++++--- script/brew_core_update | 20 -------------------- script/version_bump | 6 +++--- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 474d852..4fdd232 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,9 +37,33 @@ jobs: echo "MAS_VERSION: ${MAS_VERSION}" echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" + version-update: + runs-on: macos-14 + needs: [start] + steps: + - uses: actions/checkout@v4 + with: + # A fetch-depth of 0 includes all history and tags for script/version + fetch-depth: 0 + + - name: 🔖 version + run: | + script/version_bump "${MAS_VERSION}" "${RELEASE_COMMIT}" + +# branch_name="releases/release-${MAS_VERSION}" +# $echo git branch "${branch_name}" +# $echo git switch "${branch_name}" + +# $echo git add \ +# "${SWIFT_PACKAGE}" \ +# "${LOCAL_MAS_FORMULA_PATH}" \ +# "${LOCAL_TAP_FORMULA_PATH}" + +# $echo git commit --message="🔖 Version ${MAS_VERSION}" + pkg-installer: runs-on: macos-14 - needs: start + needs: [version-update] steps: - uses: actions/checkout@v4 with: @@ -68,7 +92,7 @@ jobs: homebrew-tap: runs-on: macos-14 - needs: [start] + needs: [version-update] steps: - uses: actions/checkout@v4 with: @@ -92,7 +116,7 @@ jobs: homebrew-core: runs-on: macos-14 - needs: [start, homebrew-tap] + needs: [version-update, homebrew-tap] steps: - uses: actions/checkout@v4 with: diff --git a/script/brew_core_update b/script/brew_core_update index 9a7a99e..e2fafc6 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -14,9 +14,7 @@ CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" PROJECT_PATH="$(git rev-parse --show-toplevel)" -SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" -LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" function usage { echo "Usage: brew_core_update [-d] v0.0 [sha1_hash]" @@ -74,24 +72,6 @@ fi echo "REVISION: ${REVISION}" -################################################################################ -# -# Update Version -# - -script/version_bump "${MAS_VERSION}" "${REVISION}" - -branch_name="releases/release-${MAS_VERSION}" -$echo git branch "${branch_name}" -$echo git switch "${branch_name}" - -$echo git add \ - "${SWIFT_PACKAGE}" \ - "${LOCAL_MAS_FORMULA_PATH}" \ - "${LOCAL_TAP_FORMULA_PATH}" - -$echo git commit --message="🔖 Version ${MAS_VERSION}" - ################################################################################ # # Preflight checks diff --git a/script/version_bump b/script/version_bump index 7d14047..62fc393 100755 --- a/script/version_bump +++ b/script/version_bump @@ -7,7 +7,7 @@ # PROJECT_PATH="$(git rev-parse --show-toplevel)" -PACKAGE_MANIFEST="${PROJECT_PATH}/Sources/MasKit/Package.swift" +SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" @@ -38,7 +38,7 @@ echo "MAS_VERSION: ${MAS_VERSION}" echo "REVISION: ${REVISION}" # Write new version into swift package -cat <"${PACKAGE_MANIFEST}" +cat <"${SWIFT_PACKAGE}" // Generated by: script/version enum Package { static let version = "${MAS_VERSION#v}" @@ -46,7 +46,7 @@ enum Package { EOF echo -cat "${PACKAGE_MANIFEST}" +cat "${SWIFT_PACKAGE}" # Write new version into brew formulae for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do From bc93e914f9737310314df4de35e49f10ed2767ce Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 17:29:40 -0600 Subject: [PATCH 108/162] =?UTF-8?q?=F0=9F=94=A7=20Add=20RELEASE=5FBRANCH?= =?UTF-8?q?=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fdd232..edbf6c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,12 +29,14 @@ jobs: echo "DRY_RUN=false" >>$GITHUB_ENV echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_ENV} + echo "RELEASE_BRANCH=releases/release-${{ MAS_VERSION }}" >>${GITHUB_ENV} echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_ENV} - name: 🔈 Log environment variables run: | echo "DRY_RUN: ${DRY_RUN}" echo "MAS_VERSION: ${MAS_VERSION}" + echo "RELEASE_BRANCH: ${RELEASE_BRANCH}" echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" version-update: From 97fa10f02c38606298106822ee917faf594f1fae Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 17:53:50 -0600 Subject: [PATCH 109/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Rework=20and=20rename=20prepare-release=20?= =?UTF-8?q?job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 45 ++++++++++++++++++++++------------- script/version_bump | 2 +- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edbf6c3..2629921 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,17 +29,15 @@ jobs: echo "DRY_RUN=false" >>$GITHUB_ENV echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_ENV} - echo "RELEASE_BRANCH=releases/release-${{ MAS_VERSION }}" >>${GITHUB_ENV} echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_ENV} - name: 🔈 Log environment variables run: | echo "DRY_RUN: ${DRY_RUN}" echo "MAS_VERSION: ${MAS_VERSION}" - echo "RELEASE_BRANCH: ${RELEASE_BRANCH}" echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" - version-update: + prepare-release: runs-on: macos-14 needs: [start] steps: @@ -48,24 +46,39 @@ jobs: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 - - name: 🔖 version + - name: 🔀 Create release branch + run: | + branch_name="releases/release-${MAS_VERSION}" + echo "RELEASE_BRANCH=${branch_name}" >>${GITHUB_ENV} + git branch "${branch_name}" + git switch "${branch_name}" + + - name: 🔖 Update version run: | script/version_bump "${MAS_VERSION}" "${RELEASE_COMMIT}" -# branch_name="releases/release-${MAS_VERSION}" -# $echo git branch "${branch_name}" -# $echo git switch "${branch_name}" + - name: 💾 Commit changes + run: | + git add \ + "Homebrew/mas.rb" \ + "Homebrew/mas-tap.rb" \ + "Sources/MasKit/Package.swift" + git commit \ + --message="🔖 Version ${MAS_VERSION}" -# $echo git add \ -# "${SWIFT_PACKAGE}" \ -# "${LOCAL_MAS_FORMULA_PATH}" \ -# "${LOCAL_TAP_FORMULA_PATH}" - -# $echo git commit --message="🔖 Version ${MAS_VERSION}" + - name: ⤴️ Open PR + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr create \ + --base main \ + --head "${RELEASE_BRANCH}" \ + --title "🔖 Version ${MAS_VERSION}" \ + --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." pkg-installer: runs-on: macos-14 - needs: [version-update] + needs: [prepare-release] steps: - uses: actions/checkout@v4 with: @@ -94,7 +107,7 @@ jobs: homebrew-tap: runs-on: macos-14 - needs: [version-update] + needs: [prepare-release] steps: - uses: actions/checkout@v4 with: @@ -118,7 +131,7 @@ jobs: homebrew-core: runs-on: macos-14 - needs: [version-update, homebrew-tap] + needs: [prepare-release, homebrew-tap] steps: - uses: actions/checkout@v4 with: diff --git a/script/version_bump b/script/version_bump index 62fc393..3a34433 100755 --- a/script/version_bump +++ b/script/version_bump @@ -7,9 +7,9 @@ # PROJECT_PATH="$(git rev-parse --show-toplevel)" -SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" +SWIFT_PACKAGE="${PROJECT_PATH}/Sources/MasKit/Package.swift" function usage { echo "Usage: version_bump v0.0 [sha1_hash]" From 5b5ba9213ab87719eb220ba1fdbb8a22467a833e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 18:02:10 -0600 Subject: [PATCH 110/162] =?UTF-8?q?=F0=9F=90=9B=20Fix=20variable=20handlin?= =?UTF-8?q?g=20using=20job=20outputs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 78 ++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2629921..b0edda7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,11 @@ on: jobs: start: runs-on: macos-14 + outputs: + dry_run: ${{ steps.dry_run.outputs.dry_run }} + mas_version: ${{ steps.mas_version.outputs.mas_version }} + release_branch: ${{ steps.release_branch.outputs.release_branch }} + release_commit: ${{ steps.release_commit.outputs.release_commit }} steps: # Logs event details and sets `DRY_RUN` env var # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable @@ -27,15 +32,21 @@ jobs: echo "release.target_commitish: ${{ github.event.release.target_commitish }}" echo -e "release.body: \n${{ github.event.release.body }}" - echo "DRY_RUN=false" >>$GITHUB_ENV - echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>${GITHUB_ENV} - echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>${GITHUB_ENV} - - - name: 🔈 Log environment variables + - id: dry_run run: | - echo "DRY_RUN: ${DRY_RUN}" - echo "MAS_VERSION: ${MAS_VERSION}" - echo "RELEASE_COMMIT: ${RELEASE_COMMIT}" + echo "DRY_RUN=false" >>"$GITHUB_OUTPUT" + + - id: mas_version + run: | + echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>"$GITHUB_OUTPUT" + + - id: release_branch + run: | + echo "RELEASE_BRANCH=releases/release-${{ github.event.release.tag_name }}" >>"$GITHUB_OUTPUT" + + - id: release_commit + run: | + echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>"$GITHUB_OUTPUT" prepare-release: runs-on: macos-14 @@ -47,38 +58,45 @@ jobs: fetch-depth: 0 - name: 🔀 Create release branch + env: + RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | - branch_name="releases/release-${MAS_VERSION}" - echo "RELEASE_BRANCH=${branch_name}" >>${GITHUB_ENV} - git branch "${branch_name}" - git switch "${branch_name}" + git branch "${{ env.RELEASE_BRANCH }}" + git switch "${{ env.RELEASE_BRANCH }}" - name: 🔖 Update version + env: + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + RELEASE_COMMIT: ${{ needs.start.outputs.release_commit }} run: | - script/version_bump "${MAS_VERSION}" "${RELEASE_COMMIT}" + script/version_bump "${{ env.MAS_VERSION }}" "${{ env.RELEASE_COMMIT }}" - name: 💾 Commit changes + env: + MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | git add \ "Homebrew/mas.rb" \ "Homebrew/mas-tap.rb" \ "Sources/MasKit/Package.swift" git commit \ - --message="🔖 Version ${MAS_VERSION}" + --message="🔖 Version ${{ env.MAS_VERSION }}" - name: ⤴️ Open PR env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | gh pr create \ --base main \ - --head "${RELEASE_BRANCH}" \ - --title "🔖 Version ${MAS_VERSION}" \ - --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." + --head "${{ env.RELEASE_BRANCH }}" \ + --title "🔖 Version ${{ env.MAS_VERSION }}" \ + --body "This PR contains the changes from releasing version [${{ env.MAS_VERSION }}](https://github.com/mas-cli/mas/releases/tag/${{ env.MAS_VERSION }})." pkg-installer: runs-on: macos-14 - needs: [prepare-release] + needs: [start, prepare-release] steps: - uses: actions/checkout@v4 with: @@ -100,14 +118,17 @@ jobs: script/package - name: 🚀 Upload mas.pkg - if: ${{ env.DRY_RUN == 'false' }} + env: + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + if: ${{ needs.start.outputs.dry_run == 'false' }} run: | - gh release upload ${MAS_VERSION} \ + gh release upload ${{ env.MAS_VERSION }} \ .build/mas.pkg homebrew-tap: runs-on: macos-14 - needs: [prepare-release] + needs: [start, prepare-release] steps: - uses: actions/checkout@v4 with: @@ -119,19 +140,25 @@ jobs: script/bootstrap -f - name: 🚰 Update mas tap formula + env: + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | DRY_RUN=${{ env.DRY_RUN }} \ script/brew_tap_update ${{ env.MAS_VERSION }} - name: 🚀 Upload Bottles - if: ${{ env.DRY_RUN == 'false' }} + env: + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + if: ${{ needs.start.outputs.dry_run == 'false' }} run: | - gh release upload ${MAS_VERSION} \ + gh release upload ${{ env.MAS_VERSION }} \ .build/bottles/mas-*.bottle.tar.gz homebrew-core: runs-on: macos-14 - needs: [prepare-release, homebrew-tap] + needs: [start, prepare-release, homebrew-tap] steps: - uses: actions/checkout@v4 with: @@ -143,6 +170,9 @@ jobs: script/bootstrap -f - name: 🍺 Update Homebrew mas formula + env: + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | DRY_RUN=${{ env.DRY_RUN }} \ script/brew_core_update ${{ env.MAS_VERSION }} From cfa3c70ef316ea77f0c05b7435d1b1584e360d9d Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 20:11:01 -0600 Subject: [PATCH 111/162] =?UTF-8?q?=F0=9F=90=9B=20Use=20script=20variable?= =?UTF-8?q?=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0edda7..f9b73d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,15 +61,15 @@ jobs: env: RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | - git branch "${{ env.RELEASE_BRANCH }}" - git switch "${{ env.RELEASE_BRANCH }}" + git branch "${RELEASE_BRANCH}" + git switch "${RELEASE_BRANCH}" - name: 🔖 Update version env: MAS_VERSION: ${{ needs.start.outputs.mas_version }} RELEASE_COMMIT: ${{ needs.start.outputs.release_commit }} run: | - script/version_bump "${{ env.MAS_VERSION }}" "${{ env.RELEASE_COMMIT }}" + script/version_bump "${MAS_VERSION}" "${RELEASE_COMMIT}" - name: 💾 Commit changes env: @@ -80,7 +80,7 @@ jobs: "Homebrew/mas-tap.rb" \ "Sources/MasKit/Package.swift" git commit \ - --message="🔖 Version ${{ env.MAS_VERSION }}" + --message="🔖 Version ${MAS_VERSION}" - name: ⤴️ Open PR env: @@ -90,9 +90,9 @@ jobs: run: | gh pr create \ --base main \ - --head "${{ env.RELEASE_BRANCH }}" \ - --title "🔖 Version ${{ env.MAS_VERSION }}" \ - --body "This PR contains the changes from releasing version [${{ env.MAS_VERSION }}](https://github.com/mas-cli/mas/releases/tag/${{ env.MAS_VERSION }})." + --head "${RELEASE_BRANCH}" \ + --title "🔖 Version ${MAS_VERSION}" \ + --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." pkg-installer: runs-on: macos-14 @@ -123,7 +123,7 @@ jobs: MAS_VERSION: ${{ needs.start.outputs.mas_version }} if: ${{ needs.start.outputs.dry_run == 'false' }} run: | - gh release upload ${{ env.MAS_VERSION }} \ + gh release upload ${MAS_VERSION} \ .build/mas.pkg homebrew-tap: @@ -144,8 +144,8 @@ jobs: DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | - DRY_RUN=${{ env.DRY_RUN }} \ - script/brew_tap_update ${{ env.MAS_VERSION }} + DRY_RUN=${DRY_RUN} \ + script/brew_tap_update ${MAS_VERSION} - name: 🚀 Upload Bottles env: @@ -153,7 +153,7 @@ jobs: MAS_VERSION: ${{ needs.start.outputs.mas_version }} if: ${{ needs.start.outputs.dry_run == 'false' }} run: | - gh release upload ${{ env.MAS_VERSION }} \ + gh release upload ${MAS_VERSION} \ .build/bottles/mas-*.bottle.tar.gz homebrew-core: @@ -174,6 +174,6 @@ jobs: DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | - DRY_RUN=${{ env.DRY_RUN }} \ - script/brew_core_update ${{ env.MAS_VERSION }} + DRY_RUN=${DRY_RUN} \ + script/brew_core_update ${MAS_VERSION} From 8b270a1c49ef709f9e7781c7d49f12bc037d5ebd Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 20:27:03 -0600 Subject: [PATCH 112/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Add=20bootstrap=20to=20prepare-release=20j?= =?UTF-8?q?ob?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9b73d5..5ca6567 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,6 +57,10 @@ jobs: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + - name: 👢 Bootstrap + run: | + script/bootstrap -f + - name: 🔀 Create release branch env: RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} From ba97743d8d03bf27716dea17619258fe8798fc89 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 20:36:16 -0600 Subject: [PATCH 113/162] =?UTF-8?q?=F0=9F=90=9B=20Push=20branch=20before?= =?UTF-8?q?=20opening=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ca6567..e2e6ea2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,7 @@ jobs: - name: 💾 Commit changes env: MAS_VERSION: ${{ needs.start.outputs.mas_version }} + RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | git add \ "Homebrew/mas.rb" \ @@ -85,6 +86,8 @@ jobs: "Sources/MasKit/Package.swift" git commit \ --message="🔖 Version ${MAS_VERSION}" + git push \ + --set-upstream origin "${RELEASE_BRANCH}" - name: ⤴️ Open PR env: From bc88359d1c94499a02a2d168f70096de6eff8622 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 20:42:10 -0600 Subject: [PATCH 114/162] =?UTF-8?q?=F0=9F=94=90=20Add=20GH=5FTOKEN=20to=20?= =?UTF-8?q?steps=20using=20gh=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2e6ea2..01787b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,7 +91,7 @@ jobs: - name: ⤴️ Open PR env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | @@ -126,6 +126,7 @@ jobs: - name: 🚀 Upload mas.pkg env: + GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} if: ${{ needs.start.outputs.dry_run == 'false' }} @@ -156,6 +157,7 @@ jobs: - name: 🚀 Upload Bottles env: + GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} if: ${{ needs.start.outputs.dry_run == 'false' }} From 0c701cc04772507ab67ddcf992ee24f7f395ae92 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 20:47:28 -0600 Subject: [PATCH 115/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Checkout=20release=20branch=20in=20downstr?= =?UTF-8?q?eam=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01787b5..d074c8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -109,6 +109,7 @@ jobs: with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + ref: ${{ needs.start.outputs.release_branch }} - name: 👢 Bootstrap run: | @@ -142,6 +143,7 @@ jobs: with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + ref: ${{ needs.start.outputs.release_branch }} - name: 👢 Bootstrap run: | @@ -173,6 +175,7 @@ jobs: with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + ref: ${{ needs.start.outputs.release_branch }} - name: 👢 Bootstrap run: | From adcad9c38b583bfa6b3d4bd031a2598ff434c203 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:18:37 -0600 Subject: [PATCH 116/162] =?UTF-8?q?=F0=9F=90=9B=20Remove=20problematic=20R?= =?UTF-8?q?ELEASE=5FCOMMIT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d074c8f..15c1d95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,6 @@ jobs: dry_run: ${{ steps.dry_run.outputs.dry_run }} mas_version: ${{ steps.mas_version.outputs.mas_version }} release_branch: ${{ steps.release_branch.outputs.release_branch }} - release_commit: ${{ steps.release_commit.outputs.release_commit }} steps: # Logs event details and sets `DRY_RUN` env var # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable @@ -44,10 +43,6 @@ jobs: run: | echo "RELEASE_BRANCH=releases/release-${{ github.event.release.tag_name }}" >>"$GITHUB_OUTPUT" - - id: release_commit - run: | - echo "RELEASE_COMMIT=${{ github.event.release.target_commitish }}" >>"$GITHUB_OUTPUT" - prepare-release: runs-on: macos-14 needs: [start] @@ -71,9 +66,8 @@ jobs: - name: 🔖 Update version env: MAS_VERSION: ${{ needs.start.outputs.mas_version }} - RELEASE_COMMIT: ${{ needs.start.outputs.release_commit }} run: | - script/version_bump "${MAS_VERSION}" "${RELEASE_COMMIT}" + script/version_bump "${MAS_VERSION}" - name: 💾 Commit changes env: From 3b5d335fca5ed4b7a2068e281a025a541007c51b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:28:20 -0600 Subject: [PATCH 117/162] =?UTF-8?q?=F0=9F=94=A7=20Disable=20dry-run=20in?= =?UTF-8?q?=20brew=5Ftap=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_tap_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/brew_tap_update b/script/brew_tap_update index 92b495c..8445d2d 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -26,7 +26,7 @@ if [[ $# -gt 3 ]]; then usage 1>&2 fi -echo='echo' +echo='' # Detect presence of `-d` dry run option while getopts "d" o; do From 20f2d3f0e2859d5f6818796904917c36190c3616 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:28:43 -0600 Subject: [PATCH 118/162] =?UTF-8?q?=F0=9F=94=90=20Add=20GH=5FTOKEN=20to=20?= =?UTF-8?q?tap=20update=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15c1d95..365bba6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -145,6 +145,7 @@ jobs: - name: 🚰 Update mas tap formula env: + GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | From 94258eaf64e6904605e6713f45025fed8a69cc75 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:34:30 -0600 Subject: [PATCH 119/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Push=20tap=20branch=20and=20add=20details?= =?UTF-8?q?=20to=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 ++ script/brew_tap_update | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 365bba6..688f07f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,7 +90,9 @@ jobs: RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | gh pr create \ + --assignee phatblat \ --base main \ + --draft \ --head "${RELEASE_BRANCH}" \ --title "🔖 Version ${MAS_VERSION}" \ --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." diff --git a/script/brew_tap_update b/script/brew_tap_update index 8445d2d..1792e5a 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -65,14 +65,6 @@ fi echo "REVISION: ${REVISION}" -################################################################################ -# -# Update Version -# - -branch_name="releases/release-${MAS_VERSION}" -$echo git switch "${branch_name}" - ################################################################################ # # Create branch on mas-cli/homebrew-tap @@ -97,6 +89,8 @@ $echo git add \ $echo git commit --message="🔖 Version ${MAS_VERSION}" +$echo git push --set-upstream origin "${branch_name}" + popd # Build in mas project @@ -113,6 +107,9 @@ $echo gh pr create \ --assignee phatblat \ --base main \ --draft \ - --fill + --head "${branch_name}" \ + --title "🔖 Version ${MAS_VERSION}" \ + --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." + popd From c00c7653d94c319c33dbdc7795c5f36237c5f74f Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:36:18 -0600 Subject: [PATCH 120/162] =?UTF-8?q?=F0=9F=94=90=20Add=20GH=5FTOKEN=20to=20?= =?UTF-8?q?core=20update=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 688f07f..b7220f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -180,6 +180,7 @@ jobs: - name: 🍺 Update Homebrew mas formula env: + GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | From 91f74918d8b5428c78aceb4b979abf3261e8af3a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:36:33 -0600 Subject: [PATCH 121/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20PR=20creation?= =?UTF-8?q?=20from=20brew=5Fcore=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index e2fafc6..468e225 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -169,14 +169,3 @@ $echo brew bump-formula-pr \ mas popd - -################################################################################ -# -# Create pr on mas-cli/mas -# - -$echo gh pr create \ - --assignee phatblat \ - --base main \ - --draft \ - --fill From 53319d911d76f27e0e11eb63fa07f4f64c65d632 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:51:32 -0600 Subject: [PATCH 122/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Extract=20PR=20cre?= =?UTF-8?q?ation=20from=20brew=5Ftap=5Fupdate=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 15 +++++++++++++++ script/brew_tap_update | 18 ------------------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7220f1..4fdfe09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,6 +154,21 @@ jobs: DRY_RUN=${DRY_RUN} \ script/brew_tap_update ${MAS_VERSION} + - name: Open mas tap PR + env: + GH_TOKEN: ${{ github.token }} + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + run: | + cd "$(brew --repository mas-cli/tap)" + gh pr create \ + --assignee phatblat \ + --base main \ + --draft \ + --head "${branch_name}" \ + --title "🔖 Version ${MAS_VERSION}" \ + --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." + - name: 🚀 Upload Bottles env: GH_TOKEN: ${{ github.token }} diff --git a/script/brew_tap_update b/script/brew_tap_update index 1792e5a..0991898 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -95,21 +95,3 @@ popd # Build in mas project script/bottle - -################################################################################ -# -# Create PR on mas-cli/homebrew-tap -# - -pushd "${MAS_TAP_PATH}" - -$echo gh pr create \ - --assignee phatblat \ - --base main \ - --draft \ - --head "${branch_name}" \ - --title "🔖 Version ${MAS_VERSION}" \ - --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." - - -popd From 52c96db818c49e01fab5341eaef2a160047f2738 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Tue, 30 Jul 2024 21:56:07 -0600 Subject: [PATCH 123/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Extract=20git=20pu?= =?UTF-8?q?sh=20from=20brew=5Ftap=5Fupdate=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 +++- script/brew_tap_update | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fdfe09..9b4b52a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -158,14 +158,16 @@ jobs: env: GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} + RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | cd "$(brew --repository mas-cli/tap)" + git push --set-upstream origin "${RELEASE_BRANCH}" gh pr create \ --assignee phatblat \ --base main \ --draft \ - --head "${branch_name}" \ + --head "${RELEASE_BRANCH}" \ --title "🔖 Version ${MAS_VERSION}" \ --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." diff --git a/script/brew_tap_update b/script/brew_tap_update index 0991898..5f4da16 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -89,8 +89,6 @@ $echo git add \ $echo git commit --message="🔖 Version ${MAS_VERSION}" -$echo git push --set-upstream origin "${branch_name}" - popd # Build in mas project From 0578f0c850b4e47fea6aa560bd08c864326454ee Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Wed, 31 Jul 2024 21:04:54 -0600 Subject: [PATCH 124/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Pull=20tap=20git?= =?UTF-8?q?=20commands=20up=20into=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 +++++++++++++++++++++++------------ script/bottle | 20 +++++++++----------- script/brew_core_update | 9 ++++----- script/brew_tap_update | 28 +--------------------------- 4 files changed, 37 insertions(+), 55 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b4b52a..db8d426 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: run: | script/bootstrap -f - - name: 🔀 Create release branch + - name: 🔀 Create mas release branch env: RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} run: | @@ -83,7 +83,7 @@ jobs: git push \ --set-upstream origin "${RELEASE_BRANCH}" - - name: ⤴️ Open PR + - name: ⤴️ Open release PR env: GH_TOKEN: ${{ github.token }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} @@ -145,23 +145,25 @@ jobs: run: | script/bootstrap -f - - name: 🚰 Update mas tap formula - env: - GH_TOKEN: ${{ github.token }} - DRY_RUN: ${{ needs.start.outputs.dry_run }} - MAS_VERSION: ${{ needs.start.outputs.mas_version }} - run: | - DRY_RUN=${DRY_RUN} \ - script/brew_tap_update ${MAS_VERSION} - - - name: Open mas tap PR + - name: ⤴️ Open mas tap PR env: GH_TOKEN: ${{ github.token }} DRY_RUN: ${{ needs.start.outputs.dry_run }} RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | + brew tap mas-cli/tap cd "$(brew --repository mas-cli/tap)" + git branch "${RELEASE_BRANCH}" + git switch "${RELEASE_BRANCH}" + + cp -v \ + ${GITHUB_WORKSPACE}/Homebrew/mas-tap.rb \ + Formula/mas.rb + + git add Formula/mas.rb + git commit --message="🔖 Version ${MAS_VERSION}" + git push --set-upstream origin "${RELEASE_BRANCH}" gh pr create \ --assignee phatblat \ @@ -171,6 +173,15 @@ jobs: --title "🔖 Version ${MAS_VERSION}" \ --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." + - name: 🚰 Update mas tap formula + env: + GH_TOKEN: ${{ github.token }} + DRY_RUN: ${{ needs.start.outputs.dry_run }} + MAS_VERSION: ${{ needs.start.outputs.mas_version }} + run: | + DRY_RUN=${DRY_RUN} \ + script/brew_tap_update ${MAS_VERSION} + - name: 🚀 Upload Bottles env: GH_TOKEN: ${{ github.token }} diff --git a/script/bottle b/script/bottle index 8d65637..776cf20 100755 --- a/script/bottle +++ b/script/bottle @@ -82,18 +82,18 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # Preflight checks # -# Uninstall if necessary -brew remove mas 2>/dev/null || true -brew remove mas-cli/tap/mas 2>/dev/null || true +# # Uninstall if necessary +# brew remove mas 2>/dev/null || true +# brew remove mas-cli/tap/mas 2>/dev/null || true -# Uninstall if still found on path -if command -v mas >/dev/null; then - script/uninstall || true -fi +# # Uninstall if still found on path +# if command -v mas >/dev/null; then +# script/uninstall || true +# fi # Use formula from custom tap -brew tap mas-cli/tap -brew update +# brew tap mas-cli/tap +# brew update # Audit formula brew audit --strict mas-cli/tap/mas @@ -159,5 +159,3 @@ EOF rm "${OLD_FILENAME}" ls -l "${BOTTLE_DIR}" echo "${BOTTLE_BLOCK}" - -brew remove mas-cli/tap/mas diff --git a/script/brew_core_update b/script/brew_core_update index 468e225..c70c289 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -10,8 +10,7 @@ # CORE_TAP_PATH="$(brew --repository homebrew/core)" -CORE_FORMULA_PATH="${CORE_TAP_PATH}/Formula/" -CORE_MAS_FORMULA_PATH="${CORE_FORMULA_PATH}/m/mas.rb" +CORE_MAS_FORMULA_FILE="${CORE_TAP_PATH}/Formula/m/mas.rb" PROJECT_PATH="$(git rev-parse --show-toplevel)" LOCAL_MAS_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas.rb" @@ -99,7 +98,7 @@ brew update # # Update mas formula in core (temporary) -cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" +cp -v "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_FILE}" # Install mas from source # HOMEBREW_NO_INSTALL_FROM_API: @@ -127,7 +126,7 @@ popd # # echo "Checking to see if this update can be a simple bump." -# diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_PATH}" +# diff "${LOCAL_MAS_FORMULA_PATH}" "${CORE_MAS_FORMULA_FILE}" echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" @@ -154,7 +153,7 @@ if [[ $dry_run == '-d' ]]; then exit 0 fi -pushd "${CORE_FORMULA_PATH}" +pushd "${CORE_TAP_PATH}" echo "Updating homebrew/core formula with a PR" diff --git a/script/brew_tap_update b/script/brew_tap_update index 5f4da16..31b8c61 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -8,7 +8,7 @@ # MAS_TAP_PATH="$(brew --repository mas-cli/tap)" -MAS_TAP_PATH_FORMULA="${MAS_TAP_PATH}/Formula/mas.rb" +MAS_TAP_FORMULA_FILE="${MAS_TAP_PATH}/Formula/mas.rb" PROJECT_PATH="$(git rev-parse --show-toplevel)" LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" @@ -65,31 +65,5 @@ fi echo "REVISION: ${REVISION}" -################################################################################ -# -# Create branch on mas-cli/homebrew-tap -# - -# Ensure mas is tapped -if ! [[ -d "${MAS_TAP_PATH}" ]]; then - brew tap mas-cli/tap -fi - -pushd "${MAS_TAP_PATH}" - -branch_name="releases/release-${MAS_VERSION}" -$echo git branch "${branch_name}" -$echo git switch "${branch_name}" - -# Update tap formula version -cp -v "${LOCAL_TAP_FORMULA_PATH}" "${MAS_TAP_PATH_FORMULA}" - -$echo git add \ - "${MAS_TAP_PATH_FORMULA}" - -$echo git commit --message="🔖 Version ${MAS_VERSION}" - -popd - # Build in mas project script/bottle From 30aa073f2576205007885bbb8743767601a75d34 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 12:20:40 -0600 Subject: [PATCH 125/162] =?UTF-8?q?=F0=9F=94=90=20Add=20DEPLOY=5FTOKEN=20f?= =?UTF-8?q?or=20mas=20tap=20PR=20creation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db8d426..35572c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,7 +135,8 @@ jobs: runs-on: macos-14 needs: [start, prepare-release] steps: - - uses: actions/checkout@v4 + - name: 📺 Checkout mas repo + uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 @@ -145,9 +146,19 @@ jobs: run: | script/bootstrap -f + - name: 🔧 Configure Git Credentials + run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + + - name: 🚰 Checkout mas tap + uses: actions/checkout@v4 + with: + ref: ${{ needs.start.outputs.release_branch }} + - name: ⤴️ Open mas tap PR env: - GH_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} DRY_RUN: ${{ needs.start.outputs.dry_run }} RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} @@ -164,7 +175,9 @@ jobs: git add Formula/mas.rb git commit --message="🔖 Version ${MAS_VERSION}" - git push --set-upstream origin "${RELEASE_BRANCH}" + git push \ + --set-upstream origin "${RELEASE_BRANCH}" + gh pr create \ --assignee phatblat \ --base main \ From 20faba39a9f3bab57e1029e2336c866409d47778 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 12:36:15 -0600 Subject: [PATCH 126/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=E2=80=8D?= =?UTF-8?q?=E2=99=80=EF=B8=8F=20Checkout=20mas-cli/homebrew-tap=20in=20sub?= =?UTF-8?q?dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35572c9..ae6ea4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,7 +154,10 @@ jobs: - name: 🚰 Checkout mas tap uses: actions/checkout@v4 with: - ref: ${{ needs.start.outputs.release_branch }} + repository: mas-cli/homebrew-tap + token: ${{ secrets.DEPLOY_TOKEN }} + # Relative path under $GITHUB_WORKSPACE to place the repository + path: mas-tap - name: ⤴️ Open mas tap PR env: From 84e13f9380d338aef88f5632686fcf4ecaf2ef2c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 12:36:41 -0600 Subject: [PATCH 127/162] =?UTF-8?q?=F0=9F=94=97=20Symlink=20tap=20to=20tap?= =?UTF-8?q?s=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae6ea4a..9efdc46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -165,9 +165,11 @@ jobs: DRY_RUN: ${{ needs.start.outputs.dry_run }} RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} + working-directory: mas-tap run: | - brew tap mas-cli/tap - cd "$(brew --repository mas-cli/tap)" + ln -s . "$(brew --repository mas-cli/tap)" + brew tap + git branch "${RELEASE_BRANCH}" git switch "${RELEASE_BRANCH}" From c073f0a140d2af3a6945e984cfa2c740cd44f27e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 12:49:09 -0600 Subject: [PATCH 128/162] =?UTF-8?q?=F0=9F=93=82=20mkdirs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9efdc46..de48c8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -167,7 +167,8 @@ jobs: MAS_VERSION: ${{ needs.start.outputs.mas_version }} working-directory: mas-tap run: | - ln -s . "$(brew --repository mas-cli/tap)" + mkdir -p "$(brew --repository)/Library/Taps/mas-cli" + ln -s . "$(brew --repository)/Library/Taps/mas-cli/homebrew-tap" brew tap git branch "${RELEASE_BRANCH}" From d202441a633ab424d433fcaef6512197b8c59cea Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 14:47:08 -0600 Subject: [PATCH 129/162] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Add=20tap=20and=20?= =?UTF-8?q?re-clone=20with=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 22 +++++++++++++--------- script/bottle | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de48c8f..a619a02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,16 +148,24 @@ jobs: - name: 🔧 Configure Git Credentials run: | - git config user.name 'github-actions[bot]' - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + # This is necessary to avoid the following error: + # Error: No available formula or cask with the name "mas-cli/tap/mas". - name: 🚰 Checkout mas tap + run: | + brew tap mas-cli/tap + rm -rf /opt/homebrew/Library/Taps/mas-cli/homebrew-tap + + # Checkout with a token for write access + - name: 🚰 Re-clone mas tap uses: actions/checkout@v4 with: repository: mas-cli/homebrew-tap token: ${{ secrets.DEPLOY_TOKEN }} - # Relative path under $GITHUB_WORKSPACE to place the repository - path: mas-tap + # brew --repository mas-cli/tap + path: /opt/homebrew/Library/Taps/mas-cli/homebrew-tap - name: ⤴️ Open mas tap PR env: @@ -165,12 +173,8 @@ jobs: DRY_RUN: ${{ needs.start.outputs.dry_run }} RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} - working-directory: mas-tap + working-directory: /opt/homebrew/Library/Taps/mas-cli/homebrew-tap run: | - mkdir -p "$(brew --repository)/Library/Taps/mas-cli" - ln -s . "$(brew --repository)/Library/Taps/mas-cli/homebrew-tap" - brew tap - git branch "${RELEASE_BRANCH}" git switch "${RELEASE_BRANCH}" diff --git a/script/bottle b/script/bottle index 776cf20..8383731 100755 --- a/script/bottle +++ b/script/bottle @@ -96,6 +96,7 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # brew update # Audit formula +brew list mas-cli/tap/mas brew audit --strict mas-cli/tap/mas brew style mas-cli/tap/mas From 7603c30da0ef7f26a2bf3a5b568717f89bd3f79c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 3 Aug 2024 14:58:54 -0600 Subject: [PATCH 130/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=E2=80=8D?= =?UTF-8?q?=E2=99=82=EF=B8=8F=20Checkout=20using=20symlink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error: Repository path '/opt/homebrew/Library/Taps/mas-cli/homebrew-tap' is not under '/Users/runner/work/mas/mas' --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a619a02..33ade36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -157,6 +157,7 @@ jobs: run: | brew tap mas-cli/tap rm -rf /opt/homebrew/Library/Taps/mas-cli/homebrew-tap + ln -s /opt/homebrew/Library/Taps Taps # Checkout with a token for write access - name: 🚰 Re-clone mas tap @@ -165,7 +166,7 @@ jobs: repository: mas-cli/homebrew-tap token: ${{ secrets.DEPLOY_TOKEN }} # brew --repository mas-cli/tap - path: /opt/homebrew/Library/Taps/mas-cli/homebrew-tap + path: Taps/mas-cli/homebrew-tap - name: ⤴️ Open mas tap PR env: From cb6f17dbd95daf89f7f36ec310fa5c4b7b837235 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 13 Oct 2024 10:29:37 -0600 Subject: [PATCH 131/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20subdirs=20to=20?= =?UTF-8?q?get=20ready=20for=20symlink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33ade36..e6702c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,12 +151,15 @@ jobs: git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + # The mas-cli/homebrew-tap repo needs to be checked out using the current + # GitHub credentials in order to open a PR. However, the `brew tap` command + # must be run for Homebrew to see the dir as a tap. # This is necessary to avoid the following error: # Error: No available formula or cask with the name "mas-cli/tap/mas". - name: 🚰 Checkout mas tap run: | brew tap mas-cli/tap - rm -rf /opt/homebrew/Library/Taps/mas-cli/homebrew-tap + rm -rf /opt/homebrew/Library/Taps ln -s /opt/homebrew/Library/Taps Taps # Checkout with a token for write access From 5ea1967fa4d3ecb7624593dc70ffba4f5dd16aea Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 13 Oct 2024 10:35:00 -0600 Subject: [PATCH 132/162] =?UTF-8?q?=F0=9F=94=8A=20Log=20brew=20taps=20befo?= =?UTF-8?q?re/after=20symlink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6702c6..20a174f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -159,8 +159,10 @@ jobs: - name: 🚰 Checkout mas tap run: | brew tap mas-cli/tap + brew tap rm -rf /opt/homebrew/Library/Taps ln -s /opt/homebrew/Library/Taps Taps + brew tap # Checkout with a token for write access - name: 🚰 Re-clone mas tap From 56a7d952c7c34b21b50a916a47c025e8b3375371 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 13 Oct 2024 10:38:46 -0600 Subject: [PATCH 133/162] =?UTF-8?q?=F0=9F=93=8E=20Symlink=20before=20tappi?= =?UTF-8?q?ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20a174f..07f833c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -158,10 +158,11 @@ jobs: # Error: No available formula or cask with the name "mas-cli/tap/mas". - name: 🚰 Checkout mas tap run: | - brew tap mas-cli/tap - brew tap rm -rf /opt/homebrew/Library/Taps - ln -s /opt/homebrew/Library/Taps Taps + mkdir Taps + ln -s Taps /opt/homebrew/Library/Taps + ls -l /opt/homebrew/Library/Taps + brew tap mas-cli/tap brew tap # Checkout with a token for write access From 2bcbc2770c22ef767eca1a60023712b4a2d02579 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 20 Oct 2024 11:53:37 -0600 Subject: [PATCH 134/162] =?UTF-8?q?=F0=9F=93=8E=20Fix=20symlink=20to=20loc?= =?UTF-8?q?al=20Taps=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07f833c..0c1b803 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,7 +160,7 @@ jobs: run: | rm -rf /opt/homebrew/Library/Taps mkdir Taps - ln -s Taps /opt/homebrew/Library/Taps + ln -s $(realpath Taps) /opt/homebrew/Library/Taps ls -l /opt/homebrew/Library/Taps brew tap mas-cli/tap brew tap From aa394e489eb4822b1b84161a163fd98c8719c3db Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 20 Oct 2024 12:06:20 -0600 Subject: [PATCH 135/162] =?UTF-8?q?=F0=9F=A9=B9=20Install=20formula=20so?= =?UTF-8?q?=20we=20can=20audit=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 1 + 1 file changed, 1 insertion(+) diff --git a/script/bottle b/script/bottle index 8383731..1a092a0 100755 --- a/script/bottle +++ b/script/bottle @@ -96,6 +96,7 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # brew update # Audit formula +brew install mas-cli/tap/mas brew list mas-cli/tap/mas brew audit --strict mas-cli/tap/mas brew style mas-cli/tap/mas From 5b8fed8bee946223b45c09770620e52c41287323 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 14:07:04 -0600 Subject: [PATCH 136/162] =?UTF-8?q?=F0=9F=94=A8=20Remove=20install=20and?= =?UTF-8?q?=20enhance=20audit=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/bottle b/script/bottle index 1a092a0..78fb28c 100755 --- a/script/bottle +++ b/script/bottle @@ -96,9 +96,8 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # brew update # Audit formula -brew install mas-cli/tap/mas brew list mas-cli/tap/mas -brew audit --strict mas-cli/tap/mas +brew audit --strict --verbose --formula --tap mas-cli/tap mas brew style mas-cli/tap/mas ################################################################################ From a1a9a9d441cc81502ffeb7d16a2ab1c6944a1917 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 14:21:28 -0600 Subject: [PATCH 137/162] =?UTF-8?q?=F0=9F=9A=A8=20Resolve=20brew=20style?= =?UTF-8?q?=20lint=20offenses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Homebrew/mas-tap.rb | 4 ++++ Homebrew/mas.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Homebrew/mas-tap.rb b/Homebrew/mas-tap.rb index 59ad0bf..4195b6d 100644 --- a/Homebrew/mas-tap.rb +++ b/Homebrew/mas-tap.rb @@ -1,3 +1,7 @@ +# typed: strict +# frozen_string_literal: true + +# mas command formula for custom tap (mas-cli/homebrew-tap). class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" diff --git a/Homebrew/mas.rb b/Homebrew/mas.rb index 1bda0d5..050648f 100644 --- a/Homebrew/mas.rb +++ b/Homebrew/mas.rb @@ -1,3 +1,7 @@ +# typed: strict +# frozen_string_literal: true + +# mas command formula for homebrew-core tap. class Mas < Formula desc "Mac App Store command-line interface" homepage "https://github.com/mas-cli/mas" From 635898dd1887312da437e11e0817cece9984a885 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 14:23:10 -0600 Subject: [PATCH 138/162] =?UTF-8?q?=F0=9F=94=A8=20Change=20style=20to=20us?= =?UTF-8?q?e=20file=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed brew list command as that only works with installed formulae --- script/bottle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/bottle b/script/bottle index 78fb28c..7ea57fa 100755 --- a/script/bottle +++ b/script/bottle @@ -96,9 +96,8 @@ OLD_FILENAME="mas--${MAS_VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz" # brew update # Audit formula -brew list mas-cli/tap/mas brew audit --strict --verbose --formula --tap mas-cli/tap mas -brew style mas-cli/tap/mas +brew style Homebrew/mas-tap.rb ################################################################################ # From 3332773c1b5b7936b3436a3241132154a2bf92bd Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 14:23:59 -0600 Subject: [PATCH 139/162] =?UTF-8?q?=F0=9F=94=8A=20Echo=20commands=20in=20b?= =?UTF-8?q?ottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/bottle b/script/bottle index 7ea57fa..4ab0c3a 100755 --- a/script/bottle +++ b/script/bottle @@ -1,4 +1,4 @@ -#!/bin/bash -e +#!/bin/bash -ex # # script/bottle # mas From 7ecbf60fb8f369dc785114c72b9bdc571c64eb2b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 14:57:33 -0600 Subject: [PATCH 140/162] =?UTF-8?q?=F0=9F=94=A8=20Update=20version=20in=20?= =?UTF-8?q?root=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version_bump | 1 + 1 file changed, 1 insertion(+) diff --git a/script/version_bump b/script/version_bump index 3a34433..76da9ef 100755 --- a/script/version_bump +++ b/script/version_bump @@ -53,4 +53,5 @@ for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do echo "${file}" sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" + sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v' "\$1${REVISION}\"" "${file}" done From 64961e7c8111d614fcc7b4739f72d10dc8700716 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 15:03:46 -0600 Subject: [PATCH 141/162] =?UTF-8?q?=F0=9F=94=A8=20Fix=20root=5Furl=20repla?= =?UTF-8?q?cement=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version_bump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version_bump b/script/version_bump index 76da9ef..2d1dcad 100755 --- a/script/version_bump +++ b/script/version_bump @@ -53,5 +53,5 @@ for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do echo "${file}" sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" - sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v' "\$1${REVISION}\"" "${file}" + sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v).+' "\${1}${REVISION}\"" "${file}" done From 8bbf5525b4791fd528fb10affd917d070bc9b1b0 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sat, 26 Oct 2024 15:08:06 -0600 Subject: [PATCH 142/162] =?UTF-8?q?=F0=9F=94=A8=20Use=20MAS=5FVERSION=20in?= =?UTF-8?q?=20root=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version_bump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version_bump b/script/version_bump index 2d1dcad..d3a52b7 100755 --- a/script/version_bump +++ b/script/version_bump @@ -53,5 +53,5 @@ for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do echo "${file}" sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" - sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v).+' "\${1}${REVISION}\"" "${file}" + sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v).+' "\${1}${MAS_VERSION}\"" "${file}" done From f9ce4136e44a42c97b583eec201c511a9c386be3 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Sun, 27 Oct 2024 07:26:46 -0400 Subject: [PATCH 143/162] Restore `git describe` check in `version`. Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- script/version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version b/script/version index a11a32d..73b1464 100755 --- a/script/version +++ b/script/version @@ -13,7 +13,7 @@ if ! cd -- "${mas_dir}"; then exit 1 fi -if [[ -z "${MAS_VERSION:-}" ]]; then +if [[ -z "${MAS_VERSION:-}" ]] && git describe >/dev/null 2>&1; then # Use last tag if MAS_VERSION environment variable is unset or empty MAS_VERSION=$(git describe --abbrev=0 --tags 2>/dev/null || true) fi From 4a784666486760321e6daef7ad12948e975a9252 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 10:18:35 -0700 Subject: [PATCH 144/162] =?UTF-8?q?=F0=9F=9A=9A=20Update=20path=20to=20Pac?= =?UTF-8?q?kage.swift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a205e50..f41dff8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: git add \ "Homebrew/mas.rb" \ "Homebrew/mas-tap.rb" \ - "Sources/MasKit/Package.swift" + "Package.swift" git commit \ --message="🔖 Version ${MAS_VERSION}" git push \ From 51d3cdfd2d3b152f4342cb34b2fa326ae0eaab5a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 10:19:07 -0700 Subject: [PATCH 145/162] =?UTF-8?q?=F0=9F=94=A5=20Remove=20Open=20release?= =?UTF-8?q?=20PR=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f41dff8..caadcf5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,20 +83,6 @@ jobs: git push \ --set-upstream origin "${RELEASE_BRANCH}" - - name: ⤴️ Open release PR - env: - GH_TOKEN: ${{ github.token }} - MAS_VERSION: ${{ needs.start.outputs.mas_version }} - RELEASE_BRANCH: ${{ needs.start.outputs.release_branch }} - run: | - gh pr create \ - --assignee phatblat \ - --base main \ - --draft \ - --head "${RELEASE_BRANCH}" \ - --title "🔖 Version ${MAS_VERSION}" \ - --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." - pkg-installer: runs-on: macos-15 needs: [start, prepare-release] From 414313986c8a4b2ffa830ed94ad8ce7398c1bd56 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 10:28:10 -0700 Subject: [PATCH 146/162] =?UTF-8?q?=F0=9F=97=84=EF=B8=8F=20Change=20git=20?= =?UTF-8?q?author=20to=20masclibot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index caadcf5..4e860e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,6 +69,11 @@ jobs: run: | script/version_bump "${MAS_VERSION}" + - name: 🔧 Configure Git Author + run: | + git config --global user.name 'masclibot' + git config --global user.email 'masclibot@users.noreply.github.com' + - name: 💾 Commit changes env: MAS_VERSION: ${{ needs.start.outputs.mas_version }} @@ -132,11 +137,6 @@ jobs: run: | script/bootstrap -f - - name: 🔧 Configure Git Credentials - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - # The mas-cli/homebrew-tap repo needs to be checked out using the current # GitHub credentials in order to open a PR. However, the `brew tap` command # must be run for Homebrew to see the dir as a tap. @@ -160,6 +160,11 @@ jobs: # brew --repository mas-cli/tap path: Taps/mas-cli/homebrew-tap + - name: 🔧 Configure Git Author + run: | + git config --global user.name 'masclibot' + git config --global user.email 'masclibot@users.noreply.github.com' + - name: ⤴️ Open mas tap PR env: GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }} @@ -222,6 +227,11 @@ jobs: run: | script/bootstrap -f + - name: 🔧 Configure Git Author + run: | + git config --global user.name 'masclibot' + git config --global user.email 'masclibot@users.noreply.github.com' + - name: 🍺 Update Homebrew mas formula env: GH_TOKEN: ${{ github.token }} From 35433359a9ba19c744b7349b26281a00dad973fc Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 10:45:46 -0700 Subject: [PATCH 147/162] =?UTF-8?q?=F0=9F=9A=9A=20Update=20path=20to=20swi?= =?UTF-8?q?ft=20release=20build=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/install b/script/install index b3faa71..c771518 100755 --- a/script/install +++ b/script/install @@ -18,7 +18,7 @@ PREFIX=/usr/local while test -n "$1"; do if [[ "$1" == '--universal' ]]; then ARCH=universal - RELEASE=.build/apple/Products/Release + RELEASE=.build/release else # Override default prefix path with optional arg PREFIX="$1" From 7d0f0a8fbdb02ee15c8837e9db5250042b0b4792 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 10:59:31 -0700 Subject: [PATCH 148/162] =?UTF-8?q?=F0=9F=8D=8E=20Add=20macOS=20sequoia=20?= =?UTF-8?q?to=20bottle=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/bottle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/bottle b/script/bottle index c613dcf..e4c7bb0 100755 --- a/script/bottle +++ b/script/bottle @@ -22,6 +22,8 @@ ROOT_URL="https://github.com/mas-cli/mas/releases/download/v${MAS_VERSION}" # Supports macOS 10.13 and later OS_NAMES=( + sequoia + arm64_sequoia sonoma arm64_sonoma ventura @@ -46,6 +48,9 @@ echo "CURRENT_OS_VERSION_MAJOR: ${CURRENT_OS_VERSION_MAJOR}" echo "CURRENT_OS_VERSION_MINOR: ${CURRENT_OS_VERSION_MINOR}" case "${CURRENT_OS_VERSION_MAJOR}" in + 15) + CURRENT_PLATFORM=sequoia + ;; 14) CURRENT_PLATFORM=sonoma ;; From 73d63a29817ea2e9cc16160442e298b7f2831fb2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:08:53 -0700 Subject: [PATCH 149/162] =?UTF-8?q?=F0=9F=94=90=20Add=20HOMEBREW=5FGITHUB?= =?UTF-8?q?=5FAPI=5FTOKEN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e860e3..8a9cd9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -227,6 +227,12 @@ jobs: run: | script/bootstrap -f + - name: 🔐 Configure HOMEBREW_GITHUB_API_TOKEN + env: + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + run: | + export HOMEBREW_GITHUB_API_TOKEN=your_token_here >>/Users/runner/.bash_profile + - name: 🔧 Configure Git Author run: | git config --global user.name 'masclibot' From 513b99d26fc40e094ebf1106f1abf55ac8dee9ce Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:18:17 -0700 Subject: [PATCH 150/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=20Restore=20Bu?= =?UTF-8?q?ild,=20Test,=20and=20Lint=20name=20of=20pr-checks=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index f3b73d5..fd9713c 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -3,7 +3,7 @@ # # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables --- -name: pr-checks +name: Build, Test, and Lint on: pull_request: branches: [main] From b735bcbb6f23def6b24b07336ff42836e9f8932a Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:20:32 -0700 Subject: [PATCH 151/162] =?UTF-8?q?=F0=9F=9A=9A=20Restore=20build-test.yml?= =?UTF-8?q?=20workflow=20filename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{pr-checks.yml => build-test.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{pr-checks.yml => build-test.yml} (96%) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/build-test.yml similarity index 96% rename from .github/workflows/pr-checks.yml rename to .github/workflows/build-test.yml index fd9713c..3913a9f 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/build-test.yml @@ -1,5 +1,5 @@ # -# .github/workflows/pr-checks.yml +# .github/workflows/build-test.yml # # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables --- From 8dd72139a17d1a9b51f5d4a9cebe53e042b2ffcb Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:32:16 -0700 Subject: [PATCH 152/162] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=20Set=20name?= =?UTF-8?q?=20of=20build-test=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-test.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 3913a9f..451d38a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -4,17 +4,24 @@ # https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables --- name: Build, Test, and Lint + on: pull_request: branches: [main] push: branches: [main] + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: build-test: + name: Build, Test, and Lint + + # https://github.com/actions/runner-images#available-images runs-on: macos-15 + defaults: run: # Prefixes all `run` commands with the following command to force them to run outside Rosetta. @@ -22,14 +29,21 @@ jobs: # https://github.com/rolpdog/cffi-mirror/blob/release-1.15/.github/workflows/ci.yaml#L81-L141 # https://github.com/actions/virtual-environments/issues/2187#issuecomment-790507204 shell: arch -arm64 bash --noprofile --norc -eo pipefail {0} + steps: - uses: actions/checkout@v4 with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 + - name: Bootstrap run: script/bootstrap -f + - name: Build run: script/build + - name: Test run: script/test + + - name: Lint + run: script/lint From b325020c5ccd5e81442e7a417069c5c78ef9f78d Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:38:06 -0700 Subject: [PATCH 153/162] =?UTF-8?q?=F0=9F=9A=A8=20Wrap=20long=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a9cd9c..77184c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -192,7 +192,8 @@ jobs: --draft \ --head "${RELEASE_BRANCH}" \ --title "🔖 Version ${MAS_VERSION}" \ - --body "This PR contains the changes from releasing version [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." + --body "This PR contains the changes from releasing version \ + [${MAS_VERSION}](https://github.com/mas-cli/mas/releases/tag/${MAS_VERSION})." - name: 🚰 Update mas tap formula env: From 8eeb204ad7b4577b877032a69e4e9f96d2ce74ef Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:40:46 -0700 Subject: [PATCH 154/162] =?UTF-8?q?=F0=9F=9A=A8=20Fix=20YAML=20list=20inde?= =?UTF-8?q?ntation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 1462b47..10d3144 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -22,7 +22,7 @@ disabled_rules: - function_body_length - inert_defer - legacy_objc_type -- no_extension_access_modifier + - no_extension_access_modifier - no_grouping_extension - number_separator - one_declaration_per_file From 7bde8fa7e6d5ad39bf78374463d43124dde01771 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 11:51:53 -0700 Subject: [PATCH 155/162] =?UTF-8?q?=F0=9F=94=90=20Move=20HOMEBREW=5FGITHUB?= =?UTF-8?q?=5FAPI=5FTOKEN=20to=20mas=20formula=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77184c5..c92cb1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -228,12 +228,6 @@ jobs: run: | script/bootstrap -f - - name: 🔐 Configure HOMEBREW_GITHUB_API_TOKEN - env: - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} - run: | - export HOMEBREW_GITHUB_API_TOKEN=your_token_here >>/Users/runner/.bash_profile - - name: 🔧 Configure Git Author run: | git config --global user.name 'masclibot' @@ -242,6 +236,7 @@ jobs: - name: 🍺 Update Homebrew mas formula env: GH_TOKEN: ${{ github.token }} + HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} run: | From 58f9fbcc8cb3d4bdee0f396342c4c82fbf5a0b3e Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 12:11:41 -0700 Subject: [PATCH 156/162] =?UTF-8?q?=F0=9F=9A=A8=20Remove=20unused=20vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/brew_core_update | 1 - script/brew_tap_update | 26 -------------------------- 2 files changed, 27 deletions(-) diff --git a/script/brew_core_update b/script/brew_core_update index c70c289..af8f46e 100755 --- a/script/brew_core_update +++ b/script/brew_core_update @@ -130,7 +130,6 @@ popd echo "==> 🧪 Updating homebrew-core formula mas (${MAS_VERSION}, ${REVISION})" - echo "Validating formula" brew bump-formula-pr \ --tag="${MAS_VERSION}" \ diff --git a/script/brew_tap_update b/script/brew_tap_update index 31b8c61..6dd7a88 100755 --- a/script/brew_tap_update +++ b/script/brew_tap_update @@ -7,12 +7,6 @@ # https://github.com/mas-cli/homebrew-tap/blob/main/Formula/mas.rb # -MAS_TAP_PATH="$(brew --repository mas-cli/tap)" -MAS_TAP_FORMULA_FILE="${MAS_TAP_PATH}/Formula/mas.rb" - -PROJECT_PATH="$(git rev-parse --show-toplevel)" -LOCAL_TAP_FORMULA_PATH="${PROJECT_PATH}/Homebrew/mas-tap.rb" - function usage { echo "Usage: brew_tap_update [-d] v0.0 [sha1_hash]" echo " -d option enables dry run mode" @@ -26,26 +20,6 @@ if [[ $# -gt 3 ]]; then usage 1>&2 fi -echo='' - -# Detect presence of `-d` dry run option -while getopts "d" o; do - case "${o}" in - d) - echo='echo (DRY-RUN):' - ;; - *) - usage 1>&2 - ;; - esac -done - -# DRY_RUN environment variable -# shellcheck disable=SC2153 -if [[ $DRY_RUN == 'true' ]]; then - echo='echo (DRY-RUN):' -fi - # arg 1 - version tag if [[ -n "${1}" ]]; then MAS_VERSION="${1}" From 2ccdb03486f7dc31f439127143f2a81ec2c1394b Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 12:17:31 -0700 Subject: [PATCH 157/162] =?UTF-8?q?=F0=9F=94=A7=20Add=20PRE=5FRELEASE=20va?= =?UTF-8?q?r=20to=20release=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c92cb1b..ffe734c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,10 @@ jobs: run: | echo "MAS_VERSION=${{ github.event.release.tag_name }}" >>"$GITHUB_OUTPUT" + - id: pre_release + run: | + echo "PRE_RELEASE=$(grep -q '-' <<<"$MAS_VERSION" && echo 'true' || echo 'false')" >>"$GITHUB_OUTPUT" + - id: release_branch run: | echo "RELEASE_BRANCH=releases/release-${{ github.event.release.tag_name }}" >>"$GITHUB_OUTPUT" From d1be1d9d124678c1fea4ec4b875c83f4c1ea6bcb Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 12:25:25 -0700 Subject: [PATCH 158/162] =?UTF-8?q?=F0=9F=91=94=20Only=20run=20homebrew-co?= =?UTF-8?q?re=20job=20for=20real=20releases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffe734c..0b598af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -221,18 +221,23 @@ jobs: homebrew-core: runs-on: macos-15 needs: [start, prepare-release, homebrew-tap] + env: + PRE_RELEASE: ${{ needs.start.outputs.pre_release }} steps: - uses: actions/checkout@v4 + if: env.PRE_RELEASE == 'false' with: # A fetch-depth of 0 includes all history and tags for script/version fetch-depth: 0 ref: ${{ needs.start.outputs.release_branch }} - name: 👢 Bootstrap + if: env.PRE_RELEASE == 'false' run: | script/bootstrap -f - name: 🔧 Configure Git Author + if: env.PRE_RELEASE == 'false' run: | git config --global user.name 'masclibot' git config --global user.email 'masclibot@users.noreply.github.com' @@ -243,6 +248,7 @@ jobs: HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} DRY_RUN: ${{ needs.start.outputs.dry_run }} MAS_VERSION: ${{ needs.start.outputs.mas_version }} + if: env.PRE_RELEASE == 'false' run: | DRY_RUN=${DRY_RUN} \ script/brew_core_update ${MAS_VERSION} From a976581515a146de33acf9ab9f2ea00436592ea8 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 13:04:02 -0700 Subject: [PATCH 159/162] =?UTF-8?q?=F0=9F=91=94=20Open=20tap=20PR=20as=20r?= =?UTF-8?q?eady=20to=20review=20instead=20of=20draft?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b598af..441cb66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -193,7 +193,6 @@ jobs: gh pr create \ --assignee phatblat \ --base main \ - --draft \ --head "${RELEASE_BRANCH}" \ --title "🔖 Version ${MAS_VERSION}" \ --body "This PR contains the changes from releasing version \ From 4405807010987802c0967bbf349c08808062b824 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 13:10:41 -0700 Subject: [PATCH 160/162] =?UTF-8?q?=F0=9F=A9=B9=20Add=20pre=5Frelease=20ou?= =?UTF-8?q?tput=20to=20start=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 441cb66..428fee5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,7 @@ jobs: outputs: dry_run: ${{ steps.dry_run.outputs.dry_run }} mas_version: ${{ steps.mas_version.outputs.mas_version }} + pre_release: ${{ steps.pre_release.outputs.pre_release }} release_branch: ${{ steps.release_branch.outputs.release_branch }} steps: # Logs event details and sets `DRY_RUN` env var @@ -41,7 +42,7 @@ jobs: - id: pre_release run: | - echo "PRE_RELEASE=$(grep -q '-' <<<"$MAS_VERSION" && echo 'true' || echo 'false')" >>"$GITHUB_OUTPUT" + echo "PRE_RELEASE=$(grep -q '-' <<<$MAS_VERSION && echo 'true' || echo 'false')" >>"$GITHUB_OUTPUT" - id: release_branch run: | From c314af5167fcf9eefbe2d074a77bc79bc288eb4c Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 3 Nov 2024 13:43:21 -0700 Subject: [PATCH 161/162] =?UTF-8?q?=F0=9F=A9=B9=20Remove=20duplicate=20v?= =?UTF-8?q?=20in=20tap's=20root=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/version_bump | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/version_bump b/script/version_bump index 4f4f5b2..10b22aa 100755 --- a/script/version_bump +++ b/script/version_bump @@ -57,5 +57,5 @@ for file in ${LOCAL_MAS_FORMULA_PATH} ${LOCAL_TAP_FORMULA_PATH}; do echo "${file}" sd '( +tag: +)"[^"]+"' "\$1\"${MAS_VERSION}\"" "${file}" sd '( +revision: +)"[^"]+"' "\$1\"${REVISION}\"" "${file}" - sd '( +root_url "https://github.com/mas-cli/mas/releases/download/v).+' "\${1}${MAS_VERSION}\"" "${file}" + sd '( +root_url "https://github.com/mas-cli/mas/releases/download/).+' "\${1}${MAS_VERSION}\"" "${file}" done From 8617c75ace9e1d83fccfceadab048caae6324016 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:30:55 -0500 Subject: [PATCH 162/162] Fix typo in argument check in `script/build`. Partial #506 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- script/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build b/script/build index baacc02..fd84a9a 100755 --- a/script/build +++ b/script/build @@ -15,7 +15,7 @@ fi # Build for the host architecture by default. ARCH=() -if [[ "${#}" -gt 1 && "${1}" == '--universal' ]]; then +if [[ "${#}" -ge 1 && "${1}" == '--universal' ]]; then ARCH=( --arch arm64 --arch x86_64