Skip to content

Merge branch 'dev'

Merge branch 'dev' #89

Workflow file for this run

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 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 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