42 lines
1.2 KiB
YAML
42 lines
1.2 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: |
|
|
# 更新 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" |