From 15d737a64fab96ec82fae36c4789209aa9b0a1c3 Mon Sep 17 00:00:00 2001 From: a145789 <2091927351@qq.com> Date: Tue, 14 Nov 2023 18:11:18 +0800 Subject: [PATCH] ci: add release tag ci --- .github/workflows/check.yml | 9 +-------- .github/workflows/release-tag.yaml | 24 ++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/release-tag.yaml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 34ed6de..bff8879 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,13 +1,6 @@ name: CHECK -on: - push: - branches: - - main - - pull_request: - branches: - - main +on: [push, pull_request] jobs: check: diff --git a/.github/workflows/release-tag.yaml b/.github/workflows/release-tag.yaml new file mode 100644 index 0000000..30f0fb2 --- /dev/null +++ b/.github/workflows/release-tag.yaml @@ -0,0 +1,24 @@ +name: Create Release Tag + +on: + push: + tags: + - 'v*' + +jobs: + release-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + + - name: Create Release Tag + id: release_tag + uses: yyx990803/release-tag@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + body: | + 更新内容请查看[CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md)。 + Please refer to [CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md) for details. diff --git a/package.json b/package.json index 9865310..7479dd5 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,10 @@ "vr": "bin/index.js" }, "scripts": { + "preinstall": "npx only-allow pnpm", "build": "tsc --noEmit && tsup", "dev": "node bin/index.js", - "test": "pnpm run build && pnpm run dev", + "release": "pnpm run build && pnpm run dev release", "checkAll": "tsc --noEmit && eslint --ext .ts,.js" }, "packageManager": "pnpm@8.7.5",