Skip to content

Commit 3d79596

Browse files
authored
Feature/auto version update (#25)
* ci: add workflow to auto-tag and update version on merge * ci: test release.yml and new release
1 parent 3a6b097 commit 3d79596

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,12 @@ jobs:
3131
- name: Install dependencies
3232
run: yarn install --frozen-lockfile
3333

34-
- name: Generate version from date
35-
id: generate_version
34+
- name: Extract version from package.json
35+
id: extract_version
3636
run: |
37-
VERSION="v$(date +'%Y.%m.%d' | sed 's/0//g')"
37+
VERSION=$(jq -r '.version' package.json)
3838
echo "VERSION=$VERSION" >> $GITHUB_ENV
39-
echo "Generated version: $VERSION"
40-
41-
- name: Update version in package.json
42-
run: |
43-
jq --arg new_version "${{ env.VERSION }}" '.version = $new_version' package.json > temp.json && mv temp.json package.json
44-
echo "Updated package.json to version: ${{ env.VERSION }}"
45-
46-
- name: Commit updated package.json
47-
run: |
48-
git add package.json
49-
git commit -m "chore: update version to ${{ env.VERSION }}"
50-
git push origin main
39+
echo "Extracted version: $VERSION"
5140
5241
- name: Create Git tag
5342
run: |
@@ -57,9 +46,6 @@ jobs:
5746
- name: Build the package
5847
run: yarn build
5948

60-
- name: Notify release
61-
run: echo "Release ${{ env.VERSION }} has been successfully created."
62-
6349
- name: Set up NPM auth
6450
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
6551

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "style-forge.base",
3-
"version": "5.3.6",
3+
"version": "2025.1.4",
44
"description": "Style-Forge.Base: foundational CSS variables, base styles, typography, colors, utilities for consistent design.",
55
"type": "module",
66
"main": "base.css",

0 commit comments

Comments
 (0)