feat: to release new version #43
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: | |
- 18.x | |
os: | |
- ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{matrix.node-version}} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2.0.1 | |
with: | |
version: 8 | |
- uses: actions/cache@v2 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Run Tests 🧪 | |
run: pnpm run test | |
Publish: | |
runs-on: ubuntu-latest | |
needs: | |
- Test | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2.0.1 | |
with: | |
version: 8 | |
- uses: actions/cache@v2 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Publish 🚀 | |
run: npx semantic-release | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |