File tree Expand file tree Collapse file tree 3 files changed +68
-5
lines changed Expand file tree Collapse file tree 3 files changed +68
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : NPM Package
2
+ on :
3
+ push :
4
+ branches-ignore :
5
+ - " **"
6
+ tags :
7
+ - v*
8
+ workflow_dispatch :
9
+ inputs :
10
+ version :
11
+ description : " Package version"
12
+ required : true
13
+ tag :
14
+ description : " Package tag"
15
+ required : true
16
+ default : " latest"
17
+ type : choice
18
+ options :
19
+ - latest
20
+ - beta
21
+
22
+ jobs :
23
+ npm-upload :
24
+ name : NPM Package Build and Upload
25
+ runs-on : ubuntu-latest
26
+ timeout-minutes : 10
27
+
28
+ steps :
29
+ - name : Checkout
30
+ uses : actions/checkout@v2
31
+
32
+ - uses : actions/setup-node@v3
33
+ with :
34
+ node-version : " 20"
35
+ cache : " npm"
36
+
37
+ - run : npm ci
38
+ - run : npm run build:lib # create the ./lib directory with the files to publish
39
+ - run : sed "s/%%VERSION%%/$VERSION/" package.json > "./lib/package.json"
40
+
41
+ - id : semver
42
+ run : |
43
+ SEMVER="${{ github.event.inputs.version }}"
44
+ if [ -z "$SEMVER" ]; then
45
+ # No manual input, we must be running on a tag
46
+ SEMVER="${GITHUB_REF/refs\/tags\/v/}"
47
+ fi
48
+ echo "::set-output name=semver::${SEMVER}"
49
+
50
+ - run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTOMATION_TOKEN }}" > ./lib/.npmrc
51
+
52
+ - run : |
53
+ RELEASE_TAG="${{ github.event.inputs.tag }}"
54
+ if [ -z "$RELEASE_TAG" ]; then
55
+ if grep -q -- '-beta' <<< "${{ steps.semver.outputs.semver }}"; then
56
+ RELEASE_TAG=beta
57
+ else
58
+ # No manual input, we must be running on a tag
59
+ RELEASE_TAG=latest
60
+ fi
61
+ fi
62
+ npm publish --tag "$RELEASE_TAG" --access public
63
+ working-directory: ./lib
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ API Calls store for react redux
7
7
## Install
8
8
9
9
``` bash
10
- npm install --save api-calls-store
10
+ npm install --save @ensuro/ api-calls-store
11
11
```
12
12
13
13
## Configure
@@ -17,7 +17,7 @@ npm install --save api-calls-store
17
17
In the ` reducers.js ` file:
18
18
19
19
``` js
20
- import APIReducer from " api-calls-store/src/store/api/reducer" ;
20
+ import APIReducer from " @ensuro/ api-calls-store/src/store/api/reducer" ;
21
21
22
22
export default combineReducers ({
23
23
// ...
@@ -30,7 +30,7 @@ export default combineReducers({
30
30
In the ` sagas.js ` file:
31
31
32
32
``` js
33
- import { apiSaga , initializeAPIStore } from " api-calls-store/src/package-index" ;
33
+ import { apiSaga , initializeAPIStore } from " @ensuro/ api-calls-store/src/package-index" ;
34
34
35
35
const clockCount = 15 ;
36
36
initializeAPIStore ({
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " api-calls-store" ,
3
- "version" : " 0.0.6 " ,
2
+ "name" : " @ensuro/ api-calls-store" ,
3
+ "version" : " %%VERSION%% " ,
4
4
"description" : " API Calls Store for React Redux" ,
5
5
"scripts" : {
6
6
"prettier" : " prettier --write ." ,
You can’t perform that action at this time.
0 commit comments