diff --git a/.editorconfig b/.editorconfig index e9582eeda..f46c76213 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,5 +12,5 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false -[{script/*,*.rb,*.yml}] +[{script/*,*.{rb,yml}}] indent_size = 2 diff --git a/Homebrew/mas-tap.rb b/Homebrew/mas-tap.rb index 98a3ff6fb..642a2e333 100644 --- a/Homebrew/mas-tap.rb +++ b/Homebrew/mas-tap.rb @@ -2,31 +2,35 @@ 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.7.0", - :revision => "35575ff962687cfd9a12f859668cf61d5ea819c2" + tag: "v1.7.1", + revision: "b8dcb4ce4b1d78ada7556565dd5c73e9913758d8" + license "MIT" head "https://github.com/mas-cli/mas.git" bottle do root_url "https://dl.bintray.com/phatblat/mas-bottles" cellar :any - sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :catalina - sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :mojave - sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :high_sierra - sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :sierra - sha256 "adc9a2206f9fb5e7665cab7accea8ef682c382f35a8dabd8dd0cbd7bfbc82729" => :el_capitan + sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :catalina + sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :mojave + sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :high_sierra + sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :sierra + sha256 "de5acfedda59b73fbd36e4a966120aa1aa7e5eea4c07c19e75c0b21819b0900d" => :el_capitan end depends_on "carthage" => :build - depends_on :xcode => ["10.2", :build] + depends_on xcode: ["10.2", :build] def install # Working around build issues in dependencies # - Prevent warnings from causing build failures # - Prevent linker errors by telling all lib builds to use max size install names + # - Ensure dependencies build for the current CPU; otherwise Commandant will + # build for x86_64 when running arm64 xcconfig = buildpath/"Overrides.xcconfig" xcconfig.write <<~EOS GCC_TREAT_WARNINGS_AS_ERRORS = NO OTHER_LDFLAGS = -headerpad_max_install_names + VALID_ARCHS = #{Hardware::CPU.arch} EOS ENV["XCODE_XCCONFIG_FILE"] = xcconfig diff --git a/Homebrew/mas.rb b/Homebrew/mas.rb index 6a0909a35..758f95cc2 100644 --- a/Homebrew/mas.rb +++ b/Homebrew/mas.rb @@ -2,31 +2,35 @@ 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.7.0", - :revision => "35575ff962687cfd9a12f859668cf61d5ea819c2 + tag: "v1.7.1", + revision: "b8dcb4ce4b1d78ada7556565dd5c73e9913758d8" + license "MIT" head "https://github.com/mas-cli/mas.git" bottle do cellar :any - sha256 "b985d100947063ee94961f7f1290f232786634b869d20d56bd553197cf91188b" => :catalina - sha256 "c7005c34a3cf38d23f98e9cc238a0deae61f50ea5dfbcf51a34cc689a9db315e" => :mojave + sha256 "e6de2f98ebd21885a9827664fe1b7eea5516a7fd75d5b7383e3a9b088591a27f" => :catalina + sha256 "8b6dc4e261ebdc8e2f93afe87da3db4d482eb3d8a0358ab19a0485d434550e77" => :mojave end depends_on "carthage" => :build - depends_on :xcode => ["10.2", :build] + depends_on xcode: ["10.2", :build] def install # Working around build issues in dependencies # - Prevent warnings from causing build failures # - Prevent linker errors by telling all lib builds to use max size install names + # - Ensure dependencies build for the current CPU; otherwise Commandant will + # build for x86_64 when running arm64 xcconfig = buildpath/"Overrides.xcconfig" xcconfig.write <<~EOS GCC_TREAT_WARNINGS_AS_ERRORS = NO OTHER_LDFLAGS = -headerpad_max_install_names + VALID_ARCHS = #{Hardware::CPU.arch} EOS ENV["XCODE_XCCONFIG_FILE"] = xcconfig - # Only build necessary dependencies (Commandant, Result) + # Only build necessary dependencies system "carthage", "bootstrap", "--platform", "macOS", "Commandant" system "script/install", prefix diff --git a/script/bottle b/script/bottle index d60bbe70e..969fb825f 100755 --- a/script/bottle +++ b/script/bottle @@ -26,7 +26,7 @@ fi # Uninstall if still found on path if command -v mas > /dev/null; then - script/uninstall + script/uninstall || true # ignore failure fi # Purge the Carthage cache to avoid this error from Homebrew sandboxing: @@ -34,6 +34,11 @@ fi # fatal: Unable to create '/Users/ben/Library/Caches/org.carthage.CarthageKit/dependencies/Commandant/./index.lock': Operation not permitted rm -rf ~/Library/Caches/org.carthage.CarthageKit +# Uninstall carthage via Mint +if command -v mint > /dev/null; then + mint uninstall carthage +fi + # Build the formula brew install --build-bottle mas diff --git a/script/brew_formula_update b/script/brew_formula_update index b0479cb27..ebbd18e04 100755 --- a/script/brew_formula_update +++ b/script/brew_formula_update @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e # # script/brew_formula_update # mas @@ -29,7 +29,7 @@ fi if test -n "$2"; then REVISION="$2" else - REVISION=$(git rev-parse HEAD) + REVISION=$(git rev-parse "$VERSION") fi echo "Checking to see if this update can be a simple bump." diff --git a/script/brew_update b/script/brew_update new file mode 100755 index 000000000..02f2d46e9 --- /dev/null +++ b/script/brew_update @@ -0,0 +1,14 @@ +#!/bin/bash -e +# +# script/build_artifacts +# mas +# +# Runs all related scripts for generating all artifacts. +# + +VERSION=$(script/version) + +echo "Updating mas $VERSION Homebrew formula" + +script/brew_formula_update +script/bottle diff --git a/script/build_artifacts b/script/build_artifacts new file mode 100755 index 000000000..479ddae10 --- /dev/null +++ b/script/build_artifacts @@ -0,0 +1,17 @@ +#!/bin/bash -e +# +# script/build_artifacts +# mas +# +# Runs all related scripts for generating all artifacts. +# + +VERSION=$(script/version) + +echo "Building mas $VERSION artifacts" + +script/clean +script/build +script/archive +script/install +script/package