ActionDemo/.gitea/workflows/AutoRelease.yaml
iorebuild 79058d3c25
Some checks failed
自动版本发布 / create-readme (push) Failing after 20s
Release
2025-04-10 11:29:05 +08:00

61 lines
2.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: 替换软件源为国内软件源
run: |
cat /etc/os-release
sudo rm -f /etc/apt/sources.list
sudo rm -f /etc/apt/sources.list.d/*
sudo tee /etc/apt/sources.list <<EOF
deb http://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
EOF
- 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"