From 37b142e0de9f20d351b8c982462d0b623201c5d7 Mon Sep 17 00:00:00 2001
From: mararok <5163714+Mararok@users.noreply.github.com>
Date: Sun, 10 Mar 2024 17:19:41 +0100
Subject: [PATCH] fix: publish npm

---
 .github/workflows/publish.yml                          |  3 +++
 CHANGELOG.md                                           | 10 +++++++++-
 package.json                                           |  5 ++---
 .../Package/PackageBumpVersionCommandHandler.ts        |  2 +-
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index e77019d..5053581 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -16,6 +16,9 @@ jobs:
       - name: Yarn install
         uses: hexancore/yarn-ci-install@ba9baf131eba84b6c86efb46375a530a3098bb04
 
+      - name: Build
+        run: yarn build
+
       # Publish package
       - name: Publish
         shell: bash
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1fbec34..5f03cbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+## 0.1.3
+
+### Fixed
+
+- publish action
+
 ## 0.1.2
 
 ### Changed
@@ -24,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Initial
 
-[unreleased] https://github.com/hexancore/cli/compare/0.1.1...HEAD   
+[unreleased] https://github.com/hexancore/cli/compare/0.1.3...HEAD   
+[0.1.3] https://github.com/hexancore/core/compare/0.1.2...0.1.3      
+[0.1.2] https://github.com/hexancore/core/compare/0.1.1...0.1.2     
 [0.1.1] https://github.com/hexancore/core/compare/0.1.0...0.1.1    
 [0.1.0] https://github.com/hexancore/cli/releases/tag/0.1.0  
diff --git a/package.json b/package.json
index d6233d6..1c75311 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@hexancore/cli",
-  "version": "0.1.2",
+  "version": "0.1.3",
   "engines": {
     "node": ">=20"
   },
@@ -14,7 +14,7 @@
   "main": "./lib/index.js",
   "repository": {
     "type": "git",
-    "url": "https://github.com/hexancore/cli.git"
+    "url": "git+https://github.com/hexancore/cli.git"
   },
   "publishConfig": {
     "access": "public"
@@ -33,7 +33,6 @@
     "test:watch": "jest --config .jestrc.json --runInBand --watchAll",
     "test:cov": "jest --config .jestrc.json --coverage",
     "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --config .jestrc.json --runInBand",
-    "prepublish": "yarn run build"
   },
   "dependencies": {
     "@commander-js/extra-typings": "^12.0.0",
diff --git a/src/Command/Package/PackageBumpVersionCommandHandler.ts b/src/Command/Package/PackageBumpVersionCommandHandler.ts
index 4795081..57fc174 100644
--- a/src/Command/Package/PackageBumpVersionCommandHandler.ts
+++ b/src/Command/Package/PackageBumpVersionCommandHandler.ts
@@ -39,7 +39,7 @@ export class PackageBumpVersionCommandHandler {
     if (typeof repositoryUrl !== 'string') {
       return ERR('core.cli.package.empty_repository_url');
     }
-    return OK(repositoryUrl.replace('.git', ''));
+    return OK(repositoryUrl.replace('.git', '').replace('git+', ''));
   }
 
   private updateChangelog(repositoryUrl: string, newVersion: string, releaseDate): AR<string> {