diff --git a/.github/workflows/test.yml b/.github/workflows/main.yml similarity index 51% rename from .github/workflows/test.yml rename to .github/workflows/main.yml index 1ead219..eb8ec53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/main.yml @@ -1,21 +1,29 @@ -name: test +name: CI on: - - push - - pull_request + pull_request: + branches: ['main'] jobs: - linux: + lint-and-test: + name: Lint and test runs-on: ubuntu-latest strategy: matrix: node-version: - - 17.x + - 16.15.1 + - 18.x steps: - uses: actions/checkout@v2 + - uses: pnpm/action-setup@v2 + with: + version: 8 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + cache: 'pnpm' - name: Install - run: npm install + run: pnpm install + - name: lint + run: pnpm lint - name: Run tests - run: npm test + run: pnpm test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..01a3cac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release +on: + push: + branches: ['main'] +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}