Skip to content

Merge pull request #18 from quran/dev #44

Merge pull request #18 from quran/dev

Merge pull request #18 from quran/dev #44

Workflow file for this run

name: CI
on: [push]
env:
HUSKY: 0
jobs:
build:
if: github.repository == 'quran/api-js' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
name: ⚒️ Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18.x', '20.x']
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install dependencies
shell: bash
run: pnpm install
- name: Lint
run: pnpm lint --quiet
- name: Test
run: pnpm test:coverage
- name: Build
run: pnpm build
test-and-publish:
name: 🎉 Publish to NPM
needs: [build]
if: github.repository == 'quran/api-js' && (github.ref == 'refs/heads/master') && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: "pnpm"
- name: Install dependencies
shell: bash
run: pnpm install
- name: Build
run: pnpm build
- run: npx semantic-release@17
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}