diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02fbb37d57..b6b9877a13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - id: set_tag run: | ${{ startsWith(github.ref, 'refs/pull/') && 'cd temp' || '' }} - echo tag=$(git describe --tags ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT + echo tag=$(git describe --tags --match "v*" ${{ github.ref }} || git rev-parse --short HEAD) | tee -a $GITHUB_OUTPUT exit ${PIPESTATUS[0]} - id: set_pre @@ -65,9 +65,9 @@ jobs: run: | this_tag=${{ steps.set_tag.outputs.tag }} if [[ '${{ steps.set_pre.outputs.prerelease }}' != 'false' ]]; then - last_tag=$(git describe --tags --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}') + last_tag=$(git describe --tags --match "v*" --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}') else - last_tag=$(git describe --tags --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}' --exclude='*-*') + last_tag=$(git describe --tags --match "v*" --abbrev=0 --exclude='${{ steps.set_tag.outputs.tag }}' --exclude='*-*') fi echo >> CHANGELOG.md echo "**Full Changelog**: [$last_tag -> $this_tag](https://github.com/MaaAssistantArknights/MaaAssistantArknights/compare/${last_tag}...${this_tag})" >> CHANGELOG.md diff --git a/resource/copilot/SSS_约翰老妈在建地块_浊蒂水陈版.json b/resource/copilot/SSS_约翰老妈在建地块_浊蒂水陈版.json new file mode 100644 index 0000000000..ff5bcdee56 --- /dev/null +++ b/resource/copilot/SSS_约翰老妈在建地块_浊蒂水陈版.json @@ -0,0 +1,1211 @@ +{ + "type": "SSS", + "stage_name": "约翰老妈在建地块", + "minimum_required": "v4.9.0", + "doc": { + "title": "保全约翰老妈在建地块——澄闪塞雷娅泥岩斥罪浊心斯卡蒂假日威龙陈", + "title_color": "dark", + "details": "作者:DL_君逸寒\n演示视频:BV1Rs4y1g7Dq\n你们的肝!我来守护!!!\n所以,一键三连,欧内盖!!!\n你们的支持,就是我创作和维护的动力!!!\n\n\n该脚本适合坐拥黄金大队不缺核心干员的博士\n\n\n由于先锋需站场接敌,建议带能主动回费的精二以上的挡二先锋!其他分支除“3技能的风笛”外不要带!如果带推王,请在干员角色管理界面和编队里设置成1技能!\n工具人干员尽量带能打一点的!!!\n不要带小车!!!\n注意一下干员们的默认技能,比如远牙黑别带3技能\n\n可以自行点开文件参考黑名单(blacklist),再决定带哪些干员\n\n因为黑名单加的太多了,可能导致MAA在选干员的时候做不出选择,自己看着点一下影响相对小的(重装医疗近卫特种尽量不要点,因为完全就没写他们)\n\n第三关最好能拿到至少一个战备激活阀,能够很大程度降低练度要求,实测没有也能过应急难度(就是得凹,话说回来了,有没有都得凹,怎么凹不是凹啊!)\n\n普通难度稳过,但是一命通关需要一丢丢运气,4要早出泥岩,5要早出斥罪,6三个盾都得早点出(我真的尽力了!)\n\n应急难度不要求一命通关,放着让他自己多循环几次就好了\n\n导能原件选第二个:能量扰动放大器\n战术装备:术士B,其余都选A\n\n脚本思路参考:\n历经数百次败北,自己摸出来的!\n\n温馨提示:保全有三个蚀刻章,获得条件分别是通过普通难度、不重开通过普通难度、通过应急难度,使用本作业时建议只打通一次应急难度,刷材料使用普通难度。", + "details_color": "dark" + }, + "buff": "能量扰动放大器", + "equipment": [ + "A", + "B", + "A", + "A", + "A", + "A", + "A", + "A" + ], + "strategy": "优选策略", + "opers": [ + { + "name": "塞雷娅", + "skill": 1, + "skill_usage": 0 + }, + { + "name": "斥罪", + "skill": 3, + "skill_usage": 1 + }, + { + "name": "泥岩", + "skill": 2, + "skill_usage": 0 + }, + { + "name": "假日威龙陈", + "skill": 3, + "skill_usage": 0 + }, + { + "name": "澄闪", + "skill": 2, + "skill_usage": 0 + }, + { + "name": "浊心斯卡蒂", + "skill": 2, + "skill_usage": 0 + } + ], + "tool_men": { + "先锋": 6, + "重装": 0, + "狙击": 4, + "术士": 4 + }, + "drops": [ + "无需增调干员", + "狙击", + "先锋", + "术士", + "辅助", + "战备激活阀", + "异态激化插件" + ], + "blacklist": [ + "豆苗", + "夜半", + "伺夜", + "缪尔赛思", + "桃金娘", + "极境", + "琴柳", + "伊内丝", + "晓歌", + "野鬃", + "苇草", + "格拉尼", + "谜图", + "红豆", + "芬", + "香草", + "翎羽", + "夜刀", + "山", + "重岳", + "玛恩纳", + "龙舌兰", + "斯卡蒂", + "赫拉格", + "耀骑士临光", + "史尔特尔", + "阿米娅", + "因陀罗", + "星极", + "芙兰卡", + "赤冬", + "达格达", + "海沫", + "火龙S黑角", + "摩根", + "燧石", + "炎客", + "羽毛笔", + "铸铁", + "断罪者", + "宴", + "缠丸", + "杰克", + "猎蜂", + "慕斯", + "休谟斯", + "罗小黑", + "玫兰莎", + "Castle-3", + "瑕光", + "森蚺", + "极光", + "洋灰", + "火神", + "菲亚梅塔", + "送葬人", + "奥斯塔", + "松果", + "早露", + "熔泉", + "埃拉托", + "铅踝", + "普罗旺斯", + "酸糖", + "正义骑士号", + "泰拉大陆调查团", + "伊芙利特", + "蚀清", + "凯尔希", + "焰影苇草", + "濯尘芙蓉", + "Lancet-2", + "U-Official", + "傀影", + "缄默德克萨斯", + "麒麟X夜刀", + "老鲤", + "多萝西", + "阿", + "乌有", + "红", + "槐琥", + "卡夫卡", + "霜华", + "罗宾", + "砾", + "孑", + "THRM-EX" + ], + "stages": [ + { + "stage_name": "知难而进", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 7, + 1 + ], + "direction": "Down" + }, + { + "core": "斥罪", + "tool_men": { + "先锋": 1, + "重装": 1 + }, + "location": [ + 7, + 3 + ], + "direction": "Down" + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 2 + }, + "location": [ + 7, + 2 + ], + "direction": "Down" + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 2 + }, + "location": [ + 7, + 1 + ], + "direction": "Down" + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 7, + 5 + ], + "direction": "None", + "kills": 15 + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 1, + 5 + ], + "direction": "None", + "costs": 60 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 2, + 5 + ], + "direction": "None", + "costs": 65 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 3, + 5 + ], + "direction": "None", + "costs": 70 + } + ], + "retry_times": 9 + }, + { + "stage_name": "荒地的手段", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 4, + 2 + ], + "direction": "Right" + }, + { + "core": "塞雷娅", + "tool_men": { + "先锋": 1 + }, + "location": [ + 5, + 2 + ], + "direction": "Right" + }, + { + "tool_men": { + "辅助": 2 + }, + "location": [ + 4, + 2 + ], + "direction": "Right" + }, + { + "tool_men": { + "术士": 1 + }, + "location": [ + 4, + 2 + ], + "direction": "Right" + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 3 + }, + "location": [ + 5, + 3 + ], + "direction": "Right" + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 1 + }, + "location": [ + 5, + 4 + ], + "direction": "Right" + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 1, + "先锋": 2 + }, + "location": [ + 4, + 4 + ], + "direction": "Right" + }, + { + "tool_men": { + "术士": 1 + }, + "location": [ + 4, + 2 + ], + "direction": "Right" + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 6, + 2 + ], + "direction": "None", + "kills": 20 + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 8, + 4 + ], + "direction": "None", + "costs": 60 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 8, + 5 + ], + "direction": "None", + "costs": 65 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 7, + 5 + ], + "direction": "None", + "costs": 70 + } + ], + "retry_times": 9 + }, + { + "stage_name": "麻木前行", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 5, + 2 + ], + "direction": "Left" + }, + { + "core": "假日威龙陈", + "tool_men": { + "先锋": 2, + "术士": 1 + }, + "location": [ + 6, + 2 + ], + "direction": "Left" + }, + { + "core": "塞雷娅", + "tool_men": { + "先锋": 0 + }, + "location": [ + 5, + 2 + ], + "direction": "Left" + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 3 + }, + "location": [ + 7, + 2 + ], + "direction": "Left" + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 0 + }, + "location": [ + 5, + 2 + ], + "direction": "Left" + }, + { + "core": "斥罪", + "tool_men": { + "先锋": 0 + }, + "location": [ + 5, + 2 + ], + "direction": "Left" + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 2, + "先锋": 1 + }, + "location": [ + 8, + 2 + ], + "direction": "Left" + }, + { + "tool_men": { + "辅助": 5 + }, + "location": [ + 8, + 1 + ], + "direction": "Left" + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 4, + 2 + ], + "direction": "None", + "kills": 10 + }, + { + "core": "战备激活阀", + "tool_men": { + "狙击": 0 + }, + "location": [ + 6, + 3 + ], + "direction": "Up", + "kills": 15 + }, + { + "tool_men": { + "狙击": 2 + }, + "location": [ + 8, + 1 + ], + "direction": "Left" + }, + { + "tool_men": { + "术士": 3 + }, + "location": [ + 8, + 1 + ], + "direction": "Left" + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 3, + 6 + ], + "direction": "None", + "costs": 60 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 4, + 6 + ], + "direction": "None", + "costs": 65 + }, + { + "type": "Deploy", + "name": "战备激活阀", + "location": [ + 5, + 3 + ], + "direction": "Up", + "kills": 45 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 5, + 6 + ], + "direction": "None", + "costs": 70 + } + ], + "retry_times": 9 + }, + { + "stage_name": "混乱“派对”", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 3, + 2 + ], + "direction": "Right" + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 1 + }, + "location": [ + 3, + 2 + ], + "direction": "Right", + "kills": 2 + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 3, + "术士": 2 + }, + "location": [ + 3, + 1 + ], + "direction": "Down", + "kills": 3 + }, + { + "core": "斥罪", + "tool_men": { + "先锋": 1 + }, + "location": [ + 1, + 3 + ], + "direction": "Right", + "kills": 7 + }, + { + "core": "塞雷娅", + "tool_men": { + "先锋": 0 + }, + "location": [ + 1, + 3 + ], + "direction": "Right", + "kills": 11 + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 4, + 3 + ], + "direction": "None", + "kills": 13 + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 2 + }, + "location": [ + 2, + 2 + ], + "direction": "Right", + "kills": 18 + }, + { + "tool_men": { + "辅助": 5 + }, + "location": [ + 1, + 2 + ], + "direction": "Right", + "kills": 20 + }, + { + "core": "战备激活阀", + "tool_men": { + "狙击": 0 + }, + "location": [ + 3, + 3 + ], + "direction": "Up", + "kills": 25 + }, + { + "tool_men": { + "先锋": 2 + }, + "location": [ + 1, + 2 + ], + "direction": "Right", + "kills": 30 + }, + { + "tool_men": { + "狙击": 2 + }, + "location": [ + 1, + 2 + ], + "direction": "Right", + "kills": 30 + }, + { + "tool_men": { + "术士": 3 + }, + "location": [ + 1, + 2 + ], + "direction": "Right", + "kills": 30 + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 7, + 1 + ], + "direction": "None", + "costs": 60 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 6, + 1 + ], + "direction": "None", + "costs": 65 + }, + { + "type": "Deploy", + "name": "战备激活阀", + "location": [ + 2, + 3 + ], + "direction": "Right", + "kills": 15 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 5, + 1 + ], + "direction": "None", + "costs": 70 + } + ], + "retry_times": 9 + }, + { + "stage_name": "消息传递", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 6, + 3 + ], + "direction": "Left" + }, + { + "core": "斥罪", + "tool_men": { + "先锋": 1 + }, + "location": [ + 5, + 3 + ], + "direction": "Up" + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 1 + }, + "location": [ + 6, + 3 + ], + "direction": "Left" + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 4, + 3 + ], + "direction": "None", + "kills": 9 + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 2 + }, + "location": [ + 4, + 2 + ], + "direction": "Right", + "kills": 11 + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 3 + }, + "location": [ + 4, + 4 + ], + "direction": "Right", + "kills": 11 + }, + { + "core": "假日威龙陈", + "tool_men": { + "先锋": 3, + "术士": 2 + }, + "location": [ + 3, + 2 + ], + "direction": "Right", + "kills": 15 + }, + { + "tool_men": { + "辅助": 5 + }, + "location": [ + 7, + 3 + ], + "direction": "Left", + "kills": 15 + }, + { + "core": "战备激活阀", + "tool_men": { + "狙击": 0 + }, + "location": [ + 5, + 2 + ], + "direction": "Down", + "kills": 50 + }, + { + "tool_men": { + "狙击": 2 + }, + "location": [ + 7, + 3 + ], + "direction": "Left", + "kills": 60 + }, + { + "tool_men": { + "术士": 3 + }, + "location": [ + 7, + 3 + ], + "direction": "Left", + "kills": 65 + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "斯卡蒂的海嗣", + "location": [ + 5, + 4 + ], + "direction": "None", + "kills": 13 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 3, + 5 + ], + "direction": "None", + "costs": 60 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 4, + 5 + ], + "direction": "None", + "costs": 65 + }, + { + "type": "Deploy", + "name": "战备激活阀", + "location": [ + 3, + 4 + ], + "direction": "Right", + "kills": 58 + }, + { + "type": "Deploy", + "name": "超重绝缘水泥", + "location": [ + 5, + 5 + ], + "direction": "None", + "costs": 70 + } + ], + "retry_times": 9 + }, + { + "stage_name": "力量的炫耀", + "strategies": [ + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 3, + 6 + ], + "direction": "Up" + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 0 + }, + "location": [ + 3, + 6 + ], + "direction": "Up" + }, + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 2, + 5 + ], + "direction": "Right" + }, + { + "core": "斥罪", + "tool_men": { + "先锋": 0 + }, + "location": [ + 1, + 4 + ], + "direction": "Up", + "kills": 8 + }, + { + "tool_men": { + "术士": 1 + }, + "location": [ + 1, + 6 + ], + "direction": "Right", + "kills": 6 + }, + { + "core": "塞雷娅", + "tool_men": { + "先锋": 0 + }, + "location": [ + 2, + 5 + ], + "direction": "Right", + "kills": 7 + }, + { + "tool_men": { + "狙击": 1 + }, + "location": [ + 1, + 5 + ], + "direction": "Right", + "kills": 8 + }, + { + "core": "浊心斯卡蒂", + "tool_men": { + "术士": 1 + }, + "location": [ + 1, + 6 + ], + "direction": "Right", + "kills": 9 + }, + { + "core": "能量扰动放大器", + "tool_men": { + "狙击": 0 + }, + "location": [ + 4, + 5 + ], + "direction": "None", + "kills": 10 + }, + { + "tool_men": { + "先锋": 1 + }, + "location": [ + 5, + 3 + ], + "direction": "Down", + "kills": 12 + }, + { + "core": "泥岩", + "tool_men": { + "先锋": 0 + }, + "location": [ + 3, + 6 + ], + "direction": "Up" + }, + { + "core": "澄闪", + "tool_men": { + "狙击": 3 + }, + "location": [ + 1, + 5 + ], + "direction": "Right", + "kills": 15 + }, + { + "core": "假日威龙陈", + "tool_men": { + "术士": 2, + "先锋": 2 + }, + "location": [ + 5, + 3 + ], + "direction": "Down", + "kills": 15 + }, + { + "tool_men": { + "辅助": 8 + }, + "location": [ + 3, + 3 + ], + "direction": "Left", + "kills": 40 + }, + { + "core": "战备激活阀", + "tool_men": { + "狙击": 0 + }, + "location": [ + 3, + 5 + ], + "direction": "Left", + "kills": 36 + }, + { + "tool_men": { + "术士": 5 + }, + "location": [ + 3, + 3 + ], + "direction": "Left", + "kills": 55 + } + ], + "draw_as_possible": true, + "actions": [ + { + "type": "二倍速" + }, + { + "type": "SkillUsage", + "name": "斥罪", + "skill_usage": 1 + }, + { + "type": "Deploy", + "name": "战备激活阀", + "location": [ + 1, + 3 + ], + "direction": "Down", + "kills": 40 + }, + { + "type": "Skill", + "name": "假日威龙陈", + "kills": 56 + }, + { + "type": "Deploy", + "name": "斯卡蒂的海嗣", + "location": [ + 4, + 2 + ], + "direction": "None", + "kills": 58 + } + ], + "retry_times": 18 + } + ] +} diff --git a/tools/ChangelogGenerator/changelog_generator.py b/tools/ChangelogGenerator/changelog_generator.py index 9bd76cf269..1c1587914d 100644 --- a/tools/ChangelogGenerator/changelog_generator.py +++ b/tools/ChangelogGenerator/changelog_generator.py @@ -211,10 +211,10 @@ def main(tag_name=None, latest=None): pass # 从哪个 tag 开始 if latest == None: - latest = os.popen("git describe --abbrev=0 --tags").read().strip() + latest = os.popen("git describe --tags --match 'v*' --abbrev=0").read().strip() if tag_name == None: - tag_name = os.popen("git describe --tags").read().strip() + tag_name = os.popen("git describe --tags --match 'v*'").read().strip() print("From:", latest, ", To:", tag_name, "\n") # 输出一张好看的 git log 图到控制台 diff --git a/tools/MaaBuilder/Builder/BuildParameters.cs b/tools/MaaBuilder/Builder/BuildParameters.cs index a55fd89f78..0001c697b3 100644 --- a/tools/MaaBuilder/Builder/BuildParameters.cs +++ b/tools/MaaBuilder/Builder/BuildParameters.cs @@ -17,6 +17,7 @@ using System.Text.RegularExpressions; using MaaBuilder.Models; using static Nuke.Common.Tools.VSWhere.VSWhereTasks; using Nuke.Common.Tools.MSBuild; +using Nuke.Common.Utilities.Collections; namespace MaaBuilder; @@ -169,12 +170,12 @@ public partial class Build if (b.GitHubActions.Ref.StartsWith(ReleaseTagRefPrefix)) { var tag = $"v{b.GitHubActions.Ref.Replace(ReleaseTagRefPrefix, "")}"; - var pattern = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; + var pattern = @"^v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; var match = Regex.Match(tag, pattern); if (match.Success) { GhTag = tag; - var preReleasePattern = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))(-)"; + var preReleasePattern = @"^v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))(-)"; var preReleaseMatch = Regex.Match(tag, preReleasePattern); IsPreRelease = preReleaseMatch.Success; } @@ -198,8 +199,9 @@ public partial class Build } var ghEvent = b.GitHubActions.GitHubEvent; + Log.Information("GitHub Event:{Event}", ghEvent.ToString()); - if (ghEvent.ContainsKey("inputs")) + if (ghEvent.ContainsKey("inputs") && !ghEvent["inputs"].IsNullOrEmpty()) { IsWorkflowDispatch = true; diff --git a/tools/MaaBuilder/Builder/Job/Build.Job.Version.cs b/tools/MaaBuilder/Builder/Job/Build.Job.Version.cs index 33eb47449f..dd4c1207fd 100644 --- a/tools/MaaBuilder/Builder/Job/Build.Job.Version.cs +++ b/tools/MaaBuilder/Builder/Job/Build.Job.Version.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using Nuke.Common; using Nuke.Common.Git; @@ -10,18 +10,18 @@ namespace MaaBuilder; public partial class Build { - Target UseRsVersion => _ => _ + private Target UseRsVersion => _ => _ .Triggers(SetVersion) .Executes(() => { Information($"Release Simulation: {Parameters.GhActionWdRsTagName}"); - + Version = Parameters.GhActionWdRsTagName; GitHubTasks.GitHubClient = new GitHubClient(new ProductHeaderValue(nameof(NukeBuild))); }); - - Target UseCommitVersion => _ => _ + + private Target UseCommitVersion => _ => _ .Triggers(SetVersion) .Executes(() => { @@ -29,7 +29,7 @@ public partial class Build Version = !envReleaseTag.IsNullOrEmpty() ? envReleaseTag : $"{Parameters.BuildTime}-{Parameters.CommitHash}"; }); - Target UseTagVersion => _ => _ + private Target UseTagVersion => _ => _ .Triggers(SetVersion) .Executes(() => { @@ -39,8 +39,8 @@ public partial class Build var repo = GitRepository.FromLocalDirectory(RootDirectory); Assert.True(repo is not null, "不在 Git Repo 中"); - - var tag = repo.Tags.FirstOrDefault(); + + var tag = repo.Tags.ToList().Find(v => v.StartsWith("v")); if (tag is not null) { @@ -63,12 +63,12 @@ public partial class Build }; LatestTag = Parameters.IsPreRelease ? GetLatestTag() : GetLatestReleaseTag(); - + Version = Parameters.GhTag; } }); - Target SetVersion => _ => _ + private Target SetVersion => _ => _ .Executes(() => { Information($"当前版本号设置为:{Version}"); diff --git a/tools/version.sh b/tools/version.sh index d3610e1d10..b392d8a210 100644 --- a/tools/version.sh +++ b/tools/version.sh @@ -4,7 +4,7 @@ LatestTagId=$(git rev-list --tags --max-count=1 --abbrev-commit) LatestCommitId=$(git rev-list --all --max-count=1 --abbrev-commit) if [ $LatestTagId = $LatestCommitId ]; then - Version=$(git describe --tags $LatestTagId) + Version=$(git describe --tags --match "v*" $LatestTagId) else Version="c""$LatestCommitId" fi