Skip to content

Commit 462a4bb

Browse files
Merge pull request #3 from Codegyan-LLC/dev
v1.0.6
2 parents 924d2ef + a5b0227 commit 462a4bb

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

.github/workflows/npm-publish.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3-
4-
name: Release Git Package & Publish on NPM
1+
name: Release & Publish
52

63
on:
74
push:
@@ -11,6 +8,8 @@ on:
118
jobs:
129
release:
1310
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.version.outputs.new_version }}
1413

1514
steps:
1615
# Checkout repo
@@ -21,26 +20,31 @@ jobs:
2120
- name: Setup Node.js
2221
uses: actions/setup-node@v4
2322
with:
24-
node-version: '20'
25-
registry-url: 'https://registry.npmjs.org/'
23+
node-version: '24'
24+
25+
# Git identity (required for npm version)
26+
- name: Setup Git identity
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "github-actions[bot]@users.noreply.github.com"
2630
2731
# Install deps
2832
- name: Install dependencies
2933
run: npm install
3034

31-
# Bump version dynamically & push tag
35+
# Bump version dynamically
3236
- name: Bump version
3337
id: version
3438
run: |
35-
# Author identity
39+
40+
# gitbot
3641
git config user.name "github-actions[bot]"
37-
git config user.email "github-actions[bot]@users.noreply.github.com"
38-
39-
# Bump patch version (you can change to minor/major if needed)
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
4044
NEW_VERSION=$(npm version patch -m "chore(release): v%s [skip ci]")
4145
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
4246

43-
# Push updated package.json and tag to main
47+
# Push changes (commit + tag)
4448
- name: Push changes
4549
uses: ad-m/github-push-action@v0.8.0
4650
with:
@@ -57,8 +61,26 @@ jobs:
5761
env:
5862
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5963

60-
# Publish to NPM
64+
publish-npm:
65+
needs: release # ⬅ Runs only after release is successful
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '24'
75+
registry-url: 'https://registry.npmjs.org/'
76+
77+
- name: Install dependencies
78+
run: npm install
79+
80+
- name: Build package
81+
run: npm run build
82+
6183
- name: Publish to NPM
62-
run: npm publish
84+
run: npm publish --access public
6385
env:
6486
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codegyan-log-colorify",
3-
"version": "1.0.5.1",
3+
"version": "1.0.6",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"scripts": {

0 commit comments

Comments
 (0)