fix camera movement #7050
Workflow file for this run
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
| on: | |
| push: | |
| branches: | |
| - main | |
| - experimental | |
| pull_request: | |
| release: | |
| types: | |
| - created | |
| env: | |
| BRANCH_TAG: ${{ github.ref_name == 'experimental' && 'experimental' || '' }} | |
| name: CI | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: install | |
| run: make install | |
| - name: lint | |
| run: make lint | |
| - name: lint-packages | |
| run: make lint-packages | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: docs | |
| run: make docs | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: install | |
| run: make install | |
| - name: build | |
| run: make build | |
| - name: test | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| run: make test-coverage | |
| - name: test-cli | |
| run: make test-cli | |
| - name: test-inspector | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| run: make test-inspector | |
| - uses: codecov/codecov-action@v3 | |
| if: always() | |
| with: | |
| fail_ci_if_error: false # optional (default = false) | |
| verbose: true # optional (default = false) | |
| - name: prepare releasable packages | |
| run: make prepare | |
| test-e2e: | |
| needs: [notify_deployment] | |
| runs-on: ubuntu-latest | |
| if: false | |
| steps: | |
| - uses: actions/github-script@v6 | |
| id: get-cloudflare-url | |
| env: | |
| BRANCH: ${{ github.head_ref || github.ref }} | |
| with: | |
| script: return `${process.env.BRANCH.replaceAll('/', '-').substr(0, 28)}.${context.repo.repo}.pages.dev` | |
| result-encoding: string | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: install repo | |
| run: npm ci | |
| - name: install inspector | |
| run: cd packages/@dcl/inspector && npm i && cd ../../../ | |
| - name: test-inspector E2E | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| run: E2E_URL=https://${{steps.get-cloudflare-url.outputs.result}}/inspector make test-inspector-e2e | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| outputs: | |
| decentraland_sdk_s3_bucket_key: ${{ steps.publish_decentraland_sdk.outputs.s3-bucket-key }} | |
| decentraland_sdk_commands_s3_bucket_key: ${{ steps.publish_decentraland_sdk_commands.outputs.s3-bucket-key }} | |
| decentraland_inspector_s3_bucket_key: ${{ steps.publish_decentraland_inspector.outputs.s3-bucket-key }} | |
| decentraland_js_runtime_s3_bucket_key: ${{ steps.publish_dcl_js_runtime.outputs.s3-bucket-key }} | |
| decentraland_ecs_bucket_key: ${{ steps.publish_ecs.outputs.s3-bucket-key }} | |
| steps: | |
| - uses: actions/checkout@master | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: install | |
| run: make install | |
| - name: update version of packages/@dcl/sdk/package.json, this version will be used for all packages | |
| uses: decentraland/oddish-action@master | |
| with: | |
| cwd: ./packages/@dcl/sdk | |
| deterministic-snapshot: true | |
| only-update-versions: true | |
| - name: build | |
| run: make build | |
| - name: prepare releasable packages | |
| run: make prepare | |
| - name: 'Upload Artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-artifacts | |
| path: 'packages/**/*.tgz' | |
| retention-days: 5 | |
| - name: publish @dcl/js-runtime package | |
| id: publish_dcl_js_runtime | |
| uses: decentraland/oddish-action@master | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/js-runtime | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/js-runtime' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: publish @dcl/ecs package | |
| uses: decentraland/oddish-action@master | |
| id: publish_ecs | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/ecs | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/ecs' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: (PR) change @dcl/react-ecs dependencies versions to point to s3 url | |
| working-directory: ./packages/@dcl/react-ecs | |
| if: ${{ github.event.pull_request.number }} | |
| run: | | |
| node -e "\ | |
| let pkg=require('./package.json');\ | |
| pkg.dependencies['@dcl/ecs']='$ECS_S3_URL';\ | |
| require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\ | |
| " | |
| env: | |
| ECS_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_ecs.outputs.s3-bucket-key }} | |
| - name: publish @dcl/react-ecs package | |
| id: publish_dcl_react_ecs | |
| uses: decentraland/oddish-action@master | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/react-ecs | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/react-ecs' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: publish @dcl/inspector package | |
| uses: decentraland/oddish-action@master | |
| id: publish_decentraland_inspector | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/inspector | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/inspector' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: (PR) change @dcl/sdk-commands dependencies versions to point to s3 url | |
| working-directory: ./packages/@dcl/sdk-commands | |
| if: ${{ github.event.pull_request.number }} | |
| run: | | |
| node -e "\ | |
| let pkg=require('./package.json');\ | |
| pkg.dependencies['@dcl/inspector']='$INSPECTOR_URL';\ | |
| pkg.dependencies['@dcl/ecs']='$ECS_S3_URL';\ | |
| require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\ | |
| " | |
| env: | |
| ECS_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_ecs.outputs.s3-bucket-key }} | |
| INSPECTOR_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_decentraland_inspector.outputs.s3-bucket-key }} | |
| - name: publish @dcl/sdk-commands package | |
| uses: decentraland/oddish-action@master | |
| id: publish_decentraland_sdk_commands | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/sdk-commands | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: (PR) change @dcl/sdk version to s3 url | |
| working-directory: ./packages/@dcl/sdk | |
| if: ${{ github.event.pull_request.number }} | |
| run: | | |
| node -e "\ | |
| let pkg=require('./package.json');\ | |
| pkg.dependencies['@dcl/inspector']='$INSPECTOR_URL';\ | |
| pkg.dependencies['@dcl/js-runtime']='$JS_RUNTIME_S3_URL';\ | |
| pkg.dependencies['@dcl/ecs']='$ECS_S3_URL';\ | |
| pkg.dependencies['@dcl/react-ecs']='$REACT_ECS_S3_URL';\ | |
| pkg.dependencies['@dcl/sdk-commands']='$SDK_COMMANDS_S3_URL';\ | |
| require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\ | |
| " | |
| env: | |
| INSPECTOR_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_decentraland_inspector.outputs.s3-bucket-key }} | |
| REACT_ECS_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_dcl_react_ecs.outputs.s3-bucket-key }} | |
| ECS_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_ecs.outputs.s3-bucket-key }} | |
| ROLLUP_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_dcl_rollup.outputs.s3-bucket-key }} | |
| JS_RUNTIME_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_dcl_js_runtime.outputs.s3-bucket-key }} | |
| SDK_COMMANDS_S3_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_decentraland_sdk_commands.outputs.s3-bucket-key }} | |
| - name: publish @dcl/sdk package | |
| uses: decentraland/oddish-action@master | |
| id: publish_decentraland_sdk | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/sdk | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: playground upload to s3 | |
| run: npx @dcl/cdn-uploader@next --bucket ${{ secrets.SDK_TEAM_S3_BUCKET }} --local-folder $(pwd)/packages/@dcl/playground-assets/dist --bucket-folder '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/playground-assets' | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| - name: publish @dcl/playground-assets package | |
| uses: decentraland/oddish-action@master | |
| id: publish_playground_assets | |
| with: | |
| registry-url: 'https://registry.npmjs.org' | |
| access: public | |
| cwd: ./packages/@dcl/playground-assets | |
| ## use action runId instead of current date to generate snapshot numbers | |
| deterministic-snapshot: true | |
| ## sign the deployment | |
| provenance: true | |
| ## publish every package to s3 | |
| s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} | |
| s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }} | |
| s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' | |
| custom-tag: ${{ env.BRANCH_TAG }} | |
| branch-to-custom-tag: ${{ env.BRANCH_TAG }} | |
| env: | |
| BRANCH_NAME: ${{ github.ref_name }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| notify_deployment: | |
| needs: [build] | |
| if: ${{ github.event.pull_request.number }} | |
| runs-on: ubuntu-latest | |
| name: Deployment Notification | |
| steps: | |
| - uses: actions/github-script@v6 | |
| id: get-cloudflare-url | |
| env: | |
| BRANCH: ${{ github.head_ref || github.ref }} | |
| with: | |
| script: return `${process.env.BRANCH.replaceAll('/', '-').substr(0, 28)}.${context.repo.repo}.pages.dev` | |
| result-encoding: string | |
| - name: Find Comment | |
| uses: peter-evans/find-comment@v1 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: 'github-actions[bot]' | |
| body-includes: Test this pull request | |
| - name: Create or update comment | |
| uses: peter-evans/create-or-update-comment@v1 | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| # Test this pull request | |
| - The `@dcl/sdk` package can be tested in scenes by running | |
| ```bash | |
| npm install "${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_s3_bucket_key }}" | |
| ``` | |
| - To test with `npx init` | |
| ```bash | |
| export SDK_COMMANDS="${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_commands_s3_bucket_key }}" | |
| npx $SDK_COMMANDS init | |
| ``` | |
| - The `@dcl/inspector` package can be tested by visiting [this url](https://${{steps.get-cloudflare-url.outputs.result}}/inspector) | |
| - Or by installing it via NPM | |
| ```bash | |
| npm install "${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_inspector_s3_bucket_key }}" | |
| ``` | |
| - The `/changerealm` command to test [test in-world](https://play.decentraland.zone/?realm=${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{ github.head_ref || github.ref }}-e2e) | |
| ``` | |
| /changerealm ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{ github.head_ref || github.ref }}-e2e | |
| ``` | |
| - You can preview this build entering: | |
| https://playground.decentraland.org/?sdk-branch=${{ github.head_ref || github.ref }} | |
| edit-mode: replace | |
| - name: Test SDK Install S3 URL | |
| run: mkdir -p test_sdk_s3 && cd test_sdk_s3 && npm init --yes && npm install "${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_s3_bucket_key }}" | |
| - name: Test Inspector Install S3 URL | |
| run: mkdir -p test_inspector_s3 && cd test_inspector_s3 && npm init --yes && npm install "${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_inspector_s3_bucket_key }}" | |
| cli_e2e: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| name: CLI E2E | |
| steps: | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - run: mkdir -p scene | |
| - name: npx @dcl/sdk-commands init --skip-install | |
| run: npx ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_commands_s3_bucket_key }} init --skip-install | |
| working-directory: scene | |
| - name: install CI version of @dcl/sdk | |
| run: npm install ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_s3_bucket_key }} | |
| working-directory: scene | |
| - name: install rest of the dependencies | |
| run: npm install | |
| working-directory: scene | |
| - name: npm run build | |
| run: npm run build | |
| working-directory: scene | |
| - name: Set Realm Name | |
| run: | | |
| modified_realm=$(echo "${{ github.head_ref || github.ref }}" | tr '/' '-' | tr -d '@') | |
| echo "REALM_NAME=${modified_realm}" >> $GITHUB_ENV | |
| - name: export-static | |
| run: > | |
| npx ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_sdk_commands_s3_bucket_key }} \ | |
| export-static \ | |
| --realmName ${{ env.REALM_NAME }}-e2e \ | |
| --commsAdapter ws-room:ws-room-service.decentraland.org/rooms/sdk-${{ github.sha }} \ | |
| --baseUrl ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs \ | |
| --dir scene \ | |
| --destination $(pwd)/out-static | |
| - name: upload to s3 | |
| run: > | |
| npx @dcl/cdn-uploader@next \ | |
| --bucket ${{ secrets.SDK_TEAM_S3_BUCKET }} \ | |
| --local-folder $(pwd)/out-static \ | |
| --bucket-folder 'ipfs' | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} | |
| check-local-deps: | |
| name: Check for development dependencies | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| if: > | |
| (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') || | |
| github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Download prepared packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: built-artifacts | |
| path: downloaded-packages | |
| - name: Set up artifacts for checking | |
| run: | | |
| echo "Setting up built artifacts for checking..." | |
| mkdir -p extracted-packages | |
| # Extract all packages to separate directories | |
| find downloaded-packages -type f -name "*.tgz" | while read pkg; do | |
| if [ -f "$pkg" ]; then | |
| # Get package name from the filename | |
| pkg_name=$(basename "$pkg" .tgz) | |
| # Create directory for this package | |
| mkdir -p "extracted-packages/$pkg_name" | |
| echo "Extracting $pkg to extracted-packages/$pkg_name" | |
| tar -xzf "$pkg" -C "extracted-packages/$pkg_name" | |
| fi | |
| done | |
| # List all extracted packages | |
| echo "Extracted packages:" | |
| find extracted-packages -name "package.json" | sort | |
| - name: Check for local package dependencies | |
| id: dependency-check | |
| continue-on-error: true | |
| run: | | |
| set +e | |
| node .github/scripts/check-no-local-packages.cjs ./extracted-packages > check-output.txt 2>&1 | |
| check_exit_code=$? | |
| set -e | |
| echo "Full output from dependency check:" | |
| cat check-output.txt | |
| if [ $check_exit_code -ne 0 ]; then | |
| grep -i "dependency " check-output.txt > dependency-errors.txt || echo "No specific dependency errors found" > dependency-errors.txt | |
| if [ ! -s dependency-errors.txt ]; then | |
| echo "⚠️ No specific dependency errors found" > dependency-errors.txt | |
| fi | |
| exit 1 | |
| fi | |
| - name: Generate comment content | |
| if: steps.dependency-check.outcome == 'failure' | |
| run: | | |
| echo "## ⚠️ Local Dependencies Detected" >> dependency-check-comment.md | |
| echo "This PR contains package dependencies that use local paths (\`file:\`) or non-allowed URLs (\`http:\`, \`https:\`, \`git:\`)." >> dependency-check-comment.md | |
| echo "These must be published and referenced properly before merging." >> dependency-check-comment.md | |
| echo "### Not allowed dependencies:" >> dependency-check-comment.md | |
| echo '```' >> dependency-check-comment.md | |
| cat dependency-errors.txt >> dependency-check-comment.md | |
| echo '```' >> dependency-check-comment.md | |
| echo "Review the workflow logs for more details." >> dependency-check-comment.md | |
| echo "> **Note:** This comment is automatically updated when the PR is updated." >> dependency-check-comment.md | |
| - name: Find Local Dependencies Comment if check fails | |
| if: ${{ github.event_name == 'pull_request' && steps.dependency-check.outcome == 'failure' }} | |
| uses: peter-evans/find-comment@v3 | |
| id: fc-local-deps | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: 'github-actions[bot]' | |
| body-includes: Local Dependencies Detected | |
| - name: Create or update Local Dependencies Comment if check fails | |
| if: ${{ github.event_name == 'pull_request' && steps.dependency-check.outcome == 'failure' }} | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| comment-id: ${{ steps.fc-local-deps.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: dependency-check-comment.md | |
| edit-mode: replace | |
| - name: Fail check if local dependencies found | |
| if: steps.dependency-check.outcome == 'failure' | |
| run: | | |
| echo "❌ Local package dependencies detected! These must be fixed before merging." | |
| exit 1 |