From 732e44191c85ffd10a9228dc5c8343300d13b898 Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Tue, 2 Jul 2024 00:31:58 +0800 Subject: [PATCH] 11 22 33 44 --- .gitea/workflows/release.yaml | 5 +---- resources/build.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100755 resources/build.sh diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index e85f8c2..2edf276 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -26,10 +26,7 @@ jobs: - run: cmake -S . -B build - run: cmake --build build --target all - run: build/Bilby - - run: current_tag=$(git describe --tags --abbrev=0) - - run: previous_tag=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1)) - - run: git log ${previous_tag}..${current_tag} --reverse --pretty=format:"%s" | nl -w2 -s". " > CHANGELOG.txt - - run: cat CHANGELOG.txt + - run: resources/build.sh - name: Upload Gitea Release uses: akkuman/gitea-release-action@v1 with: diff --git a/resources/build.sh b/resources/build.sh new file mode 100755 index 0000000..83a25be --- /dev/null +++ b/resources/build.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +function changelog(){ + current_tag=$(git describe --tags --abbrev=0) + previous_tag=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1)) + git log ${previous_tag}..${current_tag} --reverse --pretty=format:"%B" | nl -w2 -s". " > CHANGELOG.txt + cat CHANGELOG.txt +} + +function main() { + local cmd=$1 + shift 1 + case $cmd in + changelog) + changelog + ;; + *) + changelog + ;; + esac +} + +main $@ +