From e2ad7643f941e7fc714f3af1a1e3aad27aad6563 Mon Sep 17 00:00:00 2001 From: LuciNyan <22126563+LuciNyan@users.noreply.github.com> Date: Thu, 23 Feb 2023 23:29:42 +0800 Subject: [PATCH] chore: add workflow --- .github/workflows/ci.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 22 ++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..90de155 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Lint + run: nr lint + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Typecheck + run: nr typecheck + + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + node: [14.x, 16.x] + os: [ubuntu-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - name: Set node ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build + run: nr build + + - name: Test + run: nr test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b4b0d56 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - run: npx conventional-github-releaser -p angular + env: + CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}