Skip to content

Commit

Permalink
[CI] save Index/DataStore for periphery skip-build option
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed May 27, 2024
1 parent 5eebdfb commit 0c32cfd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
branches:
- '*'
paths:
- 'sources/**'
jobs:
build:
runs-on: macos-14
Expand All @@ -31,7 +29,7 @@ jobs:
run: brew install peripheryapp/periphery/periphery

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

- name: Upload Squirrel artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: brew install peripheryapp/periphery/periphery

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

- name: Upload Squirrel artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: brew install peripheryapp/periphery/periphery

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

- name: Build changelog
id: release_log
Expand Down
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ install: install-release

RIME_BIN_DIR = librime/dist/bin
RIME_LIB_DIR = librime/dist/lib
DERIVED_DATA_PATH = build

RIME_LIBRARY_FILE_NAME = librime.1.dylib
RIME_LIBRARY = lib/$(RIME_LIBRARY_FILE_NAME)
Expand Down Expand Up @@ -95,13 +96,17 @@ ifdef MACOSX_DEPLOYMENT_TARGET
BUILD_SETTINGS += MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DEPLOYMENT_TARGET)"
endif

BUILD_SETTINGS += COMPILER_INDEX_STORE_ENABLE=YES

release: $(DEPS_CHECK)
mkdir -p $(DERIVED_DATA_PATH)
bash package/add_data_files
xcodebuild -project Squirrel.xcodeproj -configuration Release $(BUILD_SETTINGS) build
xcodebuild -project Squirrel.xcodeproj -configuration Release -scheme Squirrel -derivedDataPath $(DERIVED_DATA_PATH) $(BUILD_SETTINGS) build

debug: $(DEPS_CHECK)
mkdir -p $(DERIVED_DATA_PATH)
bash package/add_data_files
xcodebuild -project Squirrel.xcodeproj -configuration Debug $(BUILD_SETTINGS) build
xcodebuild -project Squirrel.xcodeproj -configuration Debug -scheme Squirrel -derivedDataPath $(DERIVED_DATA_PATH) $(BUILD_SETTINGS) build

.PHONY: sparkle copy-sparkle-framework

Expand All @@ -127,9 +132,9 @@ clean-sparkle:

package: release
ifdef DEV_ID
bash package/sign_app $(DEV_ID)
bash package/sign_app "$(DEV_ID)" "$(DERIVED_DATA_PATH)"
endif
bash package/make_package
bash package/make_package "$(DERIVED_DATA_PATH)"
ifdef DEV_ID
productsign --sign "Developer ID Installer: $(DEV_ID)" package/Squirrel.pkg package/Squirrel-signed.pkg
rm package/Squirrel.pkg
Expand All @@ -151,12 +156,12 @@ permission-check:

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

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

.PHONY: clean clean-deps
Expand Down
3 changes: 2 additions & 1 deletion package/make_package
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

DERIVED_DATA_PATH=$1
BUNDLE_IDENTIFIER='im.rime.inputmethod.Squirrel'
INSTALL_LOCATION='/Library/Input Methods'

Expand All @@ -8,7 +9,7 @@ source common.sh

pkgbuild \
--info PackageInfo \
--root "${PROJECT_ROOT}/build/Release" \
--root "${PROJECT_ROOT}/${DERIVED_DATA_PATH}/Build/Products/Release" \
--filter '.*\.swiftmodule$' \
--component-plist Squirrel-component.plist \
--identifier "${BUNDLE_IDENTIFIER}" \
Expand Down
6 changes: 4 additions & 2 deletions package/sign_app
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#! /bin/bash
# enconding: utf-8

appDir="build/Release/Squirrel.app"
DEV_ID=$1
DERIVED_DATA_PATH=$2
appDir="${DERIVED_DATA_PATH}/Build/Products/Release/Squirrel.app"
entitlement="resources/Squirrel.entitlements"

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

spctl -a -vv "$appDir";

0 comments on commit 0c32cfd

Please sign in to comment.