Skip to content

Commit 6526ec3

Browse files
authored
chore: use standalone release job (#60)
1 parent 3b868a5 commit 6526ec3

File tree

2 files changed

+64
-24
lines changed

2 files changed

+64
-24
lines changed

.github/workflows/_release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Release
5+
6+
on:
7+
# push:
8+
# branches: main
9+
10+
workflow_dispatch:
11+
inputs:
12+
dry-run:
13+
description: Dry run
14+
required: false
15+
default: false
16+
type: boolean
17+
18+
permissions:
19+
contents: write
20+
id-token: write
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
release:
28+
uses: cap-js/.github/.github/workflows/release.yml@main
29+
secrets: inherit
30+
with:
31+
dry-run: ${{ fromJSON(github.event.inputs.dry-run || 'false') }}

.github/workflows/release.yml

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Release
52

6-
on:
7-
# push:
8-
# branches: main
9-
10-
workflow_dispatch:
11-
inputs:
12-
dry-run:
13-
description: Dry run
14-
required: false
15-
default: false
16-
type: boolean
17-
183
permissions:
194
contents: write
20-
id-token: write
215

22-
concurrency:
23-
group: ${{ github.workflow }}-${{ github.ref }}
24-
cancel-in-progress: true
6+
on:
7+
workflow_dispatch:
258

269
jobs:
27-
release:
28-
uses: cap-js/.github/.github/workflows/release.yml@main
29-
secrets: inherit
30-
with:
31-
dry-run: ${{ fromJSON(github.event.inputs.dry-run || 'false') }}
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)