feat(sdk): provider 侧入站 payload 校验——Go/JS/Python 对齐(矩阵缺口补齐) #147
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 SDK Example Images | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/docker-go-sdk-examples.yml" | |
| - "sdks/go/**" | |
| - "sdks/python/**" | |
| - "sdks/java/**" | |
| - "sdks/js/**" | |
| - "sdks/cpp/**" | |
| - "sdks/csharp/**" | |
| - "proto/**" | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| REGISTRY: ghcr.io | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| name: Build ${{ matrix.language }} game demo image | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - language: go | |
| image: ghcr.io/cuihairu/croupier-sdk-go-example-demo | |
| context: sdks/go | |
| dockerfile: sdks/go/examples/Dockerfile | |
| build_args: | | |
| EXAMPLE_DIR=demo | |
| - language: python | |
| image: ghcr.io/cuihairu/croupier-sdk-python-example-demo | |
| context: . | |
| dockerfile: sdks/python/examples/Dockerfile | |
| build_args: "" | |
| - language: java | |
| image: ghcr.io/cuihairu/croupier-sdk-java-example-demo | |
| context: . | |
| dockerfile: sdks/java/examples/Dockerfile | |
| build_args: "" | |
| - language: js | |
| image: ghcr.io/cuihairu/croupier-sdk-js-example-demo | |
| context: . | |
| dockerfile: sdks/js/examples/Dockerfile | |
| build_args: "" | |
| - language: cpp | |
| image: ghcr.io/cuihairu/croupier-sdk-cpp-example-demo | |
| context: . | |
| dockerfile: sdks/cpp/examples/Dockerfile | |
| build_args: "" | |
| - language: csharp | |
| image: ghcr.io/cuihairu/croupier-sdk-csharp-example-demo | |
| context: . | |
| dockerfile: sdks/csharp/examples/Dockerfile | |
| build_args: "" | |
| steps: | |
| - name: Checkout repository | |
| timeout-minutes: 3 | |
| uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| timeout-minutes: 5 | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Log in to Container Registry | |
| timeout-minutes: 3 | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| timeout-minutes: 3 | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ matrix.image }} | |
| tags: | | |
| type=ref,event=branch | |
| type=sha,prefix={{branch}}- | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build JS SDK bundle | |
| if: matrix.language == 'js' | |
| working-directory: sdks/js | |
| run: | | |
| corepack enable | |
| pnpm install --ignore-scripts | |
| pnpm rebuild esbuild | |
| pnpm build:bundle | |
| - name: Prepare JS SDK Docker context | |
| if: matrix.language == 'js' | |
| run: cp sdks/js/dist/examples/game_demo.js sdks/js/examples/game_demo.js | |
| - name: Build and push Docker image | |
| timeout-minutes: 45 | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ${{ matrix.context }} | |
| file: ${{ matrix.dockerfile }} | |
| build-args: ${{ matrix.build_args }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=sdk-demo-${{ matrix.language }} | |
| cache-to: type=gha,mode=max,scope=sdk-demo-${{ matrix.language }} | |
| provenance: false |