-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 2.12 KB
/
Copy pathbump.yaml
File metadata and controls
74 lines (69 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Bump
on:
push:
branches:
- pre
- main
permissions:
contents: write
env:
tag: ${{ github.event.head_commit.id }}
jobs:
bump:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 安装依赖
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -fsSL \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'user-agent: GitOK-Release-Workflow' \
https://raw.githubusercontent.com/nookery/servon/main/install.sh | bash
- name: 更新版本号
run: servon xcode bump
- name: 更新构建号
uses: yanamura/ios-bump-version@v1
- name: 生成标签(pre 分支)
if: github.ref == 'refs/heads/pre'
run: |
version=$(bash .github/scripts/get-version.sh)
echo "版本号->$version"
build=$(agvtool what-version -terse)
echo "tag=p$version($build)" >> $GITHUB_ENV
- name: 生成标签(main 分支)
if: github.ref == 'refs/heads/main'
run: |
version=$(bash .github/scripts/get-version.sh)
echo "版本号->$version"
# build=$(agvtool what-version -terse)
echo "tag=v$version" >> $GITHUB_ENV
- name: 打标签并推送到仓库
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "ci: bump a new version"
commit_user_name: GitHub Action
tagging_message: ${{ env.tag }}
push_options: "--tags"
branch: ${{ github.ref_name }}
rebase:
if: github.ref == 'refs/heads/main'
needs:
- bump
runs-on: ubuntu-latest
steps:
- name: 拉取 pre 分支
uses: actions/checkout@v3
with:
ref: pre
- name: 拉取 main 分支
run: git fetch origin main
- name: Rebase pre on main
continue-on-error: true
run: git rebase origin/main
- name: Push the rebased pre branch
continue-on-error: true
run: git push origin pre