Skip to content

Commit

Permalink
ci & release
Browse files Browse the repository at this point in the history
  • Loading branch information
sjvans committed Oct 11, 2023
1 parent 9271d3f commit 8859f9c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 27 deletions.
26 changes: 26 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "eslint:recommended",
"env": {
"es2022": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"CXL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off"
}
}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g @sap/cds-dk
- run: npm i
- run: cds v
- run: npm run lint
- run: npm run test
27 changes: 0 additions & 27 deletions .github/workflows/main.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
workflow_dispatch:

permissions:
contents: write

jobs:
publish-npm:
runs-on: ubuntu-latest
environment: npm
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: run tests
run: |
npm i -g @sap/cds-dk
npm i
npm run lint
npm run test
- name: get version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.2.3
- name: parse changelog
id: parse-changelog
uses: schwma/parse-changelog-action@v1.0.0
with:
version: '${{ steps.package-version.outputs.current-version }}'
- name: create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: 'v${{ steps.package-version.outputs.current-version }}'
body: '${{ steps.parse-changelog.outputs.body }}'
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"scripts": {
"build": "cds build",
"start": "cds run",
"lint": "npx eslint .",
"test": "npx jest --silent"
},
"devDependencies": {
Expand Down

0 comments on commit 8859f9c

Please sign in to comment.