fix: fix a bug of cjs not working #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
ci-cd: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.2.0 | |
- name: Cache PNPM | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.pnpm-store | |
**/node_modules | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
- name: Enable PNPM | |
run: | | |
corepack enable pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
- name: Lint with Eslint | |
run: | | |
pnpm lint | |
- name: Check code formatting | |
run: | | |
pnpm format:check | |
- name: Build | |
run: | | |
pnpm build | |
- name: Unit tests | |
run: | | |
pnpm test | |
- id: semantic-release | |
name: Run semantic-release | |
run: | | |
npx semantic-release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |