From d0a2bfdb5a3b9632c6f5f41101ff7e62e1f4eb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20M=C3=B6sch?= Date: Sat, 11 Jan 2025 15:06:03 +0100 Subject: [PATCH] Ensure that binaries are executable --- .github/workflows/release.yml | 6 +++++- Makefile | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f3d28b768..04aaabe7cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,8 +94,12 @@ jobs: with: name: swiftlint_linux_amd64 path: .build/linux + - name: Make binary executable + run: chmod +x .build/universal/swiftlint .build/linux/swiftlint_linux_amd64 + - name: List downloaded files + run: tree .build - name: Create SPM artifact bundle - run: make spm_artifactbundle + run: make --debug spm_artifactbundle - name: Update binary target in Swift package run: ./tools/update-artifact-bundle.sh "${{ inputs.version }}" - name: Create tag and release commit diff --git a/Makefile b/Makefile index 29b90a479c..7f6b280b2b 100644 --- a/Makefile +++ b/Makefile @@ -28,9 +28,9 @@ OUTPUT_PACKAGE=SwiftLint.pkg VERSION_STRING=$(shell ./tools/get-version) -.PHONY: all clean build install package test uninstall docs +.PHONY: all clean install package test uninstall docs -all: build +all: $(SWIFTLINT_EXECUTABLE) sourcery: Source/SwiftLintBuiltInRules/Models/BuiltInRules.swift Source/SwiftLintFramework/Models/ReportersList.swift Tests/GeneratedTests/GeneratedTests.swift @@ -72,7 +72,7 @@ clean: clean_xcode: $(BUILD_TOOL) $(XCODEFLAGS) -configuration Test clean -build: +$(SWIFTLINT_EXECUTABLE): mkdir -p "$(SWIFTLINT_EXECUTABLE_PARENT)" bazel build --config release universal_swiftlint $(eval SWIFTLINT_BINARY := $(shell bazel cquery --config release --output=files universal_swiftlint)) @@ -88,7 +88,7 @@ $(SWIFTLINT_EXECUTABLE_LINUX_AMD64): build_with_disable_sandbox: swift build --disable-sandbox $(SWIFT_BUILD_FLAGS) -install: build +install: $(SWIFTLINT_EXECUTABLE) install -d "$(BINARIES_FOLDER)" install "$(SWIFTLINT_EXECUTABLE)" "$(BINARIES_FOLDER)" @@ -96,7 +96,7 @@ uninstall: rm -rf "$(FRAMEWORKS_FOLDER)/SwiftLintFramework.framework" rm -f "$(BINARIES_FOLDER)/swiftlint" -installables: build +installables: $(SWIFTLINT_EXECUTABLE) install -d "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" install "$(SWIFTLINT_EXECUTABLE)" "$(TEMPORARY_FOLDER)$(BINARIES_FOLDER)" @@ -134,7 +134,7 @@ zip_linux_release: $(SWIFTLINT_EXECUTABLE_LINUX_AMD64) cp -f "$(LICENSE_PATH)" "$(TMP_FOLDER)" (cd "$(TMP_FOLDER)"; zip -yr - "swiftlint" "LICENSE") > "./swiftlint_linux.zip" -package: build +package: $(SWIFTLINT_EXECUTABLE) $(eval PACKAGE_ROOT := $(shell mktemp -d)) cp "$(SWIFTLINT_EXECUTABLE)" "$(PACKAGE_ROOT)" pkgbuild \