Skip to content

Commit 0cae833

Browse files
committed
chore: adjust version bump timing in synchronization workflow
Update the GitHub Actions workflow to bump the version in package.json after installing dependencies, ensuring that the version is not overwritten by pnpm install. This change enhances the reliability of version synchronization for both MCP and CLI repositories.
1 parent 4a271c1 commit 0cae833

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/sync-version.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ jobs:
2323
run: |
2424
git clone https://x-access-token:${{ secrets.DOCS_SYNC_TOKEN }}@github.com/dokploy/mcp.git mcp-repo
2525
cd mcp-repo
26-
27-
# Bump version
28-
jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp
29-
mv package.json.tmp package.json
30-
26+
3127
# Regenerate tools from latest OpenAPI spec
3228
npm install -g pnpm
3329
pnpm install
3430
pnpm run fetch-openapi
3531
pnpm run generate
36-
32+
33+
# Bump version after install so pnpm install doesn't overwrite it
34+
jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp
35+
mv package.json.tmp package.json
36+
3737
git config user.name "Dokploy Bot"
3838
git config user.email "bot@dokploy.com"
39-
39+
4040
git add -A
4141
git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" \
4242
-m "Source: ${{ github.repository }}@${{ github.sha }}" \
4343
-m "Release: ${{ github.event.release.html_url }}" \
4444
--allow-empty
45-
45+
4646
git push
4747
4848
@@ -52,18 +52,18 @@ jobs:
5252
5353
cd cli-repo
5454
55-
# Bump version
56-
if [ -f package.json ]; then
57-
jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp
58-
mv package.json.tmp package.json
59-
fi
60-
6155
# Copy latest openapi spec and regenerate commands
6256
cp ../openapi.json ./openapi.json
6357
npm install -g pnpm
6458
pnpm install
6559
pnpm run generate
6660
61+
# Bump version after install so pnpm install doesn't overwrite it
62+
if [ -f package.json ]; then
63+
jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp
64+
mv package.json.tmp package.json
65+
fi
66+
6767
git config user.name "Dokploy Bot"
6868
git config user.email "bot@dokploy.com"
6969

0 commit comments

Comments
 (0)