-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (38 loc) · 1.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
SWIFT_BUILD_FLAGS := -c release --disable-sandbox --arch arm64 --arch x86_64
TOOL_NAME := l10nlint
TOOL_BIN_DIR := $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)
TOOL_BIN := $(TOOL_BIN_DIR)/$(TOOL_NAME)
.PHONY: $(MAKECMDGOALS)
build-cp-zsh: build
sudo rm -f /usr/local/bin/$(TOOL_NAME)
sudo cp $(TOOL_BIN) /usr/local/bin/$(TOOL_NAME)
make install-completion-zsh
install-completion-zsh:
mkdir -p ~/.zsh/competion
$(TOOL_NAME) --generate-completion-script zsh > ~/.zsh/completion/_$(TOOL_NAME)
build:
swift build $(SWIFT_BUILD_FLAGS)
@echo $(TOOL_BIN)
zip: build
rm -f $(TOOL_NAME).zip
zip -j $(TOOL_NAME).zip $(TOOL_BIN)
change-version:
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
./Scripts/change-version.sh $(TAG)
git add Sources/l10nlint/Generated/Version.swift
git commit -m "Bump version to $(TAG)"
git push origin main
git tag $(TAG)
git push origin $(TAG)
release: change-version zip
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
gh release create "$(TAG)" --generate-notes
gh release upload $(TAG) $(TOOL_NAME).zip
upload-zip: zip
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
gh release upload $(TAG) $(TOOL_NAME).zip
delete-zip:
@[ -n "$(TAG)" ] || (echo "\nERROR: Make sure setting environment variable 'TAG'." && exit 1)
gh release delete-asset $(TAG) $(TOOL_NAME).zip
sha256-zip:
shasum -a 256 $(TOOL_NAME).zip