From e56ea81f037ef3ecea04bee9e87e9396548f0b3b Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Wed, 17 Jul 2024 00:45:15 +0800 Subject: [PATCH] ci: add workflows --- .github/workflows/lint.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 23 +++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..7e1d0b04 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Linter + +on: + push: + branches: [main] + + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Restore Build Result + uses: actions/download-artifact@v4 + with: + name: build-result + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install deps + run: pnpm install --frozen-lockfile + + - name: Linter + run: | + pnpm run lint + pnpm run lint:css diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..91b6fbda --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Add Release Tag + +on: + push: + tags: + - v* + +jobs: + release: + if: github.repository == 'pengzhanbo/vuepress-theme-plume' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 20.x + + - run: npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}