Skip to content

Commit

Permalink
refactor: use freed package-lock.json
Browse files Browse the repository at this point in the history
refactor: correct github folder

ci: add github actions
  • Loading branch information
aacerox committed Oct 9, 2023
1 parent 39ea5cc commit f4c3e94
Show file tree
Hide file tree
Showing 6 changed files with 610 additions and 607 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/nrc-job-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
workflow_call:
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
# clean install
- run: npm ci
name: NRC Install
# build
- run: npm run build --if-present
name: NRC Build
# test
- run: npm test
name: NRC Test


27 changes: 27 additions & 0 deletions .github/workflows/nrc-job-generate-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:
outputs:
version:
description: version calculated by git version
value: ${{ jobs.generate-version.outputs.semVer }}
jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
semVer: ${{ steps.generateVersion.outputs.semVer }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# install git version
- id: installVersion
name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
# calculate git version
- id: generateVersion # id to later be referenced
name: calculate semver
uses: gittools/actions/gitversion/execute@v0

27 changes: 27 additions & 0 deletions .github/workflows/nrc-job-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:
inputs:
version:
description: version used to publish to NPM registry
required: true
type: string
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
# clean install
- run: npm ci
# build
- run: npm run build --if-present
# test
- run: npm publish
# tag release



25 changes: 25 additions & 0 deletions .github/workflows/nrc-workflow-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Node-Rest-Client CI
on:
push:
branches:
- feat/general-upgrade
- master
- release
jobs:
build-test:
uses: ./.github/workflows/nrc-job-build-test.yml
generate-version:
uses: ./.github/workflows/nrc-job-generate-version.yml
needs: build-test
print-version:
runs-on: ubuntu-latest
needs: generate-version
steps:
- run: echo "version used is $VERSION"
env:
VERSION: ${{ needs.generate-version.outputs.version }}





9 changes: 9 additions & 0 deletions .github/workflows/nrc-workflow-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Node-Rest-Client PR
on:
pull_request:
branches:
- master
jobs:
build-test:
uses: ./.github/workflows/nrc-job-build-test.yml

Loading

0 comments on commit f4c3e94

Please sign in to comment.