Skip to content

Commit

Permalink
Ensure that binaries are executable
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny committed Jan 11, 2025
1 parent 329f9b0 commit d0a2bfd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand All @@ -88,15 +88,15 @@ $(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)"

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

Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit d0a2bfd

Please sign in to comment.