Skip to content

Commit 0c32cfd

Browse files
committed
[CI] save Index/DataStore for periphery skip-build option
1 parent 5eebdfb commit 0c32cfd

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

.github/workflows/commit-ci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on:
33
push:
44
branches:
55
- '*'
6-
paths:
7-
- 'sources/**'
86
jobs:
97
build:
108
runs-on: macos-14
@@ -31,7 +29,7 @@ jobs:
3129
run: brew install peripheryapp/periphery/periphery
3230

3331
- name: Check Unused Code
34-
run: periphery scan
32+
run: periphery scan --skip-build --index-store-path build/Index.noindex/DataStore
3533

3634
- name: Upload Squirrel artifact
3735
uses: actions/upload-artifact@v4

.github/workflows/pull-request-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: brew install peripheryapp/periphery/periphery
2727

2828
- name: Check Unused Code
29-
run: periphery scan
29+
run: periphery scan --skip-build --index-store-path build/Index.noindex/DataStore
3030

3131
- name: Upload Squirrel artifact
3232
uses: actions/upload-artifact@v4

.github/workflows/release-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: brew install peripheryapp/periphery/periphery
3535

3636
- name: Check Unused Code
37-
run: periphery scan
37+
run: periphery scan --skip-build --index-store-path build/Index.noindex/DataStore
3838

3939
- name: Build changelog
4040
id: release_log

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ install: install-release
55

66
RIME_BIN_DIR = librime/dist/bin
77
RIME_LIB_DIR = librime/dist/lib
8+
DERIVED_DATA_PATH = build
89

910
RIME_LIBRARY_FILE_NAME = librime.1.dylib
1011
RIME_LIBRARY = lib/$(RIME_LIBRARY_FILE_NAME)
@@ -95,13 +96,17 @@ ifdef MACOSX_DEPLOYMENT_TARGET
9596
BUILD_SETTINGS += MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DEPLOYMENT_TARGET)"
9697
endif
9798

99+
BUILD_SETTINGS += COMPILER_INDEX_STORE_ENABLE=YES
100+
98101
release: $(DEPS_CHECK)
102+
mkdir -p $(DERIVED_DATA_PATH)
99103
bash package/add_data_files
100-
xcodebuild -project Squirrel.xcodeproj -configuration Release $(BUILD_SETTINGS) build
104+
xcodebuild -project Squirrel.xcodeproj -configuration Release -scheme Squirrel -derivedDataPath $(DERIVED_DATA_PATH) $(BUILD_SETTINGS) build
101105

102106
debug: $(DEPS_CHECK)
107+
mkdir -p $(DERIVED_DATA_PATH)
103108
bash package/add_data_files
104-
xcodebuild -project Squirrel.xcodeproj -configuration Debug $(BUILD_SETTINGS) build
109+
xcodebuild -project Squirrel.xcodeproj -configuration Debug -scheme Squirrel -derivedDataPath $(DERIVED_DATA_PATH) $(BUILD_SETTINGS) build
105110

106111
.PHONY: sparkle copy-sparkle-framework
107112

@@ -127,9 +132,9 @@ clean-sparkle:
127132

128133
package: release
129134
ifdef DEV_ID
130-
bash package/sign_app $(DEV_ID)
135+
bash package/sign_app "$(DEV_ID)" "$(DERIVED_DATA_PATH)"
131136
endif
132-
bash package/make_package
137+
bash package/make_package "$(DERIVED_DATA_PATH)"
133138
ifdef DEV_ID
134139
productsign --sign "Developer ID Installer: $(DEV_ID)" package/Squirrel.pkg package/Squirrel-signed.pkg
135140
rm package/Squirrel.pkg
@@ -151,12 +156,12 @@ permission-check:
151156

152157
install-debug: debug permission-check
153158
rm -rf "$(SQUIRREL_APP_ROOT)"
154-
cp -R build/Debug/Squirrel.app "$(DSTROOT)"
159+
cp -R $(DERIVED_DATA_PATH)/Build/Products/Debug/Squirrel.app "$(DSTROOT)"
155160
DSTROOT="$(DSTROOT)" RIME_NO_PREBUILD=1 bash scripts/postinstall
156161

157162
install-release: release permission-check
158163
rm -rf "$(SQUIRREL_APP_ROOT)"
159-
cp -R build/Release/Squirrel.app "$(DSTROOT)"
164+
cp -R $(DERIVED_DATA_PATH)/Build/Products/Release/Squirrel.app "$(DSTROOT)"
160165
DSTROOT="$(DSTROOT)" bash scripts/postinstall
161166

162167
.PHONY: clean clean-deps

package/make_package

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
DERIVED_DATA_PATH=$1
34
BUNDLE_IDENTIFIER='im.rime.inputmethod.Squirrel'
45
INSTALL_LOCATION='/Library/Input Methods'
56

@@ -8,7 +9,7 @@ source common.sh
89

910
pkgbuild \
1011
--info PackageInfo \
11-
--root "${PROJECT_ROOT}/build/Release" \
12+
--root "${PROJECT_ROOT}/${DERIVED_DATA_PATH}/Build/Products/Release" \
1213
--filter '.*\.swiftmodule$' \
1314
--component-plist Squirrel-component.plist \
1415
--identifier "${BUNDLE_IDENTIFIER}" \

package/sign_app

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#! /bin/bash
22
# enconding: utf-8
33

4-
appDir="build/Release/Squirrel.app"
4+
DEV_ID=$1
5+
DERIVED_DATA_PATH=$2
6+
appDir="${DERIVED_DATA_PATH}/Build/Products/Release/Squirrel.app"
57
entitlement="resources/Squirrel.entitlements"
68

7-
codesign --deep --force --options runtime --timestamp --sign "Developer ID Application: $1" --entitlements "$entitlement" --verbose "$appDir";
9+
codesign --deep --force --options runtime --timestamp --sign "Developer ID Application: ${DEV_ID}" --entitlements "$entitlement" --verbose "$appDir";
810

911
spctl -a -vv "$appDir";

0 commit comments

Comments
 (0)