Skip to content

Commit

Permalink
Add Github workflow for publishing to NPM and tidy up related files
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgeary committed Aug 30, 2024
1 parent a0f2f2d commit 2a4ec98
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 21 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/publish-release-to-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish to NPM

on:
release:
types: [created]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out source code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Check out source code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Set up node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build library and publish
run: |
npm run build-lib
cd ./dist/log4ngx
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
19 changes: 0 additions & 19 deletions projects/log4ngx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,3 @@ The `LogService` is the factory with which you instantiate `Loggers` in each of
The `LogService` is configured using an instance of the `LogServiceConfig`, typically created in your application's main module. The configuration defines the parameters used with each `Appender` and how each `Appender` relates to the various `Loggers`.

For more information about using and configuring log4ngx, see <https://secondbounce.github.io/log4ngx/>.

## TODO

* Make sure all classes, interfaces and their public/protected methods are documented

### Docs

* Getting Started
* installing
* configuring
* usage
* Customising
* Writing a custom appender
* Writing a custom level
* API
* Classes
* Interfaces
* Constants
* Utility
4 changes: 2 additions & 2 deletions projects/log4ngx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@angular/core": ">=18.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
"tslib": "^2.6.3"
}
}
}

0 comments on commit 2a4ec98

Please sign in to comment.