Skip to content

Commit 3001941

Browse files
committed
w
1 parent e768832 commit 3001941

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ on:
99
- created
1010

1111
env:
12-
BRANCH_TAG: ${{ github.ref_name == 'protocol-squad' && 'protocol-squad' || '' }}
13-
IS_A_PR: ${{ github.event.pull_request.number != 'null' && github.ref_name != 'protocol-squad' }}
12+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
13+
BRANCH_TAG: ${{ (github.head_ref || github.ref_name) == 'protocol-squad' && 'protocol-squad' || '' }}
14+
IS_A_PR: ${{ github.event_name == 'pull_request' && (github.head_ref || github.ref_name) != 'protocol-squad' }}
15+
1416

1517
name: CI
1618
jobs:
@@ -76,7 +78,7 @@ jobs:
7678
- uses: actions/github-script@v6
7779
id: get-cloudflare-url
7880
env:
79-
BRANCH: ${{ github.head_ref || github.ref }}
81+
BRANCH: ${{ env.BRANCH_NAME }}
8082
with:
8183
script: return `${process.env.BRANCH.replaceAll('/', '-').substr(0, 28)}.${context.repo.repo}.pages.dev`
8284
result-encoding: string
@@ -156,11 +158,10 @@ jobs:
156158
## publish every package to s3
157159
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
158160
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
159-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/js-runtime'
161+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}/@dcl/js-runtime'
160162
custom-tag: ${{ env.BRANCH_TAG }}
161163
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
162164
env:
163-
BRANCH_NAME: ${{ github.ref_name }}
164165
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
165166
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
166167
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}
@@ -179,7 +180,7 @@ jobs:
179180
## publish every package to s3
180181
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
181182
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
182-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/ecs'
183+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}/@dcl/ecs'
183184
custom-tag: ${{ env.BRANCH_TAG }}
184185
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
185186
env:
@@ -214,7 +215,7 @@ jobs:
214215
## publish every package to s3
215216
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
216217
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
217-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/react-ecs'
218+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}/@dcl/react-ecs'
218219
custom-tag: ${{ env.BRANCH_TAG }}
219220
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
220221
env:
@@ -238,7 +239,7 @@ jobs:
238239
## publish every package to s3
239240
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
240241
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
241-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}/@dcl/inspector'
242+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}/@dcl/inspector'
242243
custom-tag: ${{ env.BRANCH_TAG }}
243244
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
244245
env:
@@ -275,7 +276,7 @@ jobs:
275276
## publish every package to s3
276277
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
277278
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
278-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}'
279+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}'
279280
custom-tag: ${{ env.BRANCH_TAG }}
280281
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
281282
env:
@@ -319,7 +320,7 @@ jobs:
319320
## publish every package to s3
320321
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
321322
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
322-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}'
323+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}'
323324
custom-tag: ${{ env.BRANCH_TAG }}
324325
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
325326
env:
@@ -329,7 +330,7 @@ jobs:
329330
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}
330331

331332
- name: playground upload to s3
332-
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'
333+
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/${{ env.BRANCH_NAME }}/playground-assets'
333334
env:
334335
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
335336
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}
@@ -348,7 +349,7 @@ jobs:
348349
## publish every package to s3
349350
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
350351
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}
351-
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ github.head_ref || github.ref }}'
352+
s3-bucket-key-prefix: '@dcl/js-sdk-toolchain/branch/${{ env.BRANCH_NAME }}'
352353
custom-tag: ${{ env.BRANCH_TAG }}
353354
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
354355
env:
@@ -358,14 +359,14 @@ jobs:
358359
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}
359360
notify_deployment:
360361
needs: [build]
361-
if: github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad'
362+
if: github.event.pull_request.number
362363
runs-on: ubuntu-latest
363364
name: Deployment Notification
364365
steps:
365366
- uses: actions/github-script@v6
366367
id: get-cloudflare-url
367368
env:
368-
BRANCH: ${{ github.head_ref || github.ref }}
369+
BRANCH: ${{ env.BRANCH_NAME }}
369370
with:
370371
script: return `${process.env.BRANCH.replaceAll('/', '-').substr(0, 28)}.${context.repo.repo}.pages.dev`
371372
result-encoding: string
@@ -400,13 +401,13 @@ jobs:
400401
npm install "${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.build.outputs.decentraland_inspector_s3_bucket_key }}"
401402
```
402403
403-
- 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)
404+
- The `/changerealm` command to test [test in-world](https://play.decentraland.zone/?realm=${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{ env.BRANCH_NAME }}-e2e)
404405
```
405-
/changerealm ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{ github.head_ref || github.ref }}-e2e
406+
/changerealm ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{ env.BRANCH_NAME }}-e2e
406407
```
407408
408409
- You can preview this build entering:
409-
https://playground.decentraland.org/?sdk-branch=${{ github.head_ref || github.ref }}
410+
https://playground.decentraland.org/?sdk-branch=${{ env.BRANCH_NAME }}
410411
edit-mode: replace
411412
- name: Test SDK Install S3 URL
412413
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 }}"
@@ -436,7 +437,7 @@ jobs:
436437

437438
- name: Set Realm Name
438439
run: |
439-
modified_realm=$(echo "${{ github.head_ref || github.ref }}" | tr '/' '-' | tr -d '@')
440+
modified_realm=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-' | tr -d '@')
440441
echo "REALM_NAME=${modified_realm}" >> $GITHUB_ENV
441442
- name: export-static
442443
run: >

0 commit comments

Comments
 (0)