✨ 更新 Gitea 发布工作流,添加变更日志生成步骤并修正运行环境
This commit is contained in:
13
.github/workflows/liteyuki-gitea-changelog.yaml
vendored
Normal file
13
.github/workflows/liteyuki-gitea-changelog.yaml
vendored
Normal 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 }}
|
35
.github/workflows/liteyuki-gitea-release.yaml
vendored
35
.github/workflows/liteyuki-gitea-release.yaml
vendored
@ -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
|
||||||
|
}'
|
Reference in New Issue
Block a user