diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aebe83fd8..0148466e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: types: - created +env: + IS_A_PR: ${{ github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad' }} + name: CI jobs: lint: @@ -108,6 +111,13 @@ jobs: 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: + - name: (PR) Check if it's a PR + if: ${{ env.IS_A_PR == 'true' }} + run: | + echo "run from a PR" + echo "from env '${{env.IS_A_PR}}'" + echo "- '${{github.event.pull_request.number}}'" + echo "- env '${{github.head_ref}}'" - uses: actions/checkout@master - uses: actions/setup-node@v3 with: @@ -121,7 +131,7 @@ jobs: run: make install - name: update version of packages/@dcl/sdk/package.json, this version will be used for all packages - uses: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 with: cwd: ./packages/@dcl/sdk deterministic-snapshot: true @@ -142,9 +152,11 @@ jobs: - name: publish @dcl/js-runtime package id: publish_dcl_js_runtime - uses: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/js-runtime ## use action runId instead of current date to generate snapshot numbers @@ -155,15 +167,18 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/js-runtime' env: + BRANCH_NAME: ${{ github.head_ref }} 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: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 id: publish_ecs with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/ecs ## use action runId instead of current date to generate snapshot numbers @@ -174,13 +189,14 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/ecs' env: + BRANCH_NAME: ${{ github.head_ref }} 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 }} + if: ${{ env.IS_A_PR == 'true' }} run: | node -e "\ let pkg=require('./package.json');\ @@ -192,9 +208,11 @@ jobs: - name: publish @dcl/react-ecs package id: publish_dcl_react_ecs - uses: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/react-ecs ## use action runId instead of current date to generate snapshot numbers @@ -205,15 +223,18 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/react-ecs' env: + BRANCH_NAME: ${{ github.head_ref }} 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: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 id: publish_decentraland_inspector with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/inspector ## use action runId instead of current date to generate snapshot numbers @@ -224,13 +245,14 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/inspector' env: + BRANCH_NAME: ${{ github.head_ref }} 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 }} + if: ${{ env.IS_A_PR == 'true' }} run: | node -e "\ let pkg=require('./package.json');\ @@ -243,10 +265,12 @@ jobs: INSPECTOR_URL: ${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ steps.publish_decentraland_inspector.outputs.s3-bucket-key }} - name: publish @dcl/sdk-commands package - uses: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 id: publish_decentraland_sdk_commands with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/sdk-commands ## use action runId instead of current date to generate snapshot numbers @@ -257,13 +281,14 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' env: + BRANCH_NAME: ${{ github.head_ref }} 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 }} + if: ${{ env.IS_A_PR == 'true' }} run: | node -e "\ let pkg=require('./package.json');\ @@ -283,10 +308,12 @@ jobs: 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: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 id: publish_decentraland_sdk with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/sdk ## use action runId instead of current date to generate snapshot numbers @@ -297,6 +324,7 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' env: + BRANCH_NAME: ${{ github.head_ref }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} @@ -308,10 +336,12 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }} - name: publish @dcl/playground-assets package - uses: menduz/oddish-action@master + uses: leanmendoza/oddish-action@patch-1 id: publish_playground_assets with: registry-url: 'https://registry.npmjs.org' + custom-tag: protocol-squad + branch-to-custom-tag: protocol-squad access: public cwd: ./packages/@dcl/playground-assets ## use action runId instead of current date to generate snapshot numbers @@ -322,12 +352,13 @@ jobs: s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }} s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}' env: + BRANCH_NAME: ${{ github.head_ref }} 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 }} + if: github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad' runs-on: ubuntu-latest name: Deployment Notification steps: