Skip to content

Commit 613b270

Browse files
committed
ci: 🤖 新增一个测试工作流
1 parent 678ac0c commit 613b270

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/push-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch: # 允许手动触发
8+
push:
9+
branches:
10+
- main # 监听 main 分支
11+
12+
jobs:
13+
build:
14+
name: test
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: 检出代码
19+
uses: actions/checkout@v4
20+
21+
- name: 获取当前和上一个标签
22+
id: get_tags
23+
run: |
24+
git fetch --prune --unshallow
25+
git tag -l --sort=-version:refnam
26+
tags=($(git tag -l --sort=-version:refname))
27+
current_tag=${tags[0]}
28+
previous_tag=${tags[1]}
29+
echo "previous_tag=$previous_tag" >> $GITHUB_OUTPUT
30+
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)