From 599b97da51c5d5d5fbade78f5e587a8fe0e11552 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Wed, 15 Apr 2026 18:50:54 -0600 Subject: [PATCH] feat: add version synchronization workflow for MCP and CLI repositories Implement a GitHub Actions workflow to automatically sync the version from the Dokploy repository to the MCP and CLI repositories upon release. This includes cloning the repositories, updating the package.json version, and committing the changes with relevant metadata, ensuring consistent versioning across platforms. --- .github/workflows/sync-version.yml | 68 ++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/sync-version.yml diff --git a/.github/workflows/sync-version.yml b/.github/workflows/sync-version.yml new file mode 100644 index 000000000..c75988793 --- /dev/null +++ b/.github/workflows/sync-version.yml @@ -0,0 +1,68 @@ +name: Sync version to MCP and CLI repos + +on: + release: + types: [published] + +jobs: + sync-version: + name: Sync version to external repos + runs-on: ubuntu-latest + steps: + - name: Checkout Dokploy repository + uses: actions/checkout@v4 + + - name: Get version + id: get_version + run: | + VERSION=$(jq -r .version apps/dokploy/package.json) + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Version: $VERSION" + + - name: Sync version to MCP repository + run: | + git clone https://x-access-token:${{ secrets.DOCS_SYNC_TOKEN }}@github.com/dokploy/mcp.git mcp-repo + + cd mcp-repo + + if [ -f package.json ]; then + jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp + mv package.json.tmp package.json + fi + + git config user.name "Dokploy Bot" + git config user.email "bot@dokploy.com" + + git add -A + git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" \ + -m "Source: ${{ github.repository }}@${{ github.sha }}" \ + -m "Release: ${{ github.event.release.html_url }}" \ + --allow-empty + + git push + + echo "MCP repo synced to version ${{ steps.get_version.outputs.version }}" + + - name: Sync version to CLI repository + run: | + git clone https://x-access-token:${{ secrets.DOCS_SYNC_TOKEN }}@github.com/dokploy/cli.git cli-repo + + cd cli-repo + + if [ -f package.json ]; then + jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp + mv package.json.tmp package.json + fi + + git config user.name "Dokploy Bot" + git config user.email "bot@dokploy.com" + + git add -A + git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" \ + -m "Source: ${{ github.repository }}@${{ github.sha }}" \ + -m "Release: ${{ github.event.release.html_url }}" \ + --allow-empty + + git push + + echo "CLI repo synced to version ${{ steps.get_version.outputs.version }}"