From b3db7b5a099e102e881f50513d9b1cfe58b7cc1c Mon Sep 17 00:00:00 2001 From: Sabertaz Date: Mon, 1 Apr 2024 23:28:20 +0800 Subject: [PATCH] ci: release to GitHub with action --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dea494..d81f948 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - '*' pull_request: branches: - main @@ -38,3 +40,26 @@ jobs: - name: Build package run: | pnpm build + + publish: + name: Publishment + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 1 + - name: Setup Node environment + uses: actions/setup-node@v4 + with: + node-version: 20 + architecture: x64 + registry-url: https://registry.npmjs.org/ + - name: Release to GitHub + run: | + npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}