Skip to content

Commit b20e5b8

Browse files
committed
ci(ci): 💚 Updated ci workflow
1 parent 45ab827 commit b20e5b8

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,19 @@ jobs:
3939
with:
4040
github_token: ${{ secrets.TREE_STRUCTURE_TS_PAT }}
4141
release_branches: main
42+
43+
- name: Update package.json
44+
shell: pwsh
45+
env:
46+
TAG_NAME: ${{ steps.tag_version.outputs.new_tag }}
47+
run: |
48+
$env:RELEASE_VERSION = $env:TAG_NAME.replace('v', '')
49+
$content = Get-Content .\package.json
50+
$content = $content | foreach-object { $_ -replace '(?<prefix>^.+"version": ")(.+)(?<suffix>",)$', "`${prefix}$env:RELEASE_VERSION`${suffix}" }
51+
$content | foreach-object { [System.Text.RegularExpressions.Regex]::Unescape($_) } | Out-File .\package.json -Force -Encoding ascii
52+
53+
- uses: stefanzweifel/git-auto-commit-action@v4
54+
with:
55+
commit_message: "ci(package-json): :bookmark: Bumped package.json version to ${{ steps.tag_version.outputs.new_tag }}"
56+
commit_user_email: [email protected]
57+
branch: main

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: release
22

33
on:
44
push:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![npm (scoped)](https://img.shields.io/npm/v/@itpropro/tree-structure-ts)](https://www.npmjs.com/package/@itpropro/tree-structure-ts)
44
![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@itpropro/tree-structure-ts)
5-
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/itpropro/tree-structure-ts/ci.yml?branch=main)
5+
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/itpropro/tree-structure-ts/release.yml?branch=main)
66
![Code Coverage](https://img.shields.io/badge/coverage->95%25-green)
77

88
## Introduction

0 commit comments

Comments
 (0)