Skip to content

Commit

Permalink
Make linux zip from GitHub's remote Docker image
Browse files Browse the repository at this point in the history
Locally I had trouble building the image on both my previous Intel MacBook Pro
and my new M1 Max MacBook Pro.
  • Loading branch information
jpsim committed Mar 16, 2022
1 parent 0e5d838 commit ca2712a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ zip_linux: docker_image
cp -f "$(LICENSE_PATH)" "$(TMP_FOLDER)"
(cd "$(TMP_FOLDER)"; zip -yr - "swiftlint" "LICENSE") > "./swiftlint_linux.zip"

zip_linux_release:
$(eval TMP_FOLDER := $(shell mktemp -d))
docker run ghcr.io/realm/swiftlint:$(VERSION_STRING) cat /usr/bin/swiftlint > "$(TMP_FOLDER)/swiftlint"
chmod +x "$(TMP_FOLDER)/swiftlint"
cp -f "$(LICENSE_PATH)" "$(TMP_FOLDER)"
(cd "$(TMP_FOLDER)"; zip -yr - "swiftlint" "LICENSE") > "./swiftlint_linux.zip"

package: build
$(eval PACKAGE_ROOT := $(shell mktemp -d))
cp "$(SWIFTLINT_EXECUTABLE)" "$(PACKAGE_ROOT)"
Expand All @@ -121,7 +128,7 @@ package: build
--version $(VERSION_STRING) \
"$(OUTPUT_PACKAGE)"

release: package portable_zip zip_linux
release: package portable_zip zip_linux_release

docker_image:
docker build --platform linux/amd64 --force-rm --tag swiftlint .
Expand Down

0 comments on commit ca2712a

Please sign in to comment.