Canoe: Stymie roll blank while emulated #3206
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
| # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
| name: Dev Server CI | |
| on: | |
| push: | |
| branches: [ "develop" ] | |
| repository_dispatch: | |
| types: [dep_update_dev] | |
| workflow_dispatch: | |
| jobs: | |
| build-dev: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| gameslib_version: ${{ steps.capture_versions.outputs.gameslib_version }} | |
| renderer_version: ${{ steps.capture_versions.outputs.renderer_version }} | |
| source_run_id: ${{ github.run_id }} | |
| # strategy: | |
| # matrix: | |
| # node-version: [16.x, 18.x, 20.x] | |
| # # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: "develop" | |
| - name: Use Node.js 18.x | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18.x | |
| cache: 'npm' | |
| - run: echo "@abstractplay:registry=https://npm.pkg.github.com/" >> .npmrc | |
| - run: echo "//npm.pkg.github.com/:_authToken=${{secrets.PAT_READ_PACKAGES}}" >> .npmrc | |
| - run: npm ci | |
| - name: Install renderer dependency | |
| run: | | |
| if [ "${{ github.event_name }}" = "repository_dispatch" ] && [ -n "${{ github.event.client_payload.renderer_version }}" ]; then | |
| npm install @abstractplay/renderer@${{ github.event.client_payload.renderer_version }} | |
| else | |
| npm install @abstractplay/renderer@development | |
| fi | |
| - run: npm list @abstractplay/renderer | |
| - run: npm list @svgdotjs/svg.js | |
| - run: ls node_modules | grep @svgdotjs | |
| - run: npm test --if-present | |
| # --- MACHINE TRANSLATION PIPELINE START --- | |
| - name: Run Machine Translation on Locales | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| run: node scripts/translate.mjs locales/en/apgames.json locales/en/apresults.json | |
| - name: Auto-commit Updated Translations Back to Branch | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "i18n: Auto-translate locale files [skip ci]" | |
| # Directory paths only — no globs/braces. git-auto-commit passes file_pattern | |
| # to `git add` with disable_globbing, so `*.json` and `{de,fr,it}` never expand. | |
| file_pattern: locales/de/ locales/fr/ locales/it/ locales/es-US/ locale-src/de/ locale-src/fr/ locale-src/it/ locale-src/es-US/ | |
| disable_globbing: true | |
| - name: Verify locale-src was committed | |
| run: | | |
| if git status --porcelain locale-src/ | grep -q .; then | |
| echo "::error::locale-src/ has unstaged changes after auto-commit — sidecar stamps were not pushed" | |
| git status --porcelain locale-src/ | |
| exit 1 | |
| fi | |
| - name: Upload translation debug artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: translate-debug-${{ github.run_id }} | |
| path: bin/translate-debug/ | |
| if-no-files-found: ignore | |
| # --- MACHINE TRANSLATION PIPELINE END --- | |
| - name: Configure AWS credentials | |
| uses: Fooji/create-aws-profile-action@v1 | |
| with: | |
| profile: AbstractPlayDev | |
| region: us-east-1 | |
| key: ${{ secrets.AWS_KEY }} | |
| secret: ${{ secrets.AWS_SECRET }} | |
| - name: Publish locale files to S3 | |
| run: node scripts/publish-locales.mjs --stage dev | |
| # prerelease --preid=ci-$GITHUB_RUN_ID | |
| - run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version | |
| - id: capture_versions | |
| run: | | |
| GAMESLIB_VERSION=$(node -p "require('./package.json').version") | |
| RENDERER_VERSION=$(node -p "require('./node_modules/@abstractplay/renderer/package.json').version") | |
| npm pkg set "dependencies.@abstractplay/renderer=$RENDERER_VERSION" | |
| echo "gameslib_version=$GAMESLIB_VERSION" >> $GITHUB_OUTPUT | |
| echo "renderer_version=$RENDERER_VERSION" >> $GITHUB_OUTPUT | |
| - run: npm run build | |
| - run: npm pack | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: "*.tgz" | |
| - name: Trigger docs rebuild | |
| if: github.event_name == 'push' | |
| run: | | |
| BEFORE="${{ github.event.before }}" | |
| SHA="${{ github.sha }}" | |
| if [[ "$BEFORE" == "0000000000000000000000000000000000000000" ]]; then | |
| CHANGED="" | |
| for commit in ${{ join(github.event.commits.*.id, ' ') }}; do | |
| git fetch --depth=1 origin "$commit" | |
| CHANGED+="$(git show --name-only --pretty=format: "$commit")"$'\n' | |
| done | |
| else | |
| git fetch --depth=1 origin "$BEFORE" | |
| CHANGED="$(git diff --name-only "$BEFORE" "$SHA")" | |
| fi | |
| if echo "$CHANGED" | grep -q '^docs/'; then | |
| curl -L \ | |
| -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PAT_WORKFLOWS }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/AbstractPlay/docs/dispatches \ | |
| -d '{"event_type":"dep_update_dev"}' | |
| fi | |
| publish-dev: | |
| needs: [build-dev] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Upload | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18.x | |
| registry-url: https://npm.pkg.github.com/ | |
| scope: "@abstractplay" | |
| - run: echo "registry=https://npm.pkg.github.com/@abstractplay" > .npmrc | |
| - run: npm publish $(ls *.tgz) --tag development | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| deploy-playground: | |
| needs: [publish-dev] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: "develop" | |
| - name: Use Node.js 18.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| cache: 'npm' | |
| - run: echo "@abstractplay:registry=https://npm.pkg.github.com/" >> .npmrc | |
| - run: echo "//npm.pkg.github.com/:_authToken=${{secrets.PAT_READ_PACKAGES}}" >> .npmrc | |
| - run: npm ci | |
| - run: npm install @abstractplay/renderer@development | |
| - run: npm run dist-dev | |
| - name: Configure AWS credentials | |
| uses: Fooji/create-aws-profile-action@v1 | |
| with: | |
| profile: AbstractPlayDev | |
| region: us-east-1 | |
| key: ${{ secrets.AWS_KEY }} | |
| secret: ${{ secrets.AWS_SECRET }} | |
| - name: Deploy playground | |
| env: | |
| AWS_SDK_LOAD_CONFIG: "1" | |
| AWS_PROFILE: AbstractPlayDev | |
| run: npm run deploy:ci | |
| relay-dev: | |
| needs: [deploy-playground, build-dev] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger consumer rebuilds | |
| env: | |
| GAMESLIB_VERSION: ${{ needs.build-dev.outputs.gameslib_version }} | |
| RENDERER_VERSION: ${{ needs.build-dev.outputs.renderer_version }} | |
| SOURCE_RUN_ID: ${{ needs.build-dev.outputs.source_run_id }} | |
| run: | | |
| payload=$(jq -n \ | |
| --arg g "$GAMESLIB_VERSION" \ | |
| --arg r "$RENDERER_VERSION" \ | |
| --arg s "$SOURCE_RUN_ID" \ | |
| '{event_type:"dep_update_dev", client_payload:{gameslib_version:$g, renderer_version:$r, source_run_id:$s}}') | |
| for repo in front node-backend backend-crons backend-thumbnails; do | |
| curl -L -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PAT_WORKFLOWS }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "https://api.github.com/repos/abstractplay/${repo}/dispatches" \ | |
| -d "$payload" | |
| done |