Merge branch 'master' into production
This commit is contained in:
commit
bdee5d6b6d
21 changed files with 205 additions and 172 deletions
|
@ -1,5 +0,0 @@
|
|||
# https://github.com/browserslist/browserslist#browserslistrc
|
||||
|
||||
last 2 versions
|
||||
> 0.2%
|
||||
not dead
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"rules": {
|
||||
"body-max-line-length": [
|
||||
0,
|
||||
"always"
|
||||
]
|
||||
}
|
||||
}
|
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
|
@ -7,7 +7,7 @@ updates:
|
|||
bundler:
|
||||
dependency-type: "production"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
versioning-strategy: increase
|
||||
|
@ -15,7 +15,7 @@ updates:
|
|||
npm:
|
||||
dependency-type: "development"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
groups:
|
||||
|
@ -23,4 +23,4 @@ updates:
|
|||
update-types:
|
||||
- "major"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "monthly"
|
||||
|
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -19,10 +19,6 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
ruby: [2.7, 3]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
@ -32,11 +28,11 @@ jobs:
|
|||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
ruby-version: 3
|
||||
bundler-cache: true
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
- name: Build Assets
|
||||
run: npm i && npm run build
|
||||
|
|
2
.github/workflows/style-lint.yml
vendored
2
.github/workflows/style-lint.yml
vendored
|
@ -20,6 +20,6 @@ jobs:
|
|||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@v4
|
||||
- run: npm i
|
||||
- run: npm test
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"trailingComma": "none"
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"extends": "stylelint-config-standard-scss",
|
||||
"rules": {
|
||||
"no-descending-specificity": null,
|
||||
"shorthand-property-no-redundant-values": null,
|
||||
"at-rule-no-vendor-prefix": null,
|
||||
"property-no-vendor-prefix": null,
|
||||
"selector-no-vendor-prefix": null,
|
||||
"value-no-vendor-prefix": null,
|
||||
"color-function-notation": "legacy",
|
||||
"alpha-value-notation": "number",
|
||||
"selector-not-notation": "simple",
|
||||
"color-hex-length": "long",
|
||||
"declaration-block-single-line-max-declarations": 3,
|
||||
"scss/operator-no-newline-after": null,
|
||||
"rule-empty-line-before": [
|
||||
"always",
|
||||
{ "ignore": ["after-comment", "first-nested"] }
|
||||
],
|
||||
"value-keyword-case": ["lower", { "ignoreProperties": ["/^\\$/"] }],
|
||||
"media-feature-range-notation": "prefix"
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"skip": {
|
||||
"commit": true,
|
||||
"tag": true
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"type": "feat",
|
||||
"section": "Features"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"section": "Bug Fixes"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"section": "Improvements"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Chirpy Jekyll Theme
|
||||
|
||||
A minimal, responsive and feature-rich Jekyll theme for technical writing.
|
||||
A minimal, responsive, and feature-rich Jekyll theme for technical writing.
|
||||
|
||||
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)][gem]
|
||||
[![CI](https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml/badge.svg?branch=master&event=push)][ci]
|
||||
|
@ -55,9 +55,9 @@ For details, see the "[Contributing Guidelines][contribute-guide]".
|
|||
|
||||
## Credits
|
||||
|
||||
This project is mainly built with [Jekyll][jekyllrb] ecosystem,
|
||||
This project was built primarily with the [Jekyll][jekyllrb] ecosystem,
|
||||
[Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib].
|
||||
The avatar and favicon design come from [Clipart Max][image].
|
||||
The avatar and favicon design from [Clipart Max][image].
|
||||
|
||||
Many thanks to the [contributors][contributors] who participated in the development
|
||||
and to the folks who reported bugs or shared ideas.
|
||||
|
|
|
@ -40,7 +40,7 @@ copyright:
|
|||
Except where otherwise noted, the blog posts on this site are licensed
|
||||
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
|
||||
|
||||
meta: Using the :THEME theme for :PLATFORM
|
||||
meta: Using the :THEME theme for :PLATFORM.
|
||||
|
||||
not_found:
|
||||
statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.
|
||||
|
|
|
@ -23,8 +23,8 @@ bootstrap:
|
|||
js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
|
||||
|
||||
toc:
|
||||
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.css
|
||||
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.js
|
||||
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.css
|
||||
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.js
|
||||
|
||||
fontawesome:
|
||||
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css
|
||||
|
@ -33,7 +33,7 @@ search:
|
|||
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
|
||||
|
||||
mermaid:
|
||||
js: https://cdn.jsdelivr.net/npm/mermaid@10.5.0/dist/mermaid.min.js
|
||||
js: https://cdn.jsdelivr.net/npm/mermaid@10.6.0/dist/mermaid.min.js
|
||||
|
||||
dayjs:
|
||||
js:
|
||||
|
|
|
@ -23,3 +23,16 @@ platforms:
|
|||
# - type: Weibo
|
||||
# icon: "fab fa-weibo"
|
||||
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
|
||||
#
|
||||
# - type: Mastodon
|
||||
# icon: "fa-brands fa-mastodon"
|
||||
# # See: https://github.com/justinribeiro/share-to-mastodon#properties
|
||||
# instances:
|
||||
# - label: mastodon.social
|
||||
# link: "https://mastodon.social/"
|
||||
# - label: mastodon.online
|
||||
# link: "https://mastodon.online/"
|
||||
# - label: fosstodon.org
|
||||
# link: "https://fosstodon.org/"
|
||||
# - label: photog.social
|
||||
# link: "https://photog.social/"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<iframe
|
||||
class="embed-video twitch"
|
||||
loading="lazy"
|
||||
src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
|
||||
frameborder="0"
|
||||
allowfullscreen="true"
|
||||
|
|
|
@ -1,23 +1,38 @@
|
|||
<!-- Post sharing snippet -->
|
||||
|
||||
<div class="share-wrapper d-flex align-items-center">
|
||||
<span class="share-label text-muted me-1">{{ site.data.locales[include.lang].post.share }}</span>
|
||||
<span class="share-label text-muted">{{ site.data.locales[include.lang].post.share }}</span>
|
||||
<span class="share-icons">
|
||||
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
|
||||
{% assign title = title | uri_escape %}
|
||||
{% assign url = page.url | absolute_url | url_encode %}
|
||||
|
||||
{% for share in site.data.share.platforms %}
|
||||
{% for share in site.data.share.platforms -%}
|
||||
{%- capture tooltip -%}
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}"
|
||||
{%- endcapture -%}
|
||||
|
||||
{% if share.type == 'Mastodon' %}
|
||||
<script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script>
|
||||
<button class="btn text-start" {{ tooltip }}>
|
||||
<share-to-mastodon
|
||||
class="share-mastodon"
|
||||
message="{{ title }}"
|
||||
url="{{ url }}"
|
||||
{%- if share.instances -%}
|
||||
customInstanceList="{{ share.instances | jsonify | xml_escape }}"
|
||||
{%- endif %}
|
||||
>
|
||||
<i class="fa-fw {{ share.icon }}"></i>
|
||||
</share-to-mastodon>
|
||||
</button>
|
||||
|
||||
{% continue %}
|
||||
{% endif %}
|
||||
|
||||
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
|
||||
<a
|
||||
href="{{ link }}"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ share.type }}"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
aria-label="{{ share.type }}"
|
||||
>
|
||||
|
||||
<a href="{{ link }}" target="_blank" rel="noopener" {{ tooltip }}>
|
||||
<i class="fa-fw {{ share.icon }}"></i>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
@ -31,7 +46,7 @@
|
|||
title="{{ site.data.locales[include.lang].post.button.share_link.title }}"
|
||||
data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}"
|
||||
>
|
||||
<i class="fa-fw fas fa-link pe-none"></i>
|
||||
<i class="fa-fw fas fa-link pe-none fs-6"></i>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -309,7 +309,6 @@ sup {
|
|||
.preview-img {
|
||||
aspect-ratio: 40 / 21;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
@extend %rounded;
|
||||
|
@ -324,6 +323,10 @@ sup {
|
|||
object-fit: cover;
|
||||
|
||||
@extend %rounded;
|
||||
|
||||
@at-root #post-list & {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,8 @@
|
|||
|
||||
/* Posts */
|
||||
--toc-highlight: #0550ae;
|
||||
--btn-share-hover-color: var(--link-color);
|
||||
--btn-share-color: gray;
|
||||
--btn-share-hover-color: #0d6efd;
|
||||
--card-bg: white;
|
||||
--card-hovor-bg: #e2e2e2;
|
||||
--card-shadow: rgb(104, 104, 104, 0.05) 0 2px 6px 0,
|
||||
|
|
|
@ -2,14 +2,6 @@
|
|||
Post-specific style
|
||||
*/
|
||||
|
||||
@mixin btn-sharing-color($light-color, $important: false) {
|
||||
@if $important {
|
||||
color: var(--btn-share-color, $light-color) !important;
|
||||
} @else {
|
||||
color: var(--btn-share-color, $light-color);
|
||||
}
|
||||
}
|
||||
|
||||
%btn-post-nav {
|
||||
width: 50%;
|
||||
position: relative;
|
||||
|
@ -72,11 +64,23 @@ h1 + .post-meta {
|
|||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
%icon-size {
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
.share-icons {
|
||||
font-size: 1.2rem;
|
||||
display: flex;
|
||||
|
||||
i {
|
||||
color: var(--btn-share-color);
|
||||
|
||||
@extend %icon-size;
|
||||
}
|
||||
|
||||
> * {
|
||||
margin-left: 0.25rem;
|
||||
@extend %icon-size;
|
||||
|
||||
margin-left: 0.5rem;
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
|
@ -86,44 +90,29 @@ h1 + .post-meta {
|
|||
}
|
||||
|
||||
button {
|
||||
position: relative;
|
||||
bottom: 2px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
line-height: inherit;
|
||||
|
||||
@extend %cursor-pointer;
|
||||
}
|
||||
|
||||
a :hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fa-square-x-twitter {
|
||||
@include btn-sharing-color(black);
|
||||
}
|
||||
|
||||
.fa-facebook-square {
|
||||
@include btn-sharing-color(rgb(66, 95, 156));
|
||||
}
|
||||
|
||||
.fa-telegram {
|
||||
@include btn-sharing-color(rgb(39, 159, 217));
|
||||
}
|
||||
|
||||
.fa-linkedin {
|
||||
@include btn-sharing-color(rgb(0, 119, 181));
|
||||
}
|
||||
|
||||
.fa-weibo {
|
||||
@include btn-sharing-color(rgb(229, 20, 43));
|
||||
}
|
||||
} /* .share-icons */
|
||||
|
||||
.fas.fa-link {
|
||||
@include btn-sharing-color(rgb(171, 171, 171));
|
||||
}
|
||||
} /* .share-wrapper */
|
||||
}
|
||||
|
||||
.share-mastodon {
|
||||
/* See: https://github.com/justinribeiro/share-to-mastodon#properties */
|
||||
--wc-stm-font-family: $font-family-base;
|
||||
--wc-stm-dialog-background-color: var(--card-bg);
|
||||
--wc-stm-form-button-border: 1px solid var(--btn-border-color);
|
||||
--wc-stm-form-submit-background-color: var(--sidebar-btn-bg);
|
||||
--wc-stm-form-cancel-background-color: var(--sidebar-btn-bg);
|
||||
--wc-stm-form-button-background-color-hover: #007bff;
|
||||
--wc-stm-form-button-color-hover: white;
|
||||
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.post-tags {
|
||||
line-height: 2rem;
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 6e3fa734685f099195b02da912ffa25c04913e41
|
||||
Subproject commit 97d95fdb5ed9c445a372d110776fc354beff6128
|
|
@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|||
spec.authors = ["Cotes Chung"]
|
||||
spec.email = ["cotes.chung@gmail.com"]
|
||||
|
||||
spec.summary = "A minimal, responsive and feature-rich Jekyll theme for technical writing."
|
||||
spec.summary = "A minimal, responsive, and feature-rich Jekyll theme for technical writing."
|
||||
spec.homepage = "https://github.com/cotes2020/jekyll-theme-chirpy"
|
||||
spec.license = "MIT"
|
||||
|
||||
|
@ -23,12 +23,12 @@ Gem::Specification.new do |spec|
|
|||
"plugin_type" => "theme"
|
||||
}
|
||||
|
||||
spec.required_ruby_version = ">= 2.6"
|
||||
spec.required_ruby_version = ">= 3.0"
|
||||
|
||||
spec.add_runtime_dependency "jekyll", "~> 4.3"
|
||||
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
|
||||
spec.add_runtime_dependency "jekyll-redirect-from", "~> 0.16"
|
||||
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.7"
|
||||
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.8"
|
||||
spec.add_runtime_dependency "jekyll-archives", "~> 2.2"
|
||||
spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4"
|
||||
spec.add_runtime_dependency "jekyll-include-cache", "~> 0.2"
|
||||
|
|
89
package.json
89
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "jekyll-theme-chirpy",
|
||||
"version": "6.2.3",
|
||||
"description": "A minimal, responsive and feature-rich Jekyll theme for technical writing.",
|
||||
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cotes2020/jekyll-theme-chirpy.git"
|
||||
|
@ -21,15 +21,86 @@
|
|||
"fixlint": "npm run test -- --fix"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.0",
|
||||
"@babel/core": "^7.23.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/preset-env": "^7.22.20",
|
||||
"@rollup/plugin-babel": "^6.0.3",
|
||||
"@rollup/plugin-terser": "^0.4.3",
|
||||
"@babel/preset-env": "^7.23.2",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"rimraf": "^5.0.5",
|
||||
"rollup": "^3.29.4",
|
||||
"rollup-plugin-license": "^3.1.0",
|
||||
"stylelint": "^15.10.3",
|
||||
"stylelint-config-standard-scss": "^11.0.0"
|
||||
"rollup": "^4.3.0",
|
||||
"rollup-plugin-license": "^3.2.0",
|
||||
"stylelint": "^15.11.0",
|
||||
"stylelint-config-standard-scss": "^11.1.0"
|
||||
},
|
||||
"prettier": {
|
||||
"trailingComma": "none"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
"> 0.2%",
|
||||
"not dead"
|
||||
],
|
||||
"commitlint": {
|
||||
"rules": {
|
||||
"body-max-line-length": [
|
||||
0,
|
||||
"always"
|
||||
]
|
||||
}
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": "stylelint-config-standard-scss",
|
||||
"rules": {
|
||||
"no-descending-specificity": null,
|
||||
"shorthand-property-no-redundant-values": null,
|
||||
"at-rule-no-vendor-prefix": null,
|
||||
"property-no-vendor-prefix": null,
|
||||
"selector-no-vendor-prefix": null,
|
||||
"value-no-vendor-prefix": null,
|
||||
"color-function-notation": "legacy",
|
||||
"alpha-value-notation": "number",
|
||||
"selector-not-notation": "simple",
|
||||
"color-hex-length": "long",
|
||||
"declaration-block-single-line-max-declarations": 3,
|
||||
"scss/operator-no-newline-after": null,
|
||||
"rule-empty-line-before": [
|
||||
"always",
|
||||
{
|
||||
"ignore": [
|
||||
"after-comment",
|
||||
"first-nested"
|
||||
]
|
||||
}
|
||||
],
|
||||
"value-keyword-case": [
|
||||
"lower",
|
||||
{
|
||||
"ignoreProperties": [
|
||||
"/^\\$/"
|
||||
]
|
||||
}
|
||||
],
|
||||
"media-feature-range-notation": "prefix"
|
||||
}
|
||||
},
|
||||
"standard-version": {
|
||||
"skip": {
|
||||
"commit": true,
|
||||
"tag": true
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"type": "feat",
|
||||
"section": "Features"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"section": "Bug Fixes"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"section": "Improvements"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# and production branch.
|
||||
#
|
||||
#
|
||||
# Usage: run on main branch or the patch branch
|
||||
# Usage: run on the default, release or the patch branch
|
||||
#
|
||||
# Requires: Git, NPM and RubyGems
|
||||
|
||||
|
@ -18,8 +18,7 @@ opt_pre=false # preview mode option
|
|||
|
||||
working_branch="$(git branch --show-current)"
|
||||
|
||||
# AKA the default branch, main/master branch
|
||||
STAGING_BRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
|
||||
DEFAULT_BRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
|
||||
|
||||
PROD_BRANCH="production"
|
||||
|
||||
|
@ -65,15 +64,16 @@ _check_cli() {
|
|||
}
|
||||
|
||||
_check_git() {
|
||||
# ensure nothing is uncommitted
|
||||
# ensure that changes have been committed
|
||||
if [[ -n $(git status . -s) ]]; then
|
||||
echo "> Abort: Commit the staged files first, and then run this tool again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ensure the working branch is the default/patch branch
|
||||
if [[ $working_branch != "$STAGING_BRANCH" && $working_branch != hotfix/* ]]; then
|
||||
echo "> Abort: Please run on the $STAGING_BRANCH branch or a patch branche."
|
||||
if [[ $working_branch != "$DEFAULT_BRANCH" &&
|
||||
$working_branch != hotfix/* &&
|
||||
$working_branch != "$PROD_BRANCH" ]]; then
|
||||
echo "> Abort: Please run on the default, release or patch branch."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -101,14 +101,16 @@ check() {
|
|||
_check_node_packages
|
||||
}
|
||||
|
||||
# auto-generate a new version number to the file 'package.json' and
|
||||
# Auto-generate a new version number to the file 'package.json'
|
||||
bump_node() {
|
||||
bump="standard-version -i $CHANGE_LOG"
|
||||
|
||||
if $opt_pre; then
|
||||
standard-version -i "$CHANGE_LOG" -p rc
|
||||
else
|
||||
standard-version -i "$CHANGE_LOG"
|
||||
bump="$bump -p rc"
|
||||
fi
|
||||
|
||||
eval "$bump"
|
||||
|
||||
# Change heading of Patch version to heading level 2 (a bug from `standard-version`)
|
||||
sed -i "s/^### \[/## \[/g" "$CHANGE_LOG"
|
||||
# Replace multiple empty lines with a single empty line
|
||||
|
@ -117,29 +119,34 @@ bump_node() {
|
|||
|
||||
## Bump new version to gem config file
|
||||
bump_gem() {
|
||||
sed -i "s/[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/$1/" "$GEM_SPEC"
|
||||
_ver="$1"
|
||||
|
||||
if $opt_pre; then
|
||||
_ver="${1/-/.}"
|
||||
fi
|
||||
|
||||
sed -i "s/[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/$_ver/" "$GEM_SPEC"
|
||||
}
|
||||
|
||||
# Update the git branches, create a new tag, and then build the gem package.
|
||||
release() {
|
||||
# Creates a new tag on the production branch with the given version number.
|
||||
# Also commits the changes and merges the production branch into the default branch.
|
||||
branch() {
|
||||
_version="$1" # X.Y.Z
|
||||
_latest_commit="$(git rev-parse HEAD)"
|
||||
|
||||
git add .
|
||||
git commit -m "chore(release): $_version"
|
||||
|
||||
# Create a new tag on production branch
|
||||
echo -e "> Create tag v$_version\n"
|
||||
git tag "v$_version"
|
||||
|
||||
git checkout "$STAGING_BRANCH"
|
||||
git checkout "$DEFAULT_BRANCH"
|
||||
git merge --no-ff --no-edit "$PROD_BRANCH"
|
||||
|
||||
if [[ $working_branch == hotfix/* ]]; then
|
||||
git merge --no-ff --no-edit "$working_branch"
|
||||
# delete the patch branch
|
||||
git branch -D "$working_branch"
|
||||
fi
|
||||
|
||||
# cherry-pick the latest commit from production branch to default branch
|
||||
git cherry-pick "$_latest_commit"
|
||||
|
||||
}
|
||||
|
||||
## Build a gem package
|
||||
|
@ -164,7 +171,7 @@ build_gem() {
|
|||
main() {
|
||||
check
|
||||
|
||||
if [[ $opt_pre = false ]]; then
|
||||
if [[ $opt_pre = false && $working_branch != "$PROD_BRANCH" ]]; then
|
||||
git checkout "$PROD_BRANCH"
|
||||
git merge --no-ff --no-edit "$working_branch"
|
||||
fi
|
||||
|
@ -175,16 +182,12 @@ main() {
|
|||
|
||||
bump_gem "$_version"
|
||||
|
||||
echo -e "> Build the gem package for v$_version\n"
|
||||
|
||||
if [[ $opt_pre = false ]]; then
|
||||
echo -e "> Bumped version number to $_version\n"
|
||||
git add .
|
||||
git commit -m "chore(release): $_version"
|
||||
|
||||
release "$_version"
|
||||
branch "$_version"
|
||||
fi
|
||||
|
||||
echo -e "> Build the gem package for v$_version\n"
|
||||
|
||||
build_gem
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue