From a23fbe4546eb33a2b8db38a7a1a46741a7b9d909 Mon Sep 17 00:00:00 2001 From: hi2hi Date: Tue, 10 Dec 2024 15:09:47 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=8Crelease=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-build.yml | 2 +- .github/workflows/release.yml | 31 +++++++++++++----------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 3b5035c..c176306 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57156dd..320425d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ on: jobs: build-and-release: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -25,9 +25,6 @@ jobs: with: node-version: '20' - - name: Install dependencies - run: npm install - - name: Get version from package.json id: get_version run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT @@ -41,6 +38,16 @@ jobs: echo "version=${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT fi + - name: Generate release notes + id: release_notes + run: | + echo "#### Changes" > release_notes.md + git log -10 --pretty=format:"- %s" >> release_notes.md + echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-dist.zip\n哪吒V0/nazhua/子目录需求请下载v0-nazhua.zip\nv${{ steps.determine_version.outputs.version }}-all.zip是全量包\nv${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip是jsdelivr引用版\nv${{ steps.determine_version.outputs.version }}-cdn-loli.zip是cdnjs的loli.net引用版" >> release_notes.md + + - name: Install dependencies + run: npm install + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -49,7 +56,7 @@ jobs: with: tag_name: v${{ steps.determine_version.outputs.version }} release_name: Release v${{ steps.determine_version.outputs.version }} - draft: false + draft: true prerelease: false - name: 构建自动版 - 完整引用版本 @@ -174,19 +181,7 @@ jobs: - name: Add release notes run: | - # 获取最近一次提交的变更内容 - git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s%n%b" > change.txt - - # 获取现有的发布说明 - gh release view v${{ steps.determine_version.outputs.version }} --json body -q .body > body.txt - - # 添加最近一次提交的变更内容 - echo -e "\n## 变更内容\n$(cat change.txt)" >> body.txt - - # 添加其他发布说明 - echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-dist.zip\n哪吒V0/nazhua/子目录需求请下载v0-nazhua.zip\nv${{ steps.determine_version.outputs.version }}-all.zip是全量包\nv${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip是jsdelivr引用版\nv${{ steps.determine_version.outputs.version }}-cdn-loli.zip是cdnjs的loli.net引用版" >> body.txt - # 更新发布说明 - gh release edit v${{ steps.determine_version.outputs.version }} --notes-file body.txt + gh release edit v${{ steps.determine_version.outputs.version }} --notes-file release_notes.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}