From f0b73c7d8bc997504c2481de77bcd99075a7b58d Mon Sep 17 00:00:00 2001 From: Wanxp <977741432@qq.com> Date: Sun, 9 Mar 2025 13:16:20 +0800 Subject: [PATCH] =?UTF-8?q?test=20=E5=A2=9E=E5=8A=A0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-draft.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-draft.yml b/.github/workflows/release-draft.yml index d54ac3b..8e6db74 100644 --- a/.github/workflows/release-draft.yml +++ b/.github/workflows/release-draft.yml @@ -1,4 +1,3 @@ - name: Release Draft on: @@ -7,13 +6,13 @@ on: - 'manifest.json' branches: - "master" - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: contents: write pages: write id-token: write + jobs: build: runs-on: ubuntu-latest @@ -49,6 +48,20 @@ jobs: - name: Push tag run: git push origin "${{ env.VERSION }}" + - name: Generate release notes + id: generate_release_notes + uses: actions/github-script@v6 + with: + script: | + const { generateReleaseNotes } = require('@actions/github/lib/utils'); + const releaseNotes = await generateReleaseNotes({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: `v${{ env.VERSION }}`, + previous_tag_name: `v${{ env.PREVIOUS_VERSION }}` + }); + return releaseNotes.body; + - name: Create GitHub release id: create_release uses: actions/create-release@v1 @@ -59,7 +72,7 @@ jobs: release_name: "${{ env.VERSION }}" draft: true prerelease: false - body: ${{ github.event.head_commit.message }} + body: ${{ steps.generate_release_notes.outputs.result }} - name: Upload release assets uses: actions/upload-release-asset@v1 @@ -71,6 +84,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ env.VERSION }} + - name: Upload manifest.json uses: actions/upload-release-asset@v1 with: @@ -81,6 +95,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ env.VERSION }} + - name: Upload style.css uses: actions/upload-release-asset@v1 with: @@ -91,5 +106,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ env.VERSION }} + - name: Output release message run: echo "发布预发布版本${{ env.VERSION }}正常" \ No newline at end of file