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
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

34 changes: 14 additions & 20 deletions .github/workflows/callable-publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
name: Build & Publish Package
name: '#Callable - Publish'

on:
workflow_call:
secrets:
token:
required: true

permissions:
id-token: write
contents: read

jobs:
publish:
name: Build & Publish Package to Registry
name: Publish Package
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 20
cache: npm
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Install Dependencies
run: npm ci

- name: Build Library
run: npm run build

- name: Publish to Registry
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.token }}
access: public
- name: Publish to npmjs.org
run: npm publish --access public
43 changes: 33 additions & 10 deletions .github/workflows/callable-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: Run Tests
name: '#Callable - Test'

on:
workflow_call:
inputs:
with_coverage:
type: boolean
default: false
secrets:
machine_account_token:
required: true

jobs:
test:
Expand All @@ -10,24 +17,40 @@ jobs:

steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 20
node-version-file: .nvmrc
cache: npm

- name: Install Dependencies
run: npm ci

- name: Run Type Checks
run : npm run type-check
- name: Run Type Check
run: npm run typecheck

- name: Run Linter
run: npm run lint

- name: Run Tests
run: npm run test
if: ${{ !inputs.with_coverage }}
run: npm test

- name: Run Coverage Tests
if: ${{ inputs.with_coverage }}
run: npm run test:coverage

- name: Report Coverage
if: ${{ inputs.with_coverage }}
uses: romeovs/lcov-reporter-action@v0.4.0
with:
lcov-file: coverage/lcov.info
github-token: ${{ secrets.machine_account_token }}

- name: Run Build
run: npm run build

- name: Run Package Linter
run: npm run lint:package
14 changes: 0 additions & 14 deletions .github/workflows/on-pr.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: On Pull Request (main)

on:
pull_request:
branches:
- main

jobs:
test:
name: Run Tests
uses: ./.github/workflows/callable-test.yml
with:
with_coverage: true
secrets:
machine_account_token: ${{ secrets.MACHINE_ACCOUNT_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/on-push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: On Push (main)

on:
push:
branches:
- main

jobs:
test:
name: Run Tests
uses: ./.github/workflows/callable-test.yml
with:
with_coverage: false
secrets:
machine_account_token: ${{ secrets.MACHINE_ACCOUNT_TOKEN }}
19 changes: 0 additions & 19 deletions .github/workflows/on-push.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: On Release

on:
release:
types:
- released

run-name: Release ${{ github.event.release.tag_name }} by @${{ github.actor }}

jobs:
test:
name: Run Tests
uses: ./.github/workflows/callable-test.yml
with:
with_coverage: false
secrets:
machine_account_token: ${{ secrets.MACHINE_ACCOUNT_TOKEN }}

publish:
name: Publish Package
uses: ./.github/workflows/callable-publish.yml
needs:
- test
permissions:
id-token: write
contents: read
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ typings/
.next

# Build
build
dist
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v24.20.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 moonstar-x
Copyright (c) 2026 moonstar-x

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading