Skip to content

Commit d960179

Browse files
committed
refactor: use freed package-lock.json
refactor: correct github folder ci: add github actions
1 parent 39ea5cc commit d960179

File tree

6 files changed

+610
-607
lines changed

6 files changed

+610
-607
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
workflow_call:
3+
jobs:
4+
build-test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- name: Use Node.js
9+
uses: actions/setup-node@v3
10+
with:
11+
node-version: 18.x
12+
cache: 'npm'
13+
# clean install
14+
- run: npm ci
15+
name: NRC Install
16+
# build
17+
- run: npm run build --if-present
18+
name: NRC Build
19+
# test
20+
- run: npm test
21+
name: NRC Test
22+
23+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
workflow_call:
3+
outputs:
4+
version:
5+
description: version calculated by git version
6+
value: ${{ jobs.generate-version.outputs.semVer }}
7+
jobs:
8+
generate-version:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
semVer: ${{ steps.generateVersion.outputs.semVer }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
# install git version
17+
- id: installVersion
18+
name: Install GitVersion
19+
uses: gittools/actions/gitversion/setup@v0
20+
with:
21+
versionSpec: '5.x'
22+
preferLatestVersion: true
23+
# calculate git version
24+
- id: generateVersion # id to later be referenced
25+
name: calculate semver
26+
uses: gittools/actions/gitversion/execute@v0
27+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
version:
5+
description: version used to publish to NPM registry
6+
required: true
7+
type: string
8+
jobs:
9+
build-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Use Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18.x
17+
cache: 'npm'
18+
# clean install
19+
- run: npm ci
20+
# build
21+
- run: npm run build --if-present
22+
# test
23+
- run: npm publish
24+
# tag release
25+
26+
27+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Node-Rest-Client CI
2+
on:
3+
push:
4+
branches:
5+
- feat/general-upgrade
6+
- master
7+
- release
8+
jobs:
9+
build-test:
10+
uses: ./.github/workflows/nrc-job-build-test.yml
11+
generate-version:
12+
uses: ./.github/workflows/nrc-job-generate-version.yml
13+
needs: build-test
14+
print-version:
15+
runs-on: ubuntu-latest
16+
needs: generate-version
17+
steps:
18+
- run: echo "version used is $VERSION"
19+
env:
20+
VERSION: ${{ needs.generate-verions.outputs.version }}
21+
22+
23+
24+
25+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Node-Rest-Client PR
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
build-test:
8+
uses: ./.github/workflows/nrc-job-build-test.yml
9+

0 commit comments

Comments
 (0)