ActionDemo/.gitea/workflows/AutoRelease.yaml
iorebuild 4b5f7434a6
All checks were successful
自动版本发布 / create-readme (push) Has been skipped
安装tea工具
2025-04-10 11:18:13 +08:00

46 lines
1.3 KiB
YAML

name: 自动版本发布
on:
push:
branches:
- main
jobs:
create-readme:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'Release')"
steps:
- name: 安装 tea 工具
run: |
# 添加 Gitea 官方的 apt 仓库
sudo tee /etc/apt/sources.list.d/gitea.list <<EOF
deb [trusted=yes] https://dl.gitea.io/tea/debian/ /
EOF
# 更新 apt 缓存
sudo apt-get update
# 安装 tea 工具
sudo apt-get install -y tea
- name: 删除本地仓库副本
env:
REPO_NAME: ${{ github.event.repository.name }}
run: |
if [ -d "$REPO_NAME" ]; then
rm -rf "$REPO_NAME"
fi
- name: 检出仓库
env:
GITEA_TOKEN: ${{ secrets.AUTOGENERATE }}
GITEA_REPO_URL: ${{ github.server_url }}/${{ github.repository }}
CLEAN_REPO_URL: ${{ github.server_url }}/${{ github.repository }}
run: |
CLEAN_REPO_URL="${CLEAN_REPO_URL#https://}"
git clone "https://${GITEA_TOKEN}@${CLEAN_REPO_URL}" .
- name: 设置 Git 身份
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.git.linuxacme.com"