Merge branch 'main' into quick

This commit is contained in:
Chris Araman 2021-05-08 10:07:23 -07:00 committed by GitHub
commit 97f026309d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 112 additions and 93 deletions

View file

@ -1,6 +1,35 @@
{ {
"entries": { "entries": {
"brew": { "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": { "shfmt": {
"version": "3.2.4", "version": "3.2.4",
"bottle": { "bottle": {
@ -97,12 +126,12 @@
"system": { "system": {
"macos": { "macos": {
"big_sur": { "big_sur": {
"HOMEBREW_VERSION": "3.1.3-107-g1157a97", "HOMEBREW_VERSION": "3.1.5",
"HOMEBREW_PREFIX": "/opt/homebrew", "HOMEBREW_PREFIX": "/opt/homebrew",
"Homebrew/homebrew-core": "1da7ce26f5cfa33eec131571755152680a5321b7", "Homebrew/homebrew-core": "e6c5a215e70e758472a62b1ff0a1ecdf94facc61",
"CLT": "12.5.0.0.1.1617976050", "CLT": "12.5.0.0.1.1617976050",
"Xcode": "12.5", "Xcode": "12.5",
"macOS": "11.3" "macOS": "11.3.1"
} }
} }
} }

View file

@ -13,7 +13,7 @@ has_test_changes = !git.modified_files.grep(/Tests/).empty?
is_version_bump = git.modified_files.sort == [ is_version_bump = git.modified_files.sort == [
"Package.swift", "Package.swift",
"MasKit/SupportingFiles/Package.swift" "MasKit/Package.swift"
].sort ].sort
message(":bookmark: Version bump!") if is_version_bump message(":bookmark: Version bump!") if is_version_bump

View file

@ -2,8 +2,8 @@ class Mas < Formula
desc "Mac App Store command-line interface" desc "Mac App Store command-line interface"
homepage "https://github.com/mas-cli/mas" homepage "https://github.com/mas-cli/mas"
url "https://github.com/mas-cli/mas.git", url "https://github.com/mas-cli/mas.git",
tag: "v1.8.1", tag: "v1.8.2",
revision: "23a36b4555f5625fe29915b31b8b101064452dca" revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
license "MIT" license "MIT"
head "https://github.com/mas-cli/mas.git" head "https://github.com/mas-cli/mas.git"
@ -26,7 +26,8 @@ class Mas < Formula
end end
def install def install
system "script/install", prefix system "script/build", "--universal"
system "script/install", "--universal", prefix
bash_completion.install "contrib/completion/mas-completion.bash" => "mas" bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
fish_completion.install "contrib/completion/mas.fish" fish_completion.install "contrib/completion/mas.fish"
@ -34,6 +35,6 @@ class Mas < Formula
test do test do
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp 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
end end

View file

@ -2,15 +2,15 @@ class Mas < Formula
desc "Mac App Store command-line interface" desc "Mac App Store command-line interface"
homepage "https://github.com/mas-cli/mas" homepage "https://github.com/mas-cli/mas"
url "https://github.com/mas-cli/mas.git", url "https://github.com/mas-cli/mas.git",
tag: "v1.8.1", tag: "v1.8.2",
revision: "23a36b4555f5625fe29915b31b8b101064452dca" revision: "c88a98892e52a0ad8527a532aaa5dd1a2dd19635"
license "MIT" license "MIT"
head "https://github.com/mas-cli/mas.git" head "https://github.com/mas-cli/mas.git"
bottle do bottle do
sha256 cellar: :any, arm64_big_sur: "ef2ed904d1283722af006811471484cb1c9c73b255a766b5c0c65ecd1654c8d8" sha256 cellar: :any, arm64_big_sur: "f5ef4f44057f43ecc14f970687d832bd152bc6142c0ad848977f0a6527aa934f"
sha256 cellar: :any, big_sur: "dc98d69cfa94467e046b443c088a6097fe0ce0d2935e37046815fa3a984a0ca4" sha256 cellar: :any, big_sur: "d92cfc734e730fde87b29c6bf4a50ce63a78b9e505f464dc557eee128aa06d05"
sha256 cellar: :any, catalina: "2e7ffedf674543f98c2b95868b6a23db208cb2e6a3ec1ddbb3553ddab0cf9a68" sha256 cellar: :any, catalina: "163eb9cfdfed3d8fbda133b4079d104ad687f1ddb71d70d5661d02b22f562e76"
end end
depends_on :macos depends_on :macos
@ -21,6 +21,7 @@ class Mas < Formula
end end
def install def install
system "script/build"
system "script/install", prefix system "script/install", prefix
bash_completion.install "contrib/completion/mas-completion.bash" => "mas" bash_completion.install "contrib/completion/mas-completion.bash" => "mas"
@ -29,6 +30,6 @@ class Mas < Formula
test do test do
assert_equal version.to_s, shell_output("#{bin}/mas version").chomp 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
end end

View file

@ -26,17 +26,13 @@ SWIFT_VERSION = 5.3.2
# OS specific differences # OS specific differences
UNAME = ${shell uname} UNAME = ${shell uname}
ARCH = ${shell uname -m}
ifeq ($(UNAME), Darwin) ifeq ($(UNAME), Darwin)
SWIFTC_FLAGS = PLATFORM = $(ARCH)-apple-macosx
LINKER_FLAGS = -Xlinker -L/usr/local/lib
PLATFORM = x86_64-apple-macosx
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
TEST_BUNDLE = ${CMD_NAME}PackageTests.xctest
TEST_RESOURCES_DIRECTORY = ./.build/${PLATFORM}/debug/${TEST_BUNDLE}/Contents/Resources
endif endif
RUN_RESOURCES_DIRECTORY = ${EXECUTABLE_DIRECTORY}
################################################################################ ################################################################################
# #
@ -49,7 +45,7 @@ version:
xcodebuild -version xcodebuild -version
swiftenv version swiftenv version
swift --version swift --version
# swift package tools-version swift package tools-version
.PHONY: init .PHONY: init
init: init:
@ -63,38 +59,21 @@ bootstrap:
.PHONY: clean .PHONY: clean
clean: clean:
script/clean script/clean
xcodebuild clean
# swift package clean
# swift package reset
.PHONY: distclean .PHONY: distclean
distclean: distclean: clean
rm -rf Packages
# swift package clean
.PHONY: updateHeaders .PHONY: updateHeaders
updateHeaders: updateHeaders:
script/update_headers script/update_headers
.PHONY: build .PHONY: build
build: #copyRunResources build:
script/build script/build
# swift build $(SWIFTC_FLAGS) $(LINKER_FLAGS)
.PHONY: test .PHONY: test
test: build #copyTestResources test: build
script/test 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" # make run ARGS="asdf"
.PHONY: run .PHONY: run
@ -109,6 +88,10 @@ install:
uninstall: uninstall:
script/uninstall script/uninstall
.PHONY: format
lint:
script/format
.PHONY: lint .PHONY: lint
lint: lint:
script/lint script/lint
@ -117,10 +100,6 @@ lint:
danger: danger:
script/danger script/danger
.PHONY: archive
archive:
script/archive
# Builds bottles # Builds bottles
.PHONY: bottles .PHONY: bottles
bottles: bottles:
@ -138,26 +117,18 @@ package:
packageInstall: packageInstall:
script/package_install script/package_install
.PHONY: release .PHONY: describe
release: describe:
script/release swift package describe
# .PHONY: describe .PHONY: resolve
# describe: resolve:
# swift package describe swift package resolve
# .PHONY: resolve .PHONY: dependencies
# resolve: dependencies: resolve
# swift package resolve swift package show-dependencies
# .PHONY: dependencies .PHONY: update
# dependencies: resolve update: resolve
# swift package show-dependencies swift package update
# .PHONY: update
# update: resolve
# swift package update
# .PHONY: xcproj
# xcproj:
# swift package generate-xcodeproj

View file

@ -1,13 +0,0 @@
#!/bin/bash -e
#
# script/archive
# mas
#
# Compresses artifacts so the can be archived more easily.
#
echo "==> 🗜️ Compressing mas"
zip .build/mas.zip .build/apple/Products/Release/mas
echo "==> 🔢 File Hash"
shasum -a 256 .build/mas.zip

View file

@ -18,6 +18,13 @@ main() {
rm -f Brewfile.lock.json rm -f Brewfile.lock.json
brew bundle install --no-upgrade --verbose 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 # Generate Package.swift
script/version script/version
} }

View file

@ -9,7 +9,7 @@
# brew bump-formula-pr --help # 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 { function usage {
echo "Usage: brew_formula_bump [v1.0] [sha1_hash]" echo "Usage: brew_formula_bump [v1.0] [sha1_hash]"

View file

@ -6,8 +6,21 @@
# Builds the Swift Package. # Builds the Swift Package.
# #
script/clean # Build for the host architecture by default.
script/lint 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))" echo "==> 🏗️ Building mas ($(script/version))"
swift build --configuration release --arch arm64 --arch x86_64 swift build \
--configuration release \
${ARCH} \
--disable-sandbox \
${CACHE}

View file

@ -11,6 +11,5 @@ VERSION=$(script/version)
echo "Building mas $VERSION artifacts" echo "Building mas $VERSION artifacts"
script/clean script/clean
script/build script/build --universal
script/archive
script/package script/package

View file

@ -6,5 +6,5 @@
# Deletes the build directory. # Deletes the build directory.
# #
BUILD_DIR=.build swift package clean
rm -rf ${BUILD_DIR:?} swift package reset

View file

@ -10,18 +10,29 @@
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb # https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
# #
ARCH=$(uname -m)
RELEASE=.build/${ARCH}-apple-macosx/release
VERSION=$(script/version) VERSION=$(script/version)
# Override default prefix path with optional 1st arg if [[ $(uname -m) == 'arm64' ]]; then
if test -n "$1"; then
PREFIX="$1"
elif [[ $(uname -m) == 'arm64' ]]; then
PREFIX=/opt/homebrew PREFIX=/opt/homebrew
else else
PREFIX=/usr/local PREFIX=/usr/local
fi 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" echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
ditto -v \ ditto -v \
".build/apple/Products/Release/mas" \ "$RELEASE/mas" \
"$PREFIX/bin/" "$PREFIX/bin/"

View file

@ -18,7 +18,7 @@ DISTRIBUTION_PLIST="Package/Distribution.plist"
# Destination for install root # Destination for install root
DSTROOT=.build/distributions DSTROOT=.build/distributions
script/install "$DSTROOT/usr/local" script/install "$DSTROOT/usr/local" --universal
VERSION=$(script/version) VERSION=$(script/version)

View file

@ -3,7 +3,7 @@
# script/uninstall # script/uninstall
# mas # mas
# #
# Removes mas and MasKit from PREFIX. # Removes mas from PREFIX.
# #
# Override default prefix path with optional 1st arg # Override default prefix path with optional 1st arg