-
Notifications
You must be signed in to change notification settings - Fork 31
112 lines (99 loc) · 3.78 KB
/
Copy pathdeploy-with-version.yml
File metadata and controls
112 lines (99 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: deploy-with-version
on:
workflow_dispatch:
inputs:
dcl-sdk-package:
type: string
description: '@dcl/sdk package'
default: '@dcl/sdk@latest'
workflow_call:
inputs:
dcl-sdk-package:
type: string
description: '@dcl/sdk package'
default: '@dcl/sdk@latest'
secrets:
SDK_TEAM_S3_BUCKET:
required: true
SDK_TEAM_AWS_ID:
required: true
SDK_TEAM_AWS_SECRET:
required: true
SDK_TEAM_S3_BASE_URL:
required: true
AB_TOKEN:
required: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: actions/github-script@v7
id: extract_version
env:
VERSION: ${{ inputs.dcl-sdk-package }}
with:
script: return `${process.env.VERSION.split('@').slice(-1)[0]}`
result-encoding: string
- uses: actions/github-script@v7
id: get-branch-realm-name
env:
BRANCH: ${{ github.head_ref || github.ref }}
with:
script: return `goerli-plaza-${process.env.BRANCH.replaceAll('/', '-').replaceAll('refs-heads-', '').substr(0, 28)}-${{ steps.extract_version.outputs.result }}`
result-encoding: string
- name: install sdk version
run: npm i ${{inputs.dcl-sdk-package}} --workspaces
- name: install dependencies
run: npm i --workspaces
- name: build
run: npm run build
- name: export-static (branch)
run: >
npm run export-static -- \
--realmName ${{steps.get-branch-realm-name.outputs.result}} \
--commsAdapter fixed-adapter:signed-login:https://worlds-content-server.decentraland.zone/get-comms-adapter/world-dev-goerliplaza.dcl.eth \
--baseUrl '${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs' \
--destination "$(pwd)/ipfs"
- name: upload to s3
run: >
npx @dcl/cdn-uploader@next \
--bucket ${{ secrets.SDK_TEAM_S3_BUCKET }} \
--local-folder "$(pwd)/ipfs" \
--bucket-folder 'ipfs'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}
- name: Asset Bundle converter queue AllPlataforms
if: github.event_name != 'pull_request'
run: >
npx @dcl/opscli queue-ab-conversion-about \
--token ${{ secrets.AB_TOKEN }} \
--prioritize \
--about-url ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{steps.get-branch-realm-name.outputs.result}}/about
- name: Find Comment
uses: peter-evans/find-comment@v1
if: github.event_name == 'pull_request'
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
if: github.event_name == 'pull_request'
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Test this pull request
- [Test in-world](https://play.decentraland.zone/?realm=${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{steps.get-branch-realm-name.outputs.result}})
- Or use this chat command to switch the realm
```bash
/goto ${{ secrets.SDK_TEAM_S3_BASE_URL }}/ipfs/${{steps.get-branch-realm-name.outputs.result}}
```
This PR has been published using the `@dcl/sdk` version `${{ inputs.dcl-sdk-package }}`
edit-mode: replace