Skip to content

Commit c8849cc

Browse files
authored
Merge pull request #34 from cap-js/github_wf
Adding the release workflow and changelog
2 parents 4045d06 + 9139ef6 commit c8849cc

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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 test
24+
- name: get version
25+
id: package-version
26+
uses: martinbeentjes/[email protected]
27+
- name: parse changelog
28+
id: parse-changelog
29+
uses: schwma/[email protected]
30+
with:
31+
version: '${{ steps.package-version.outputs.current-version }}'
32+
- name: create a GitHub release
33+
uses: ncipollo/release-action@v1
34+
with:
35+
tag: 'v${{ steps.package-version.outputs.current-version }}'
36+
body: '${{ steps.parse-changelog.outputs.body }}'
37+
- run: npm publish --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
This project adheres to [Semantic Versioning](http://semver.org/).
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/).
6+
7+
8+
## Version 0.1.0
9+
10+
### Added
11+
12+
- Initial release

0 commit comments

Comments
 (0)