Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added auto-release and logger to use metadata #11

Merged
merged 17 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:
branches: [main]

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn install
- name: Build
run: yarn run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run release
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"author": "Prathap <[email protected]>",
"license": "MIT",
"scripts": {
"build": "tsc"
"build": "tsc",
"release": "semantic-release"
},
"dependencies": {
"winston": "^3.8.1"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^19.0.5",
"@types/winston": "^2.4.4",
"typescript": "^4.7.4"
}
Expand Down
23 changes: 23 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
branches: ["main"],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
changelogFile: "CHANGELOG.md",
},
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
assets: ["CHANGELOG.md", "package.json"],
message:
"chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
],
};
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const createLogger = (

// do not exit the process after logging an uncaughtException
exitOnError: false,

// generic metadata applied to all logs
defaultMeta: { type: "application", ...(service && { service }) }
});
Loading