|
| 1 | +name: Sync version to MCP and CLI repos |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + sync-version: |
| 9 | + name: Sync version to external repos |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout Dokploy repository |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Get version |
| 16 | + id: get_version |
| 17 | + run: | |
| 18 | + VERSION=$(jq -r .version apps/dokploy/package.json) |
| 19 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 20 | + echo "Version: $VERSION" |
| 21 | +
|
| 22 | + - name: Sync version to MCP repository |
| 23 | + run: | |
| 24 | + git clone https://x-access-token:${{ secrets.DOCS_SYNC_TOKEN }}@github.com/dokploy/mcp.git mcp-repo |
| 25 | +
|
| 26 | + cd mcp-repo |
| 27 | +
|
| 28 | + if [ -f package.json ]; then |
| 29 | + jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp |
| 30 | + mv package.json.tmp package.json |
| 31 | + fi |
| 32 | +
|
| 33 | + git config user.name "Dokploy Bot" |
| 34 | + git config user.email "bot@dokploy.com" |
| 35 | +
|
| 36 | + git add -A |
| 37 | + git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" \ |
| 38 | + -m "Source: ${{ github.repository }}@${{ github.sha }}" \ |
| 39 | + -m "Release: ${{ github.event.release.html_url }}" \ |
| 40 | + --allow-empty |
| 41 | +
|
| 42 | + git push |
| 43 | +
|
| 44 | + echo "MCP repo synced to version ${{ steps.get_version.outputs.version }}" |
| 45 | +
|
| 46 | + - name: Sync version to CLI repository |
| 47 | + run: | |
| 48 | + git clone https://x-access-token:${{ secrets.DOCS_SYNC_TOKEN }}@github.com/dokploy/cli.git cli-repo |
| 49 | +
|
| 50 | + cd cli-repo |
| 51 | +
|
| 52 | + if [ -f package.json ]; then |
| 53 | + jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp |
| 54 | + mv package.json.tmp package.json |
| 55 | + fi |
| 56 | +
|
| 57 | + git config user.name "Dokploy Bot" |
| 58 | + git config user.email "bot@dokploy.com" |
| 59 | +
|
| 60 | + git add -A |
| 61 | + git commit -m "chore: bump version to ${{ steps.get_version.outputs.version }}" \ |
| 62 | + -m "Source: ${{ github.repository }}@${{ github.sha }}" \ |
| 63 | + -m "Release: ${{ github.event.release.html_url }}" \ |
| 64 | + --allow-empty |
| 65 | +
|
| 66 | + git push |
| 67 | +
|
| 68 | + echo "CLI repo synced to version ${{ steps.get_version.outputs.version }}" |
0 commit comments