delete manifest #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push MCP DataFlow Server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'mcp-dataflow/**' | |
| - '.github/workflows/mcp-dataflow.yml' | |
| tags: | |
| - 'mcp-v*' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'mcp-dataflow/**' | |
| - '.github/workflows/mcp-dataflow.yml' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ilyario/mcp-dataflow | |
| GO_VERSION: '1.21' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install Task | |
| uses: arduino/setup-task@v1 | |
| with: | |
| version: 3.x | |
| - name: Download dependencies | |
| working-directory: ./mcp-dataflow | |
| run: task deps | |
| - name: Run tests | |
| working-directory: ./mcp-dataflow | |
| run: task test | |
| - name: Run linter | |
| working-directory: ./mcp-dataflow | |
| run: task lint || true | |
| build-binaries: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goos: [linux, darwin, windows] | |
| goarch: [amd64, arm64] | |
| exclude: | |
| - goos: windows | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install Task | |
| uses: arduino/setup-task@v1 | |
| with: | |
| version: 3.x | |
| - name: Download dependencies | |
| working-directory: ./mcp-dataflow | |
| run: task deps | |
| - name: Build binary | |
| working-directory: ./mcp-dataflow | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| OUTPUT="dist/mcp-dataflow-${GOOS}-${GOARCH}" | |
| if [ "$GOOS" = "windows" ]; then | |
| OUTPUT="${OUTPUT}.exe" | |
| fi | |
| CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -a -installsuffix cgo -o ${OUTPUT} cmd/server/main.go | |
| - name: Upload binaries | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: mcp-dataflow/dist/mcp-dataflow-${{ matrix.goos }}-${{ matrix.goarch }}* | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| needs: [test] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha,prefix={{branch}}- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=raw,value=mcp-latest,enable={{is_default_branch}} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./mcp-dataflow | |
| file: ./mcp-dataflow/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| create-release: | |
| needs: [build-binaries, build-and-push] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/mcp-v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get tag name | |
| id: tag | |
| run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Prepare release assets | |
| run: | | |
| mkdir -p release-assets | |
| find dist -type f -executable -o -name "*.exe" | while read file; do | |
| cp "$file" release-assets/ | |
| done | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| NOTES=$(git log --pretty=format:"- %s (%h)" --no-merges) | |
| else | |
| NOTES=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges) | |
| fi | |
| echo "notes<<EOF" >> $GITHUB_OUTPUT | |
| echo "$NOTES" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.TAG_NAME }} | |
| name: MCP DataFlow Server ${{ steps.tag.outputs.TAG_NAME }} | |
| body: | | |
| ## Что нового в ${{ steps.tag.outputs.TAG_NAME }} | |
| ${{ steps.release_notes.outputs.notes }} | |
| ## Docker образ | |
| Docker образ доступен по адресу: | |
| ``` | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG_NAME }} | |
| ``` | |
| ## Установка | |
| ### Docker | |
| ```bash | |
| docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG_NAME }} | |
| ``` | |
| ### Бинарник | |
| Скачайте бинарник для вашей платформы из раздела Assets ниже. | |
| files: release-assets/* | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true |