This commit is contained in:
parent
0782130be5
commit
4b5f7434a6
@ -9,15 +9,19 @@ jobs:
|
|||||||
create-readme:
|
create-readme:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
if: "!contains(github.event.head_commit.message, 'ActionPush')"
|
if: "contains(github.event.head_commit.message, 'Release')"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 安装 GitHub CLI
|
- name: 安装 tea 工具
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
# 添加 Gitea 官方的 apt 仓库
|
||||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
sudo tee /etc/apt/sources.list.d/gitea.list <<EOF
|
||||||
sudo apt update
|
deb [trusted=yes] https://dl.gitea.io/tea/debian/ /
|
||||||
sudo apt install gh
|
EOF
|
||||||
|
# 更新 apt 缓存
|
||||||
|
sudo apt-get update
|
||||||
|
# 安装 tea 工具
|
||||||
|
sudo apt-get install -y tea
|
||||||
|
|
||||||
- name: 删除本地仓库副本
|
- name: 删除本地仓库副本
|
||||||
env:
|
env:
|
||||||
@ -40,30 +44,3 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name "${{ github.actor }}"
|
git config user.name "${{ github.actor }}"
|
||||||
git config user.email "${{ github.actor }}@users.noreply.git.linuxacme.com"
|
git config user.email "${{ github.actor }}@users.noreply.git.linuxacme.com"
|
||||||
|
|
||||||
- name: 生成版本号
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
# 获取最新的 tag
|
|
||||||
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
|
||||||
# 解析主版本号、次版本号和修订号
|
|
||||||
major=$(echo $latest_tag | cut -d. -f1 | tr -d 'v')
|
|
||||||
minor=$(echo $latest_tag | cut -d. -f2)
|
|
||||||
patch=$(echo $latest_tag | cut -d. -f3)
|
|
||||||
# 增加修订号
|
|
||||||
new_patch=$((patch + 1))
|
|
||||||
new_version="v$major.$minor.$new_patch"
|
|
||||||
echo "::set-output name=version::$new_version"
|
|
||||||
|
|
||||||
- name: 创建新的 tag
|
|
||||||
run: |
|
|
||||||
git tag ${{ steps.version.outputs.version }}
|
|
||||||
git push origin ${{ steps.version.outputs.version }}
|
|
||||||
|
|
||||||
- name: 创建 Release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.AUTOGENERATE }}
|
|
||||||
run: |
|
|
||||||
gh release create ${{ steps.version.outputs.version }} \
|
|
||||||
--title "${{ steps.version.outputs.version }} Release" \
|
|
||||||
--notes "Automatically generated release for version ${{ steps.version.outputs.version }}"
|
|
Loading…
Reference in New Issue
Block a user