更新 Gitea 发布工作流,添加变更日志生成步骤并修正运行环境
Some checks failed
Release to Liteyuki Gitea / release (push) Successful in 6s
Publish to Liteyuki PyPI / Upload release to PyPI (push) Failing after 13s

This commit is contained in:
2025-04-29 00:31:28 +08:00
parent a8169542c4
commit 748751165c
2 changed files with 40 additions and 14 deletions

View File

@ -0,0 +1,13 @@
name: Changelog
on:
release:
types:
- created
jobs:
changelog:
runs-on: liteyukios-latest
steps:
- name: "✏️ Generate release changelog"
uses: janheinrichmerker/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -7,15 +7,28 @@ on:
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: liteyukios-latest
steps:
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release steps:
uses: mikepenz/action-gh-release@v0.2.0-a03 # 检出代码
with: - name: Checkout code
body: ${{steps.github_release.outputs.changelog}} uses: actions/checkout@v3
# 创建 Gitea Release
- name: Create Gitea Release
env:
GITEA_TOKEN: ${{ secrets.LITEYUKI_GITEA_TOKEN }}
GITEA_API_URL: https://git.liteyuki.icu/api/v1 # 替换为你的 Gitea API 地址
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
curl -X POST "$GITEA_API_URL/repos/<owner>/<repo>/releases" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG_NAME"'",
"target_commitish": "main",
"name": "'"$TAG_NAME"'",
"body": "'"${{ steps.changelog.outputs.changelog }}"'",
"draft": false,
"prerelease": false
}'