Skip to content

Commit

Permalink
Update beta_ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KoolShow authored Apr 28, 2024
1 parent cd3af3a commit 41241be
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/beta_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@ jobs:
ref: ${{ github.ref_name }}
fetch-depth: 0

- name: 获取first parent commit次数
id: get-first-parent-commit-count
run: |
version=$(yq e .version pubspec.yaml | cut -d "+" -f 1)
recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true)
if [[ "x$recent_release_tag" == "x" ]]; then
echo "当前版本tag不存在,请手动生成tag."
exit 1
fi
git log --oneline --first-parent $recent_release_tag..HEAD
first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD)
echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT
- name: 获取最后一次提交
id: get-last-commit
run: |
last_commit=$(git log -1 --pretty="%h %s" --first-parent)
echo "last_commit=$last_commit" >> $GITHUB_OUTPUT
- name: 更新版本号
id: version
run: |
Expand All @@ -58,8 +39,7 @@ jobs:
#RUN_NUMBER=${{ github.run_number }}
# 构建新版本号
NEW_VERSION=$VERSION-beta.${{ steps.get-first-parent-commit-count.outputs.count }}
NEW_VERSION=${{ github.run_number }}
# 输出新版本号
echo "New version: $NEW_VERSION"
Expand Down

0 comments on commit 41241be

Please sign in to comment.