shell
This commit is contained in:
parent
bddf926701
commit
90adcf0c5b
|
@ -2,7 +2,7 @@ name: npm-publish
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- npm
|
||||
jobs:
|
||||
npm-publish:
|
||||
name: npm-publish
|
||||
|
|
10
_config.yml
10
_config.yml
|
@ -1,11 +1,11 @@
|
|||
######## Stellar info ########
|
||||
stellar:
|
||||
version: '1.0.0-rc.1' # This is theme's version.
|
||||
homepage: https://xaoxuu.com/wiki/stellar/
|
||||
repo: https://github.com/xaoxuu/hexo-theme-stellar
|
||||
version: '1.0.0-rc.1'
|
||||
homepage: 'https://xaoxuu.com/wiki/stellar/'
|
||||
repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
|
||||
# The cdn version needs to be consistent with the stellar version
|
||||
cdn_css: # https://cdn.jsdelivr.net/npm/hexo-theme-stellar@1.0/source/css/main.min.css
|
||||
cdn_js: # https://cdn.jsdelivr.net/npm/hexo-theme-stellar@1.0/source/js/main.min.js
|
||||
cdn_css: # 'https://cdn.jsdelivr.net/npm/hexo-theme-stellar@1.0/source/css/main.min.css'
|
||||
cdn_js: # 'https://cdn.jsdelivr.net/npm/hexo-theme-stellar@1.0/source/js/main.min.js'
|
||||
|
||||
|
||||
######## head tags ########
|
||||
|
|
|
@ -14,9 +14,14 @@ VERSION=$1
|
|||
|
||||
# 替换版本号
|
||||
function prepare() {
|
||||
text="'"${VERSION}"'"" # This is theme's version."
|
||||
text="'"${VERSION}"'"
|
||||
sed -i "" "s/^ version:\([^\"]\{1,\}\)/ version: ${text}/g" '_config.yml'
|
||||
sed -i "" "s/^ \"version\":\([^,]\{1,\}\)/ \"version\": \"${VERSION}\"/g" 'package.json'
|
||||
main=${VERSION%%.*}
|
||||
sub=${VERSION#*.}
|
||||
sub=${sub%%.*}
|
||||
jsdelivr=$main'.'$sub
|
||||
sed -i "" "s/\(cdn.jsdelivr.net\/npm\/hexo-theme-stellar@[^/]\{1,\}\)/cdn.jsdelivr.net\/npm\/hexo-theme-stellar@${jsdelivr}/g" '_config.yml'
|
||||
}
|
||||
|
||||
# 提交
|
||||
|
@ -53,4 +58,4 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
prepare && commit
|
||||
prepare #&& commit
|
Loading…
Reference in New Issue