This commit is contained in:
xaoxuu 2021-02-21 20:53:49 +08:00
parent bddf926701
commit 90adcf0c5b
3 changed files with 13 additions and 8 deletions

View File

@ -2,7 +2,7 @@ name: npm-publish
on: on:
push: push:
branches: branches:
- master - npm
jobs: jobs:
npm-publish: npm-publish:
name: npm-publish name: npm-publish

View File

@ -1,11 +1,11 @@
######## Stellar info ######## ######## Stellar info ########
stellar: stellar:
version: '1.0.0-rc.1' # This is theme's version. version: '1.0.0-rc.1'
homepage: https://xaoxuu.com/wiki/stellar/ homepage: 'https://xaoxuu.com/wiki/stellar/'
repo: https://github.com/xaoxuu/hexo-theme-stellar repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
# The cdn version needs to be consistent with the stellar version # 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_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_js: # 'https://cdn.jsdelivr.net/npm/hexo-theme-stellar@1.0/source/js/main.min.js'
######## head tags ######## ######## head tags ########

View File

@ -14,9 +14,14 @@ VERSION=$1
# 替换版本号 # 替换版本号
function prepare() { 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: ${text}/g" '_config.yml'
sed -i "" "s/^ \"version\":\([^,]\{1,\}\)/ \"version\": \"${VERSION}\"/g" 'package.json' 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 esac
done done
prepare && commit prepare #&& commit