Skip to content

Commit 8859f9c

Browse files
committed
ci & release
1 parent 9271d3f commit 8859f9c

File tree

5 files changed

+94
-27
lines changed

5 files changed

+94
-27
lines changed

.eslintrc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"env": {
4+
"es2022": true,
5+
"node": true,
6+
"jest": true,
7+
"mocha": true
8+
},
9+
"globals": {
10+
"SELECT": true,
11+
"INSERT": true,
12+
"UPSERT": true,
13+
"UPDATE": true,
14+
"DELETE": true,
15+
"CREATE": true,
16+
"DROP": true,
17+
"CDL": true,
18+
"CQL": true,
19+
"CXL": true,
20+
"cds": true
21+
},
22+
"rules": {
23+
"no-console": "off",
24+
"require-atomic-updates": "off"
25+
}
26+
}

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
node-version: [18.x, 16.x]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: npm i -g @sap/cds-dk
24+
- run: npm i
25+
- run: cds v
26+
- run: npm run lint
27+
- run: npm run test

.github/workflows/main.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
publish-npm:
11+
runs-on: ubuntu-latest
12+
environment: npm
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
registry-url: https://registry.npmjs.org/
19+
- name: run tests
20+
run: |
21+
npm i -g @sap/cds-dk
22+
npm i
23+
npm run lint
24+
npm run test
25+
- name: get version
26+
id: package-version
27+
uses: martinbeentjes/[email protected]
28+
- name: parse changelog
29+
id: parse-changelog
30+
uses: schwma/[email protected]
31+
with:
32+
version: '${{ steps.package-version.outputs.current-version }}'
33+
- name: create a GitHub release
34+
uses: ncipollo/release-action@v1
35+
with:
36+
tag: 'v${{ steps.package-version.outputs.current-version }}'
37+
body: '${{ steps.parse-changelog.outputs.body }}'
38+
- run: npm publish --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"build": "cds build",
1313
"start": "cds run",
14+
"lint": "npx eslint .",
1415
"test": "npx jest --silent"
1516
},
1617
"devDependencies": {

0 commit comments

Comments
 (0)