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+ uses : actions-rs/toolchain@v1
29+ with :
30+ toolchain : 1.83.0
31+ override : true
32+ components : rust-std
33+ 34+ with :
35+ # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
36+ version : ' latest'
2637 - name : Install project dependencies
2738 run : yarn --frozen-lockfile
2839 - uses : nrwl/nx-set-shas@v3
@@ -35,21 +46,28 @@ jobs:
3546 integration-tests :
3647 runs-on : ubuntu-latest
3748 timeout-minutes : 30
38- env :
39- DATIL_COMMIT_HASH : ae3c20e07eb933b61073689b95f56867c03de252
4049 steps :
4150 - name : Checkout repo
4251 uses : actions/checkout@v2
4352 with :
4453 fetch-depth : 0
45- - name : Checkout Lit Actions
54+ - name : Find latest datil commit hash for last successful "rust/lit-node-build-commit-hash" workflow in the Lit Assets repo
55+ uses : LIT-Protocol/last-successful-build-action@372ea3325a894558ee74d970217ca421ea562fba
56+ id : last-successful-build
57+ with :
58+ token : " ${{ secrets.GH_PAT_FOR_SHIVA }}"
59+ branch : " datil"
60+ workflow : " rust/lit-node-build-commit-hash"
61+ repo : LIT-Protocol/lit-assets
62+ # this outputs to dollarSign{{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }}
63+ - name : Checkout Lit Assets
4664 uses : actions/checkout@v4
4765 id : checkout
4866 with :
4967 fetch-depth : 0
5068 repository : LIT-Protocol/lit-assets
51- ref : ${{env.DATIL_COMMIT_HASH }}
52- token : ${{secrets.GH_PAT }}
69+ ref : ${{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }}
70+ token : ${{secrets.GH_PAT_FOR_SHIVA }}
5371 path : ${{ github.workspace }}/lit-assets/
5472 submodules : false
5573 sparse-checkout : |
@@ -62,17 +80,21 @@ jobs:
6280 working-directory : ${{github.workspace}}/lit-assets/blockchain/contracts
6381 - name : Docker login
6482 id : login
65- run : docker login ghcr.io/ -u ${{secrets.GH_USER }} --password ${{secrets.GH_PAT }}
83+ run : docker login ghcr.io/ -u ${{ github.actor }} --password ${{secrets.GH_PAT_FOR_SHIVA }}
6684 - name : Pull Shiva Container
6785 id : shiva-pull
6886 run : docker pull ghcr.io/lit-protocol/shiva:latest
6987 - name : Run Shiva Container
7088 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
89+ 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
7290 - name : Set up Node.js
7391 uses : actions/setup-node@v3
7492 with :
7593 node-version : ' 20'
94+ 95+ with :
96+ # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
97+ version : ' latest'
7698 - name : Install project dependencies
7799 run : yarn --frozen-lockfile
78100 - uses : nrwl/nx-set-shas@v3
@@ -95,4 +117,34 @@ jobs:
95117 run : docker stop shiva && docker rm shiva
96118 - name : Post Pull Shiva Image
97119 if : steps.shiva-pull.outputs.exit_code == 0
98- run : docker rmi ghcr.io/lit-protocol/shiva
120+ run : docker rmi ghcr.io/lit-protocol/shiva
121+ ping-lit-configuration-guides :
122+ runs-on : ubuntu-latest
123+ # needs: [unit-tests, integration-tests] # Make sure this job runs after others complete
124+ steps :
125+ - name : Get PR labels
126+ id : pr-labels
127+ uses : actions/github-script@v6
128+ if : github.event_name == 'pull_request'
129+ with :
130+ script : |
131+ const labels = context.payload.pull_request.labels
132+ .map(label => label.name)
133+ .filter(name => name.startsWith('tag:'))
134+ .map(name => name.split(':')[1]);
135+ if (labels.length > 0) {
136+ core.setOutput('tag', labels[0]);
137+ } else {
138+ core.setOutput('skip', 'true');
139+ }
140+ - name : Trigger dependencies bot in lit-configuration-guides
141+ if : steps.pr-labels.outputs.skip != 'true'
142+ run : |
143+ TAG="${{ steps.pr-labels.outputs.tag }}"
144+ curl -X POST \
145+ -H "Accept: application/vnd.github.everest-preview+json" \
146+ -H "Authorization: token ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}" \
147+ https://api.github.com/repos/LIT-Protocol/lit-configuration-guides/dispatches \
148+ -d "{\"event_type\":\"dependency_update\", \"client_payload\": {\"labels\": [\"$TAG\"]}}"
149+ env :
150+ GH_PAT_LIT_CONFIGURATION_GUIDES_REPO : ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}
0 commit comments