@ypankratovich/ts-sum-inn
v1.1.1
Published
Simple TypeScript sum function
Readme
@ypankratovich/ts-sum-inn
TypeScript npm package with automated CI/CD pipeline.
Installation
npm install @ypankratovich/ts-sum-innUsage
import { sum } from '@ypankratovich/ts-sum-inn';
const result = sum(2, 3); // 5CI/CD Pipeline
PR Workflow
Triggered on: pull_request (opened, synchronize, reopened, labeled, unlabeled)
Jobs:
pr-verify (always runs):
- Check branch is up-to-date with main
- Check version is bumped
- Lint, build, unit tests
e2e (runs if
verifylabel is present):- Full E2E test with npm pack + install
release-candidate (runs if
publishlabel is present):- Check version not in npm registry
- Build dev version (
X.Y.Z-dev-<sha>) - Upload .tgz artifact
Release Workflow
Triggered when PR with publish label is merged to main:
- Lint, test, build
npm publish --access public- Create git tag
vX.Y.Z - Create GitHub Release
Labels
| Label | Effect |
|-------|--------|
| verify | Run E2E tests |
| publish | Create release candidate; publish on merge |
Versioning
- Semver required
- Version must be bumped in PR
- Linear history enforced
- Branch must be up-to-date with main
Required Secrets
| Secret | Description |
|--------|-------------|
| NPM_TOKEN | npm automation token with publish rights |
| REPO_ADMIN_TOKEN | Fine-grained PAT with Administration:write |
Creating NPM_TOKEN
- Go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens
- Generate New Token → Automation
- Copy token
gh secret set NPM_TOKEN -b"YOUR_TOKEN"
Creating REPO_ADMIN_TOKEN
- Go to https://github.com/settings/tokens?type=beta
- Generate new token (Fine-grained)
- Repository access: Select "ts-sum-inn"
- Permissions:
- Administration: Read and write
- Contents: Read and write
- Metadata: Read
gh secret set REPO_ADMIN_TOKEN -b"YOUR_TOKEN"
Bootstrap
Run bootstrap workflow to configure branch protection:
gh workflow run bootstrap.ymlLicense
MIT
