Skip to content

Commit 8a4205a

Browse files
committed
fix: action
1 parent b019f64 commit 8a4205a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Publish Package to npmjs.com
22
on:
33
release:
44
types: [published]
5+
push:
6+
tags:
7+
- "v*"
58
jobs:
69
build-and-publish:
7-
if: github.event.release.target_commitish == 'main'
810
runs-on: ubuntu-latest
911
steps:
1012
- name: Checkout

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ import { initCommand } from "~/commands/init.command"
1414
import { loginCommand } from "~/commands/login.command"
1515
import { addBlockCommand } from "./commands/block.command"
1616
import { themeCommand } from "./commands/theme.command"
17+
import { fileURLToPath } from "node:url"
18+
import { dirname, resolve } from "node:path"
19+
import { readFileSync } from "node:fs"
20+
21+
const __filename = fileURLToPath(import.meta.url)
22+
const __dirname = dirname(__filename)
1723

1824
const generateFigletText = (text: string, options: figlet.Options): Effect.Effect<string, Error> =>
1925
Effect.async<string, Error>((resume) => {
@@ -75,9 +81,13 @@ const command = rootCommand.pipe(
7581
]),
7682
)
7783

84+
const pkg = JSON.parse(
85+
readFileSync(resolve(__dirname, "../package.json"), "utf-8") // adjust path sesuai struktur build lo
86+
)
87+
7888
const cli = Command.run(command, {
7989
name: "Intent UI CLI",
80-
version: "v3.1.1",
90+
version: pkg.version,
8191
})
8292

8393
cli(process.argv).pipe(

0 commit comments

Comments
 (0)