mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
Update the GitHub Actions workflow to include regeneration of tools from the latest OpenAPI specification and ensure the latest openapi.json is copied to the CLI repository. This improves the consistency and accuracy of the versioning and API documentation across both repositories.
80 lines
2.5 KiB
YAML
80 lines
2.5 KiB
YAML
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
|
|
|
|
# Bump version
|
|
jq --arg v "${{ steps.get_version.outputs.version }}" '.version = $v' package.json > package.json.tmp
|
|
mv package.json.tmp package.json
|
|
|
|
# Regenerate tools from latest OpenAPI spec
|
|
npm install -g pnpm
|
|
pnpm install
|
|
pnpm run fetch-openapi
|
|
pnpm run generate
|
|
|
|
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
|
|
|
|
|
|
- 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
|
|
|
|
# Bump version
|
|
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
|
|
|
|
# Copy latest openapi spec and regenerate commands
|
|
cp ../openapi.json ./openapi.json
|
|
npm install -g pnpm
|
|
pnpm install
|
|
pnpm run generate
|
|
|
|
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 }}"
|
|
|