build: remove `_data/authors.yml` from the gem

This commit is contained in:
Cotes Chung 2023-09-10 12:39:18 +08:00
parent 75a2504fd9
commit ec69bea841
No known key found for this signature in database
GPG Key ID: 0D9E54843167A808
2 changed files with 11 additions and 17 deletions

View File

@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.license = "MIT" spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select { |f| spec.files = `git ls-files -z`.split("\x0").select { |f|
f.match(%r!^((_(includes|layouts|sass|data)|assets)\/|README|LICENSE)!i) f.match(%r!^((_(includes|layouts|sass|(data\/(locales|origin)))|assets)\/|README|LICENSE)!i)
} }
spec.metadata = { spec.metadata = {

View File

@ -112,8 +112,6 @@ _bump_files() {
sed -i "s/v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/v$1/" "${FILES[$i]}" sed -i "s/v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/v$1/" "${FILES[$i]}"
done done
npm run build
} }
_bump_gemspec() { _bump_gemspec() {
@ -138,26 +136,22 @@ bump() {
fi fi
} }
## Remove unnecessary theme settings ## Build a gem package
cleanup_config() {
cp _config.yml _config.yml.bak
sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
}
resume_config() {
mv _config.yml.bak _config.yml
}
# build a gem package
build_gem() { build_gem() {
echo -e "Build the gem package for v$_version\n" echo -e "Build the gem package for v$_version\n"
cleanup_config
# Remove unnecessary theme settings
sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml
rm -f ./*.gem rm -f ./*.gem
npm run build
git add "$JS_DIST" -f # add JS dist to gem git add "$JS_DIST" -f # add JS dist to gem
gem build "$GEM_SPEC" gem build "$GEM_SPEC"
cp "$JS_DIST"/* "$BACKUP_PATH" cp "$JS_DIST"/* "$BACKUP_PATH"
git restore --staged "$JS_DIST" # resume the git status
resume_config # Resume the settings
git reset
git checkout .
} }
# Update the git branch graph, tag, and then build the gem package. # Update the git branch graph, tag, and then build the gem package.