Skip to content

Commit f0adbfd

Browse files
enhancement: minor housekeeping, added github actions
1 parent 2f49030 commit f0adbfd

File tree

5 files changed

+188
-94
lines changed

5 files changed

+188
-94
lines changed

.github/workflows/npm.publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
name: Publish to NPM
3+
4+
on:
5+
release:
6+
types: [ created ]
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.event.release.target_commitish }}
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
registry-url: "https://registry.npmjs.org"
19+
- run: npm ci
20+
- run: git config --global user.name "GitHub CD bot"
21+
- run: git config --global user.email "[email protected]"
22+
- run: npm test
23+
- run: npm version ${{ github.event.release.tag_name }}
24+
- run: npm publish --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
27+
- run: git push
28+
env:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
on:
2+
push:
3+
tags:
4+
- "v[0-9]+.[0-9]+.[0-9]+"
5+
6+
name: Create Release
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [ 16.x ]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
cache: 'npm'
21+
- run: npm ci --ignore-scripts
22+
- run: npm run build --if-present
23+
24+
release_git:
25+
needs: build
26+
name: Create Release
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v2
31+
- name: Create Release
32+
id: create_release
33+
uses: actions/create-release@v1
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
with:
37+
tag_name: ${{ github.ref }}
38+
release_name: Release ${{ github.ref }}
39+
draft: false
40+
prerelease: false
41+
42+
publish:
43+
needs: release_git
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v2
47+
with:
48+
ref: ${{ github.event.release.target_commitish }}
49+
- uses: actions/setup-node@v2
50+
with:
51+
node-version: 16
52+
registry-url: "https://registry.npmjs.org"
53+
- run: npm publish --access public
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,21 @@ When using this package, all backend requests of `extjs-app-imapuser` will be re
77
npm install --save-dev @conjoon/extjs-dev-imapusersim
88
```
99

10+
If you want to develop with this package, run the `build:dev`-script afterwards:
11+
```bash
12+
npm run build:dev
13+
```
14+
Testing environment will then be available via
15+
16+
```bash
17+
npm test
18+
```
1019
## Usage
1120
Simply update the app.json of the conjoon-application
1221
by specifying this package in the `uses`-property in either the `development` and/or `prodution` section:
1322

1423
*Example:*
15-
````javascript
24+
```javascript
1625
"development": {
1726
"uses" : [
1827
"extjs-dev-imapusersim",
@@ -27,7 +36,7 @@ by specifying this package in the `uses`-property in either the `development` an
2736
"extjs-app-webmail"
2837
]
2938
}
30-
````
39+
```
3140

3241
Notice how in the example above all backend requests made by the [conjoon/extjs-app-imapuser](https://github.com/conjoon/extjs-app-imapuser) package
3342
will be intercepted by the backend-mocks of the `extjs-dev-imapusersim` package when using the development-version.

0 commit comments

Comments
 (0)