Make linux zip from GitHub's remote Docker image

Locally I had trouble building the image on both my previous Intel MacBook Pro
and my new M1 Max MacBook Pro.
This commit is contained in:
JP Simard 2022-03-16 11:05:09 -04:00
parent 0e5d838765
commit ca2712aaee
No known key found for this signature in database
GPG Key ID: 184C3F2916202C58
1 changed files with 8 additions and 1 deletions

View File

@ -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)"
@ -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 .