Add actions for pr, publish
This commit is contained in:
parent
dac783faa8
commit
e93186b8ec
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: pr-checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-test-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
# Publishes a pre-release, incrementing the final integer (ie: 0.0.1-alpha.1 => 0.0.1-alpha.2), if any ts files or the package.json have changed. Pushes package.json changes back to main.
|
||||||
|
|
||||||
|
name: publish-dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**.ts'
|
||||||
|
- 'package.json'
|
||||||
|
- 'package-lock.json'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish-dev:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Version
|
||||||
|
run: npm version prerelease
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
run: npm publish
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push Version Update
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'openfeature-ci'
|
||||||
|
git config --global user.email 'openfeature-ci@users.noreply.github.com'
|
||||||
|
git push
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
# node-sdk
|
# node-sdk
|
||||||
|
|
||||||
|
[](http://github.com/badges/stability-badges)
|
||||||
|
|
||||||
OpenFeature NodeJS SDK
|
OpenFeature NodeJS SDK
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"lint": "eslint ./",
|
"lint": "eslint ./",
|
||||||
"postbuild": "cp ./package.esm.json ./dist/esm/package.json",
|
"postbuild": "cp ./package.esm.json ./dist/esm/package.json",
|
||||||
"build": "rm -R ./dist && tsc --project tsconfig.json && tsc --project tsconfig.cjs.json"
|
"build": "rm -f -R ./dist && tsc --project tsconfig.json && tsc --project tsconfig.cjs.json"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// real code will go here, just scaffolding the project for now.
|
// real code will go here, just scaffolding the project for now.
|
||||||
export const greet = (greeting: string): string => {
|
export const greet = (greeting: string): string => {
|
||||||
console.log(`${greeting}, OpenFeature`);
|
const message = `${greeting}, OpenFeature`;
|
||||||
return greeting;
|
return message;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@ import { greet } from '../src/index';
|
||||||
describe('greet', () => {
|
describe('greet', () => {
|
||||||
it('should return greeting', () => {
|
it('should return greeting', () => {
|
||||||
const result = greet('hi');
|
const result = greet('hi');
|
||||||
expect(result).toEqual('hi');
|
expect(result).toContain('hi');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue