From 50f96f041260f97e386658a4b28555eb57e71126 Mon Sep 17 00:00:00 2001 From: akkadaska Date: Mon, 12 Aug 2024 03:06:09 +0900 Subject: [PATCH] feat: set up CI/CD --- .github/workflows/cd.yml | 25 +++++++++++++++++++++++++ .github/workflows/ci.yml | 19 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..82f05d4 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,25 @@ +name: CD + +on: + push: + tags: + - v* + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --frozen-lockfile + - run: npm test + - run: npm run compile + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e58084e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'pnpm' + cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --frozen-lockfile + - run: npm test