Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- main
pull_request: {}
workflow_call: {}

concurrency:
group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}'
Expand All @@ -14,7 +15,7 @@ permissions:

jobs:

build:
check:
strategy:
matrix:
node-version: [18, 20]
Expand All @@ -31,8 +32,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

- name: Enable Yarn
- name: Setup Yarn
run: corepack enable

- name: Install Packages
Expand All @@ -48,7 +48,7 @@ jobs:
run: yarn coverage

- name: Report Coverage
if: ${{ matrix.node-version == 20 }}
if: ${{ matrix.node-version == 20 && github.event_name == 'pull_request' }}
uses: zgosalvez/github-actions-report-lcov@v4
with:
coverage-files: coverage/lcov.info
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
workflow_dispatch: {}
release:
types:
- published

jobs:
check:
uses: ./.github/workflows/ci.yml
secrets: inherit

publish:
needs: check

runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.com'
check-latest: true
- name: Setup Yarn
run: corepack enable

- name: Install Packages
run: yarn install

- name: Build
run: yarn build

- name: Publish
run: |
npm install -g npm@latest
npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"lint-docs": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
"lint-eslint-docs": "yarn build && eslint-doc-generator --check",
"docs": "eslint-doc-generator",
"release": "bumpp && yarn run build",
"release": "bumpp && echo \"Create a new release in GitHub to trigger the publish workflow.\"",
"test": "vitest",
"coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit"
Expand Down