From ec69bea8410238dbcd4923da0f1bc8e13b095d96 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 10 Sep 2023 12:39:18 +0800 Subject: [PATCH] build: remove `_data/authors.yml` from the gem --- jekyll-theme-chirpy.gemspec | 2 +- tools/release | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/jekyll-theme-chirpy.gemspec b/jekyll-theme-chirpy.gemspec index c577306..90ba319 100644 --- a/jekyll-theme-chirpy.gemspec +++ b/jekyll-theme-chirpy.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.license = "MIT" 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 = { diff --git a/tools/release b/tools/release index 43182eb..4ac1322 100755 --- a/tools/release +++ b/tools/release @@ -112,8 +112,6 @@ _bump_files() { sed -i "s/v[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/v$1/" "${FILES[$i]}" done - - npm run build } _bump_gemspec() { @@ -138,26 +136,22 @@ bump() { fi } -## Remove unnecessary theme settings -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 a gem package build_gem() { 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 + + npm run build git add "$JS_DIST" -f # add JS dist to gem gem build "$GEM_SPEC" 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.