Skip to content

Commit 6a3a49e

Browse files
authored
Merge pull request #7 from techsavvyash/dev
workflows: ver bump package and manifest on release
2 parents 0a9fad8 + dbcf225 commit 6a3a49e

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,31 @@ jobs:
8585
run: |
8686
echo "Tag ${{ steps.extract_version.outputs.version }} already exists"
8787
echo "If you want to re-release, delete the tag first: git push --delete origin ${{ steps.extract_version.outputs.version }}"
88+
89+
- name: Update package.json and manifest.json versions
90+
run: |
91+
VERSION="${{ steps.extract_version.outputs.version }}"
92+
echo "Updating version to $VERSION in package.json and manifest.json"
93+
94+
# Update package.json
95+
cd packages/plugin
96+
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
97+
98+
# Update manifest.json
99+
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" manifest.json
100+
101+
# Show the changes
102+
echo "Updated package.json:"
103+
grep "version" package.json
104+
echo "Updated manifest.json:"
105+
grep "version" manifest.json
106+
107+
cd ../..
108+
109+
- name: Commit version changes
110+
run: |
111+
git config --local user.email "action@github.com"
112+
git config --local user.name "GitHub Action"
113+
git add packages/plugin/package.json packages/plugin/manifest.json
114+
git diff --staged --quiet || git commit -m "chore: bump version to ${{ steps.extract_version.outputs.version }}"
115+
git push origin "${GITHUB_REF#refs/heads/}"

0 commit comments

Comments
 (0)