Skip to content

Commit

Permalink
Merge pull request #365 from mas-cli/release-1.8.2
Browse files Browse the repository at this point in the history
🍺 Update Brew formula for 1.8.2
  • Loading branch information
phatblat committed May 8, 2021
2 parents c88a988 + 7f0af9c commit 2f2a43b
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 93 deletions.
35 changes: 32 additions & 3 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
{
"entries": {
"brew": {
"markdownlint-cli": {
"version": "0.27.1",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_big_sur": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:ed9779fa2a2cc0141debd2c61501681dcd2c78741ee47ea90726e65f52515d81",
"sha256": "ed9779fa2a2cc0141debd2c61501681dcd2c78741ee47ea90726e65f52515d81"
},
"big_sur": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:d6454296ad369bb59d89724a04b36374946d5880eaaefc9690f617f5a74ff310",
"sha256": "d6454296ad369bb59d89724a04b36374946d5880eaaefc9690f617f5a74ff310"
},
"catalina": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:b005b2342165d9c7dbd528d57659fa4bbe6615c2fc6f7ea87fbec39cdb7857a5",
"sha256": "b005b2342165d9c7dbd528d57659fa4bbe6615c2fc6f7ea87fbec39cdb7857a5"
},
"mojave": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/markdownlint-cli/blobs/sha256:802003979b630f36bfce119b8cd8a05ce34a006e19d94bbceb2040944167233b",
"sha256": "802003979b630f36bfce119b8cd8a05ce34a006e19d94bbceb2040944167233b"
}
}
}
},
"shfmt": {
"version": "3.2.4",
"bottle": {
Expand Down Expand Up @@ -97,12 +126,12 @@
"system": {
"macos": {
"big_sur": {
"HOMEBREW_VERSION": "3.1.3-107-g1157a97",
"HOMEBREW_VERSION": "3.1.5",
"HOMEBREW_PREFIX": "/opt/homebrew",
"Homebrew/homebrew-core": "1da7ce26f5cfa33eec131571755152680a5321b7",
"Homebrew/homebrew-core": "e6c5a215e70e758472a62b1ff0a1ecdf94facc61",
"CLT": "12.5.0.0.1.1617976050",
"Xcode": "12.5",
"macOS": "11.3"
"macOS": "11.3.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ has_test_changes = !git.modified_files.grep(/Tests/).empty?

is_version_bump = git.modified_files.sort == [
"Package.swift",
"MasKit/SupportingFiles/Package.swift"
"MasKit/Package.swift"
].sort
message(":bookmark: Version bump!") if is_version_bump

Expand Down
9 changes: 5 additions & 4 deletions Homebrew/mas-tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.1",
revision: "23a36b4555f5625fe29915b31b8b101064452dca"
tag: "v1.8.2",
revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
license "MIT"
head "https://github.com/mas-cli/mas.git"

Expand All @@ -26,14 +26,15 @@ class Mas < Formula
end

def install
system "script/install", prefix
system "script/build", "--universal"
system "script/install", "--universal", prefix

bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
fish_completion.install "contrib/completion/mas.fish"
end

test do
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp
assert_include shell_output("#{bin}/mas info 497799835"), "Xcode"
assert_includes shell_output("#{bin}/mas info 497799835"), "Xcode"
end
end
13 changes: 7 additions & 6 deletions Homebrew/mas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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.1",
revision: "23a36b4555f5625fe29915b31b8b101064452dca"
tag: "v1.8.2",
revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
license "MIT"
head "https://github.com/mas-cli/mas.git"

bottle do
sha256 cellar: :any, arm64_big_sur: "ef2ed904d1283722af006811471484cb1c9c73b255a766b5c0c65ecd1654c8d8"
sha256 cellar: :any, big_sur: "dc98d69cfa94467e046b443c088a6097fe0ce0d2935e37046815fa3a984a0ca4"
sha256 cellar: :any, catalina: "2e7ffedf674543f98c2b95868b6a23db208cb2e6a3ec1ddbb3553ddab0cf9a68"
sha256 cellar: :any, arm64_big_sur: "f5ef4f44057f43ecc14f970687d832bd152bc6142c0ad848977f0a6527aa934f"
sha256 cellar: :any, big_sur: "d92cfc734e730fde87b29c6bf4a50ce63a78b9e505f464dc557eee128aa06d05"
sha256 cellar: :any, catalina: "163eb9cfdfed3d8fbda133b4079d104ad687f1ddb71d70d5661d02b22f562e76"
end

depends_on :macos
Expand All @@ -21,6 +21,7 @@ class Mas < Formula
end

def install
system "script/build"
system "script/install", prefix

bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
Expand All @@ -29,6 +30,6 @@ def install

test do
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp
assert_include shell_output("#{bin}/mas info 497799835"), "Xcode"
assert_includes shell_output("#{bin}/mas info 497799835"), "Xcode"
end
end
73 changes: 22 additions & 51 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@ SWIFT_VERSION = 5.3.2

# OS specific differences
UNAME = ${shell uname}
ARCH = ${shell uname -m}

ifeq ($(UNAME), Darwin)
SWIFTC_FLAGS =
LINKER_FLAGS = -Xlinker -L/usr/local/lib
PLATFORM = x86_64-apple-macosx
PLATFORM = $(ARCH)-apple-macosx
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
TEST_BUNDLE = ${CMD_NAME}PackageTests.xctest
TEST_RESOURCES_DIRECTORY = ./.build/${PLATFORM}/debug/${TEST_BUNDLE}/Contents/Resources
endif

RUN_RESOURCES_DIRECTORY = ${EXECUTABLE_DIRECTORY}

################################################################################
#
Expand All @@ -49,7 +45,7 @@ version:
xcodebuild -version
swiftenv version
swift --version
# swift package tools-version
swift package tools-version

.PHONY: init
init:
Expand All @@ -63,38 +59,21 @@ bootstrap:
.PHONY: clean
clean:
script/clean
xcodebuild clean
# swift package clean
# swift package reset

.PHONY: distclean
distclean:
rm -rf Packages
# swift package clean
distclean: clean

.PHONY: updateHeaders
updateHeaders:
script/update_headers

.PHONY: build
build: #copyRunResources
build:
script/build
# swift build $(SWIFTC_FLAGS) $(LINKER_FLAGS)

.PHONY: test
test: build #copyTestResources
test: build
script/test
# swift test --enable-test-discovery

.PHONY: copyRunResources
copyRunResources:
mkdir -p ${RUN_RESOURCES_DIRECTORY}
cp -r Resources/* ${RUN_RESOURCES_DIRECTORY}

.PHONY: copyTestResources
copyTestResources:
mkdir -p ${TEST_RESOURCES_DIRECTORY}
cp -r Resources/* ${TEST_RESOURCES_DIRECTORY}

# make run ARGS="asdf"
.PHONY: run
Expand All @@ -109,6 +88,10 @@ install:
uninstall:
script/uninstall

.PHONY: format
lint:
script/format

.PHONY: lint
lint:
script/lint
Expand All @@ -117,10 +100,6 @@ lint:
danger:
script/danger

.PHONY: archive
archive:
script/archive

# Builds bottles
.PHONY: bottles
bottles:
Expand All @@ -138,26 +117,18 @@ package:
packageInstall:
script/package_install

.PHONY: release
release:
script/release

# .PHONY: describe
# describe:
# swift package describe

# .PHONY: resolve
# resolve:
# swift package resolve
.PHONY: describe
describe:
swift package describe

# .PHONY: dependencies
# dependencies: resolve
# swift package show-dependencies
.PHONY: resolve
resolve:
swift package resolve

# .PHONY: update
# update: resolve
# swift package update
.PHONY: dependencies
dependencies: resolve
swift package show-dependencies

# .PHONY: xcproj
# xcproj:
# swift package generate-xcodeproj
.PHONY: update
update: resolve
swift package update
13 changes: 0 additions & 13 deletions script/archive

This file was deleted.

7 changes: 7 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ main() {
rm -f Brewfile.lock.json
brew bundle install --no-upgrade --verbose

if [[ "CI" != "true" ]]; then
# Already installed on GitHub Actions runner.
if ! command -v swiftlint >/dev/null; then
brew install swiftlint
fi
fi

# Generate Package.swift
script/version
}
Expand Down
2 changes: 1 addition & 1 deletion script/brew_formula_update
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# brew bump-formula-pr --help
#

BREW_CORE_PATH="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula"
BREW_CORE_PATH="$(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula"

function usage {
echo "Usage: brew_formula_bump [v1.0] [sha1_hash]"
Expand Down
19 changes: 16 additions & 3 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@
# Builds the Swift Package.
#

script/clean
script/lint
# Build for the host architecture by default.
ARCH=
if [[ "$1" == '--universal' ]]; then
ARCH='--arch arm64 --arch x86_64'
fi

# Disable the manifest cache on Xcode 12.5 and later.
CACHE=
if [[ "$(swift build --help)" =~ manifest-cache ]]; then
CACHE='--manifest-cache none'
fi

echo "==> 🏗️ Building mas ($(script/version))"
swift build --configuration release --arch arm64 --arch x86_64
swift build \
--configuration release \
${ARCH} \
--disable-sandbox \
${CACHE}
3 changes: 1 addition & 2 deletions script/build_artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ VERSION=$(script/version)
echo "Building mas $VERSION artifacts"

script/clean
script/build
script/archive
script/build --universal
script/package
4 changes: 2 additions & 2 deletions script/clean
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
# Deletes the build directory.
#

BUILD_DIR=.build
rm -rf ${BUILD_DIR:?}
swift package clean
swift package reset
21 changes: 16 additions & 5 deletions script/install
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
#

ARCH=$(uname -m)
RELEASE=.build/${ARCH}-apple-macosx/release
VERSION=$(script/version)

# Override default prefix path with optional 1st arg
if test -n "$1"; then
PREFIX="$1"
elif [[ $(uname -m) == 'arm64' ]]; then
if [[ $(uname -m) == 'arm64' ]]; then
PREFIX=/opt/homebrew
else
PREFIX=/usr/local
fi

while test -n "$1"; do
if [[ "$1" == '--universal' ]]; then
ARCH=universal
RELEASE=.build/apple/Products/Release
else
# Override default prefix path with optional arg
PREFIX="$1"
fi

shift
done

echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
ditto -v \
".build/apple/Products/Release/mas" \
"$RELEASE/mas" \
"$PREFIX/bin/"
2 changes: 1 addition & 1 deletion script/package
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DISTRIBUTION_PLIST="Package/Distribution.plist"

# Destination for install root
DSTROOT=.build/distributions
script/install "$DSTROOT/usr/local"
script/install "$DSTROOT/usr/local" --universal

VERSION=$(script/version)

Expand Down
2 changes: 1 addition & 1 deletion script/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# script/uninstall
# mas
#
# Removes mas and MasKit from PREFIX.
# Removes mas from PREFIX.
#

# Override default prefix path with optional 1st arg
Expand Down

0 comments on commit 2f2a43b

Please sign in to comment.