1 Star 0 Fork 9

Vincent_Tian/miso-lims开源lims系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
promote_release.sh 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
set -euo pipefail
MAIN_BRANCH="develop"
# validate prerequisites
if [[ ! $(command -v gh) ]]; then
echo "Error: GitHub CLI not found"
exit 1
fi
# validate git state
if [[ ! $(git branch | grep \* | cut -d ' ' -f2) = "${MAIN_BRANCH}" ]]; then
echo "Error: Not on ${MAIN_BRANCH} branch" >&2
exit 2
fi
git fetch
if (( $(git log HEAD..origin/${MAIN_BRANCH} --oneline | wc -l) > 0 )); then
echo "Error: Branch is not up-to-date with remote origin" >&2
exit 3
fi
MISO_VERSION_OLD=$(git describe --tags --abbrev=0); export MISO_VERSION_OLD=${MISO_VERSION_OLD:1}
# Post official release to GitHub
git fetch --tags
git checkout tags/v${MISO_VERSION_OLD}
mvn clean package
pushd miso-web/src/main/resources
SETUP_FILES="setup_files.tar.gz"
tar -czf "../../../../${SETUP_FILES}" *.properties
popd
ANCHOR=$(grep "^## \[${MISO_VERSION_OLD}\]" RELEASE_NOTES.md | sed -e 's/ - /---/; s/[# \.\[]//g; s/\]//g')
gh release create v${MISO_VERSION_OLD} \
--notes "[Release Notes](https://github.com/miso-lims/miso-lims/blob/develop/RELEASE_NOTES.md#${ANCHOR})" \
miso-web/target/ROOT.war \
sqlstore/target/sqlstore-*.jar \
${SETUP_FILES}
rm ${SETUP_FILES}
echo "GitHub release v${MISO_VERSION_OLD} posted"
# Update master branch
git checkout master
git reset origin/master --hard
git rebase --onto v${MISO_VERSION_OLD} master
git push origin master
echo "Master branch updated"
echo "v${MISO_VERSION_OLD} promoted to latest official release. Copy this export into your shell before doing the Docker build:"
echo "export MISO_VERSION_OLD=${MISO_VERSION_OLD}"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/aerlee/open-lims.git
git@gitee.com:aerlee/open-lims.git
aerlee
open-lims
miso-lims开源lims系统
master

搜索帮助