Skip to content

Commit 8b12d2d

Browse files
authored
chore: add release workflow (#3)
1 parent 70f5e4c commit 8b12d2d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.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: 20
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}}

0 commit comments

Comments
 (0)