Files
dify/.github/workflows/cli-edge.yml
T
Stephen Zhou fde800e337 Merge remote-tracking branch 'origin/main' into deploy/konwledge
# Conflicts:
#	.github/dependabot.yml
#	.github/workflows/deploy-dev.yml
#	api/app_factory.py
#	api/core/indexing_runner.py
#	api/services/feature_service.py
#	api/tests/test_containers_integration_tests/controllers/console/auth/test_password_reset.py
#	api/tests/test_containers_integration_tests/services/test_feature_service.py
#	api/tests/unit_tests/controllers/console/auth/test_account_activation.py
#	api/tests/unit_tests/controllers/service_api/app/test_conversation.py
#	api/tests/unit_tests/controllers/web/test_site.py
#	api/tests/unit_tests/core/rag/indexing/test_indexing_runner.py
#	api/tests/unit_tests/core/tools/test_base_tool.py
#	api/tests/unit_tests/extensions/otel/test_retrieval_tracing.py
#	api/tests/unit_tests/extensions/test_ext_login.py
#	api/tests/unit_tests/services/test_feature_service_deployment_edition.py
#	api/tests/unit_tests/services/test_feature_service_knowledge_fs.py
#	api/tests/unit_tests/services/test_feature_service_licensed_seats.py
2026-08-07 09:55:10 +08:00

76 lines
2.6 KiB
YAML

name: CLI Edge Publish
on:
push:
branches: [main, deploy/konwledge]
paths:
- 'cli/**'
- 'packages/contracts/generated/api/openapi/**'
- '.github/workflows/cli-edge.yml'
workflow_dispatch:
concurrency:
group: difyctl-edge-publish
cancel-in-progress: false
jobs:
publish:
name: build + publish edge to R2
runs-on: ${{ github.repository == 'langgenius/dify' && 'depot-ubuntu-24.04' || 'ubuntu-24.04' }}
if: vars.DIFYCTL_R2_BUCKET != ''
defaults:
run:
shell: bash
working-directory: ./cli
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Enable cross-arch native prebuilds
working-directory: ./
run: cat cli/scripts/cross-arch.pnpm.yaml >> pnpm-workspace.yaml
- name: Setup web environment
uses: ./.github/actions/setup-web
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: cli/.bun-version
- name: Compute edge version
id: ver
run: echo "version=$(node scripts/release-naming.mjs edge-version "$(git rev-parse --short HEAD)")" >> "$GITHUB_OUTPUT"
- name: Compile standalone binaries (all targets, all-or-nothing)
run: |
CLI_VERSION="${{ steps.ver.outputs.version }}" \
DIFYCTL_CHANNEL=edge \
DIFYCTL_COMMIT="$(git rev-parse HEAD)" \
DIFYCTL_BUILD_DATE="$(git log -1 --format=%cI HEAD)" \
pnpm build:bin
- name: Generate sha256 checksums
run: CLI_VERSION="${{ steps.ver.outputs.version }}" scripts/release-write-checksums.sh
- name: Smoke the runner-arch binary
run: ./dist/bin/difyctl-v${{ steps.ver.outputs.version }}-linux-x64 version
- name: Publish to R2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DIFYCTL_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DIFYCTL_R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
AWS_REQUEST_CHECKSUM_CALCULATION: WHEN_REQUIRED
AWS_RESPONSE_CHECKSUM_VALIDATION: WHEN_REQUIRED
DIFYCTL_R2_S3_ENDPOINT: ${{ vars.DIFYCTL_R2_S3_ENDPOINT }}
DIFYCTL_R2_BUCKET: ${{ vars.DIFYCTL_R2_BUCKET }}
DIFYCTL_R2_PUBLIC_BASE: ${{ vars.DIFYCTL_R2_PUBLIC_BASE }}
DIFYCTL_COMMIT: ${{ github.sha }}
run: |
DIFYCTL_BUILD_DATE="$(git log -1 --format=%cI HEAD)" \
scripts/release-r2-publish.sh edge "${{ steps.ver.outputs.version }}"