-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Publish Package to npmjs | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Formatting | ||
run: yarn format | ||
|
||
- name: Linting | ||
run: yarn lint | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
publish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- run: yarn | ||
- run: yarn build | ||
- uses: JS-DevTools/npm-publish@v3 | ||
id: publish | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
|
||
- if: ${{ steps.publish.outputs.type }} | ||
run: echo "$PCKG_ID published to $PCKG_TAG, old version was [$OLD_VER]" | ||
env: | ||
OLD_VER: ${{ steps.publish.outputs.old-version }} | ||
PCKG_ID: ${{ steps.publish.outputs.id }} | ||
PCKG_TAG: ${{ steps.publish.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "hollowdb-client", | ||
"description": "HollowDB client", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "FirstBatch Team <[email protected]>", | ||
"contributors": [ | ||
"Faruk Can Özkan <[email protected]>", | ||
|
@@ -42,13 +42,19 @@ | |
"targets": { | ||
"cjs": { | ||
"outputFormat": "commonjs", | ||
"isLibrary": true, | ||
"context": "node" | ||
"isLibrary": false, | ||
"context": "node", | ||
"scopeHoist": false, | ||
"includeNodeModules": false, | ||
"optimize": false | ||
}, | ||
"mjs": { | ||
"outputFormat": "esmodule", | ||
"isLibrary": true, | ||
"context": "node" | ||
"isLibrary": false, | ||
"context": "node", | ||
"scopeHoist": false, | ||
"includeNodeModules": false, | ||
"optimize": false | ||
} | ||
}, | ||
"engines": { | ||
|