Skip to content

Commit

Permalink
feat(client): next version initial commit (#36)
Browse files Browse the repository at this point in the history
* feat(client): next version initial commit

* feat(user): Added user endpoints

* feat(client): added missing endpoints

* test(form): added form tests

* test(user): added user tests made max worker 1

* docs(form): added form api jsdoc

* docs(folder): added jsdoc to folder

* docs(report): added jsdoc to report

* docs(submission): added jsdoc to submission

* docs(user): added jsdoc to user

* test(folder): added tests to folder

* test(report): added report test

* chore(bundling): migrated to pure tsc

* fix(tests): fix tests and test the built library

* chore(ci): added github actions templates
  • Loading branch information
gokayform committed Dec 22, 2023
1 parent 2af91c7 commit 84123ef
Show file tree
Hide file tree
Showing 37 changed files with 5,348 additions and 1,279 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Test
on:
# manual trigger
workflow_dispatch:
# reuse workflow run
workflow_call:
# on pull request
pull_request:
# on push to master branch
push:
branches:
- 'master'
- 'next'
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-package-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-package-
- name: Install dependencies
run: npm i

- name: Run tests
run: npm run test
env:
JF_API_KEY: ${{ secrets.TEST_USER_API_KEY }}

- name: Build package
run: npm run build
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish
on:
# on release
release:
types: [released, prereleased]

jobs:
build-test:
uses: ./.github/workflows/build-test.yml
publish:
needs: build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20

- name: Cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-package-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-package-
- name: Build package
run: npm run build

- name: Publish package
if: github.event_name == 'release' && github.event.release.draft == false
run: |
if [[ ${{ github.event.release.prerelease }} == true || ${{ github.event.release.tag_name }} =~ -alpha|-beta|-rc ]]; then
npm publish --tag next
else
npm publish --tag latest
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
dist/
Loading

0 comments on commit 84123ef

Please sign in to comment.