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

Release 1.0.2 #9

Merged
merged 6 commits into from
Sep 22, 2023
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
21 changes: 18 additions & 3 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compares the version in package.json to tags on the repo. If the tag doesn't exist, a new tag is created, which
# then triggers the normal "on tag" release automation in the build job
name: Auto Tag
name: Tag, Release, and Publish to NPM

on:
push:
Expand All @@ -11,7 +11,7 @@ concurrency:
group: main-release-check

jobs:
tag-and-changelog:
tag-release-publish:
name: Changelog and Tag
runs-on: ubuntu-latest
steps:
Expand All @@ -25,13 +25,21 @@ jobs:
token: ${{ secrets.PACKAGE_ADMIN_PAT }}
fetch-depth: 0

- name: Setup Node 18.x
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Configure commit signing for ChiaAutomation
uses: Chia-Network/actions/commit-sign/gpg@main
with:
gpg_private_key: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_KEY }}
passphrase: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_PASSPHRASE }}

- name: Check for current version tag. Create if it doesn't exist
- name: Create tag, create release, publish to npm
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
version=$(cat $GITHUB_WORKSPACE/package.json | jq -r '.version')
echo "Version is: $version"
Expand All @@ -48,4 +56,11 @@ jobs:
git tag $version -m "Release $version $changes"
git push origin $version
git push origin main
gh release create --verify-tag --notes-from-tag $version
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
npm publish --access public
fi

- name: Cleanup
if: always()
run: rm .npmrc || true
31 changes: 0 additions & 31 deletions .github/workflows/publish-npm.yml

This file was deleted.

8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Logger {
addColors(customLevels.colors);

const chiaRoot = getChiaRoot();
const logDir = `${chiaRoot}/core-registry/logs/${projectName}`;
const logDir = `${chiaRoot}/core-registry/logs`;

if (!fs.existsSync(logDir)) {
fs.mkdirSync(logDir, { recursive: true });
Expand Down Expand Up @@ -71,16 +71,16 @@ class Logger {
),
transports: [
new transports.File({
filename: `${logDir}/error.log`,
filename: `${logDir}/${projectName}-error.log`,
level: "error",
format: sharedFileFormat,
}),
new transports.File({
filename: `${logDir}/combined.log`,
filename: `${logDir}/${projectName}-combined.log`,
format: sharedFileFormat,
}),
new DailyRotateFile({
filename: `${logDir}/application-%DATE%.log`,
filename: `${logDir}/${projectName}-application-%DATE%.log`,
datePattern: "YYYY-MM-DD",
zippedArchive: true,
maxSize: "20m",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chia-carbon/core-registry-logger",
"version": "1.0.1",
"version": "1.0.2",
"description": "Custom logger for core registry projects",
"main": "index.js",
"scripts": {
Expand Down