From f5db1102ce82fe29b9bf7d395199b449562d5bee Mon Sep 17 00:00:00 2001 From: zjx0905 <954270063@qq.com> Date: Wed, 26 Apr 2023 09:57:28 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs.yml | 2 ++ .github/workflows/release.yml | 2 +- scripts/releaselog.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f9bffdc..d9bb029 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,6 +2,8 @@ name: Deploy Docs on: push: + tags: + - v* branches: - docs workflow_dispatch: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcab292..4d5bbe9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + name: Release ${{ github.ref }} prerelease: ${{ steps.prerelease.outputs.result }} body_path: 'RELEASELOG.md' files: 'dist/**.zip' diff --git a/scripts/releaselog.ts b/scripts/releaselog.ts index 40380a2..783c001 100644 --- a/scripts/releaselog.ts +++ b/scripts/releaselog.ts @@ -5,7 +5,7 @@ import { getPkgJSON, resolve } from './utils'; const changelogPath = resolve('CHANGELOG.md'); const releaselogPath = resolve('RELEASELOG.md'); const { version } = getPkgJSON(); -const versionRE = new RegExp(`^# \\[?${version}\\]?[ (]`); +const versionRE = new RegExp(`^#{1,2} \\[?${version}\\]?\\(?`); main(); @@ -17,7 +17,7 @@ async function main() { let releaselog = ''; for await (const line of changelog) { - if (line.startsWith('# ') && !versionRE.test(line)) { + if (/^#{1,2} /.test(line) && !versionRE.test(line)) { break; } releaselog += `${line}\n`;