Skip to content

Commit b7a972c

Browse files
authored
feat: extract version from tag and update package versions in publish workflow (#10)
1 parent 48864da commit b7a972c

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,27 @@ jobs:
2424
registry-url: 'https://npm.pkg.github.com'
2525
scope: '@labbs'
2626

27-
- run: pnpm install
27+
- name: Extract version from tag
28+
id: version
29+
run: |
30+
# Remove 'v' prefix from tag (v1.0.0-beta2 -> 1.0.0-beta2)
31+
VERSION=${GITHUB_REF_NAME#v}
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
echo "Publishing version: $VERSION"
34+
35+
- name: Update package versions
36+
run: |
37+
VERSION=${{ steps.version.outputs.version }}
38+
# Update core package version
39+
cd packages/core
40+
npm pkg set version="$VERSION"
41+
cd ../react
42+
# Update react package version
43+
npm pkg set version="$VERSION"
44+
# Update dependency on core to use exact version
45+
npm pkg set dependencies.@labbs/openblock-core="$VERSION"
46+
47+
- run: pnpm install --no-frozen-lockfile
2848

2949
- name: Build packages
3050
run: |

0 commit comments

Comments
 (0)