99 - staging/**
1010 - feat/**
1111 - feature/**
12+ - staging/**
1213jobs :
1314 unit-tests :
1415 runs-on : warp-ubuntu-latest-x64-16x
2324 with :
2425 node-version : ' 20'
2526 cache : ' yarn'
27+ - name : Install rust
28+ 29+ 30+ with :
31+ # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
32+ version : ' latest'
2633 - name : Install project dependencies
2734 run : yarn --frozen-lockfile
2835 - uses : nrwl/nx-set-shas@v3
@@ -35,21 +42,28 @@ jobs:
3542 integration-tests :
3643 runs-on : ubuntu-latest
3744 timeout-minutes : 30
38- env :
39- DATIL_COMMIT_HASH : ae3c20e07eb933b61073689b95f56867c03de252
4045 steps :
4146 - name : Checkout repo
4247 uses : actions/checkout@v2
4348 with :
4449 fetch-depth : 0
45- - name : Checkout Lit Actions
50+ - name : Find latest datil commit hash for last successful "rust/lit-node-build-commit-hash" workflow in the Lit Assets repo
51+ uses : LIT-Protocol/last-successful-build-action@372ea3325a894558ee74d970217ca421ea562fba
52+ id : last-successful-build
53+ with :
54+ token : " ${{ secrets.GH_PAT_FOR_SHIVA }}"
55+ branch : " datil"
56+ workflow : " rust/lit-node-build-commit-hash"
57+ repo : LIT-Protocol/lit-assets
58+ # this outputs to dollarSign{{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }}
59+ - name : Checkout Lit Assets
4660 uses : actions/checkout@v4
4761 id : checkout
4862 with :
4963 fetch-depth : 0
5064 repository : LIT-Protocol/lit-assets
51- ref : ${{env.DATIL_COMMIT_HASH }}
52- token : ${{secrets.GH_PAT }}
65+ ref : ${{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }}
66+ token : ${{secrets.GH_PAT_FOR_SHIVA }}
5367 path : ${{ github.workspace }}/lit-assets/
5468 submodules : false
5569 sparse-checkout : |
@@ -62,17 +76,21 @@ jobs:
6276 working-directory : ${{github.workspace}}/lit-assets/blockchain/contracts
6377 - name : Docker login
6478 id : login
65- run : docker login ghcr.io/ -u ${{secrets.GH_USER }} --password ${{secrets.GH_PAT }}
79+ run : docker login ghcr.io/ -u ${{ github.actor }} --password ${{secrets.GH_PAT_FOR_SHIVA }}
6680 - name : Pull Shiva Container
6781 id : shiva-pull
6882 run : docker pull ghcr.io/lit-protocol/shiva:latest
6983 - name : Run Shiva Container
7084 id : shiva-runner
71- run : docker run -d -m 32g -p 8000:8000 -p 8545:8545 -p 7470:7470 -p 7471:7471 -p 7472:7472 -p 7473:7473 -p 7474:7474 -p 7475:7475 -v ${{github.workspace}}/lit-assets:/data -e GH_PAT=${{secrets.GH_PAT }} -e HASH=$DATIL_COMMIT_HASH -e IPFS_API_KEY=${{secrets.IPFS_API_KEY}} --name shiva ghcr.io/lit-protocol/shiva:latest
85+ run : docker run -d -m 32g -p 8000:8000 -p 8545:8545 -p 7470:7470 -p 7471:7471 -p 7472:7472 -p 7473:7473 -p 7474:7474 -p 7475:7475 -v ${{github.workspace}}/lit-assets:/data -e GH_PAT=${{secrets.GH_PAT_FOR_SHIVA }} -e HASH=${{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }} -e IPFS_API_KEY=${{secrets.IPFS_API_KEY}} --name shiva ghcr.io/lit-protocol/shiva:latest
7286 - name : Set up Node.js
7387 uses : actions/setup-node@v3
7488 with :
7589 node-version : ' 20'
90+ 91+ with :
92+ # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
93+ version : ' latest'
7694 - name : Install project dependencies
7795 run : yarn --frozen-lockfile
7896 - uses : nrwl/nx-set-shas@v3
@@ -95,4 +113,34 @@ jobs:
95113 run : docker stop shiva && docker rm shiva
96114 - name : Post Pull Shiva Image
97115 if : steps.shiva-pull.outputs.exit_code == 0
98- run : docker rmi ghcr.io/lit-protocol/shiva
116+ run : docker rmi ghcr.io/lit-protocol/shiva
117+ ping-lit-configuration-guides :
118+ runs-on : ubuntu-latest
119+ # needs: [unit-tests, integration-tests] # Make sure this job runs after others complete
120+ steps :
121+ - name : Get PR labels
122+ id : pr-labels
123+ uses : actions/github-script@v6
124+ if : github.event_name == 'pull_request'
125+ with :
126+ script : |
127+ const labels = context.payload.pull_request.labels
128+ .map(label => label.name)
129+ .filter(name => name.startsWith('tag:'))
130+ .map(name => name.split(':')[1]);
131+ if (labels.length > 0) {
132+ core.setOutput('tag', labels[0]);
133+ } else {
134+ core.setOutput('skip', 'true');
135+ }
136+ - name : Trigger dependencies bot in lit-configuration-guides
137+ if : steps.pr-labels.outputs.skip != 'true'
138+ run : |
139+ TAG="${{ steps.pr-labels.outputs.tag }}"
140+ curl -X POST \
141+ -H "Accept: application/vnd.github.everest-preview+json" \
142+ -H "Authorization: token ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}" \
143+ https://api.github.com/repos/LIT-Protocol/lit-configuration-guides/dispatches \
144+ -d "{\"event_type\":\"dependency_update\", \"client_payload\": {\"labels\": [\"$TAG\"]}}"
145+ env :
146+ GH_PAT_LIT_CONFIGURATION_GUIDES_REPO : ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}
0 commit comments