mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Feature/scripts (#87)
* * refactor create-release-branch.sh * * refactor rebuild.sh * * refactor update-dependencies.sh
This commit is contained in:
parent
410fe0c2fb
commit
918fed51a1
3 changed files with 23 additions and 21 deletions
|
@ -3,6 +3,8 @@
|
||||||
# - git; I believe it's already installed.
|
# - git; I believe it's already installed.
|
||||||
# - sed; GNU sed is preferred. POSIX sed may not work.
|
# - sed; GNU sed is preferred. POSIX sed may not work.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
BASE_BRANCH="develop"
|
BASE_BRANCH="develop"
|
||||||
|
|
||||||
PACKAGE_NAME="ssh-key-action"
|
PACKAGE_NAME="ssh-key-action"
|
||||||
|
@ -36,14 +38,14 @@ function main() {
|
||||||
check_version_format ${VERSION}
|
check_version_format ${VERSION}
|
||||||
check_current_branch
|
check_current_branch
|
||||||
|
|
||||||
run create_branch ${BRANCH}
|
create_branch ${BRANCH}
|
||||||
run update_changelog ${VERSION}
|
update_changelog ${VERSION}
|
||||||
run update_package_version ${VERSION}
|
update_package_version ${VERSION}
|
||||||
run update_dependencies_version
|
update_dependencies_version
|
||||||
run regenerate_package_lock
|
regenerate_package_lock
|
||||||
run build_package
|
build_package
|
||||||
run commit_changes ${VERSION}
|
commit_changes ${VERSION}
|
||||||
run finish ${VERSION} ${BRANCH} ${TAG}
|
finish ${VERSION} ${BRANCH} ${TAG}
|
||||||
}
|
}
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
|
@ -91,10 +93,6 @@ function check_current_branch() {
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
|
||||||
"$@" || exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_branch() {
|
function create_branch() {
|
||||||
local BRANCH=$1
|
local BRANCH=$1
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
rm -rf node_modules package-lock.json
|
rm -rf node_modules package-lock.json
|
||||||
npm i
|
npm i
|
||||||
npm run build
|
npm run build
|
||||||
|
|
|
@ -1,30 +1,32 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# update dependencies
|
# update dependencies
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
DATE=$(date +"%Y%m%d")
|
DATE=$(date +"%Y%m%d")
|
||||||
BRANCH=feature/update-dependencies-${DATE}
|
BRANCH=feature/update-dependencies-${DATE}
|
||||||
COLOR_SUCCESS="\e[1;32m"
|
COLOR_SUCCESS="\e[1;32m"
|
||||||
COLOR_RESET="\e[m"
|
COLOR_RESET="\e[m"
|
||||||
|
|
||||||
# create branch
|
# create branch
|
||||||
git checkout develop || exit 1
|
git checkout develop
|
||||||
git checkout -b ${BRANCH} || exit 1
|
git checkout -b ${BRANCH}
|
||||||
|
|
||||||
# check updates
|
# check updates
|
||||||
npm ci
|
npm ci
|
||||||
npm run check-updates -- -u || exit 1
|
npm run check-updates -- -u
|
||||||
|
|
||||||
# re-install packages
|
# re-install packages
|
||||||
rm -rf package-lock.json node_modules || exit 1
|
rm -rf package-lock.json node_modules
|
||||||
npm i || exit 1
|
npm i
|
||||||
|
|
||||||
# build check
|
# build check
|
||||||
npm run build || exit 1
|
npm run build
|
||||||
|
|
||||||
# commit
|
# commit
|
||||||
npm ci --only=production || exit 1
|
npm ci --only=production
|
||||||
git add package.json package-lock.json node_modules || exit 1
|
git add package.json package-lock.json node_modules
|
||||||
git commit -m "update dependencies" || exit 1
|
git commit -m "update dependencies"
|
||||||
|
|
||||||
# finished!
|
# finished!
|
||||||
echo -e "
|
echo -e "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue