Skip to content

Commit

Permalink
STAT-10: Demo project.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Aug 27, 2024
1 parent 4984733 commit 3ae1300
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# jira ticket

https://singular-ai.atlassian.net/browse/<TICKET-ID>

# todo list

- [ ] Version bump
- [ ] Clean up code

# tests updated

- [ ] integration test
22 changes: 22 additions & 0 deletions .github/workflows/npm_publish_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node.js Package Dev Release

on:
push:
branches-ignore:
- 'master'
jobs:
build-and-publish-dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn test
- run: |
npm version prerelease --preid=dev --no-git-tag-version
npm publish --tag dev
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
20 changes: 20 additions & 0 deletions .github/workflows/npm_publish_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Node.js Package Production Release

on:
release:
types: [created]

jobs:
build-and-publish-prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './sum';
4 changes: 4 additions & 0 deletions src/sum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// src/sum.ts
export function sum(a: number, b: number): number {
return a + b;
}
7 changes: 7 additions & 0 deletions test/sum.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { sum } from '../src';

describe('sum', () => {
it('adds two numbers', () => {
expect(sum(1, 2)).toBe(3);
});
});

0 comments on commit 3ae1300

Please sign in to comment.