Skip to content

Commit 6d67cbb

Browse files
committed
fix(ci): 将 tag 创建移到所有操作完成后
确保 tag 指向最终的 commit,而不是中间状态。
1 parent 99e337c commit 6d67cbb

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,6 @@ jobs:
7474
git add Version.props CHANGELOG.md
7575
git commit -m "chore(release): ${{ steps.version.outputs.version }}"
7676
77-
- name: Create tag
78-
if: steps.check.outputs.need_release == 'true'
79-
run: |
80-
git tag ${{ steps.version.outputs.version }}
81-
82-
- name: Create GitHub Release
83-
if: steps.check.outputs.need_release == 'true'
84-
uses: softprops/action-gh-release@v2
85-
with:
86-
tag_name: ${{ steps.version.outputs.version }}
87-
body_path: CHANGELOG.md
88-
env:
89-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90-
9177
- name: Build
9278
if: steps.check.outputs.need_release == 'true'
9379
run: dotnet build --configuration Release
@@ -102,4 +88,16 @@ jobs:
10288

10389
- name: Push changes
10490
if: steps.check.outputs.need_release == 'true'
105-
run: git push origin main
91+
run: |
92+
git push origin main
93+
git tag ${{ steps.version.outputs.version }}
94+
git push origin ${{ steps.version.outputs.version }}
95+
96+
- name: Create GitHub Release
97+
if: steps.check.outputs.need_release == 'true'
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
tag_name: ${{ steps.version.outputs.version }}
101+
body_path: CHANGELOG.md
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)