diff --git a/.github/workflows/liteyuki-gitea-changelog.yaml b/.github/workflows/liteyuki-gitea-changelog.yaml new file mode 100644 index 0000000..39542a1 --- /dev/null +++ b/.github/workflows/liteyuki-gitea-changelog.yaml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/liteyuki-gitea-release.yaml b/.github/workflows/liteyuki-gitea-release.yaml index 647da46..5f3b131 100644 --- a/.github/workflows/liteyuki-gitea-release.yaml +++ b/.github/workflows/liteyuki-gitea-release.yaml @@ -1,21 +1,34 @@ name: Release to Liteyuki Gitea on: - push: - tags: - - 'v*' + push: + tags: + - 'v*' jobs: release: - runs-on: ubuntu-latest - steps: - - name: Build Changelog - id: github_release - uses: mikepenz/release-changelog-builder-action@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: liteyukios-latest - - name: Create Release - uses: mikepenz/action-gh-release@v0.2.0-a03 - with: - body: ${{steps.github_release.outputs.changelog}} \ No newline at end of file + steps: + # 检出代码 + - name: Checkout code + 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///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 + }' \ No newline at end of file