@@ -49,14 +49,23 @@ jobs:
4949 uses : actions/checkout@v2
5050 with :
5151 fetch-depth : 0
52- - name : Checkout Lit Actions
52+ - name : Find latest datil commit hash for last successful "rust/lit-node-build-commit-hash" workflow in the Lit Assets repo
53+ uses : LIT-Protocol/last-successful-build-action@372ea3325a894558ee74d970217ca421ea562fba
54+ id : last-successful-build
55+ with :
56+ token : " ${{ secrets.GH_PAT_FOR_SHIVA }}"
57+ branch : " datil"
58+ workflow : " rust/lit-node-build-commit-hash"
59+ repo : LIT-Protocol/lit-assets
60+ # this outputs to dollarSign{{ steps.last-successful-build.outputs.lastSuccessfulBuildSha }}
61+ - name : Checkout Lit Assets
5362 uses : actions/checkout@v4
5463 id : checkout
5564 with :
5665 fetch-depth : 0
5766 repository : LIT-Protocol/lit-assets
5867 ref : ${{env.NAGA_COMMIT_HASH}}
59- token : ${{secrets.GH_PAT }}
68+ token : ${{secrets.GH_PAT_FOR_SHIVA }}
6069 path : ${{ github.workspace }}/lit-assets/
6170 submodules : false
6271 sparse-checkout : |
@@ -69,13 +78,13 @@ jobs:
6978 working-directory : ${{github.workspace}}/lit-assets/blockchain/contracts
7079 - name : Docker login
7180 id : login
72- run : docker login ghcr.io/ -u ${{secrets.GH_USER }} --password ${{secrets.GH_PAT }}
81+ run : docker login ghcr.io/ -u ${{ github.actor }} --password ${{secrets.GH_PAT_FOR_SHIVA }}
7382 - name : Pull Shiva Container
7483 id : shiva-pull
7584 run : docker pull ghcr.io/lit-protocol/shiva:latest
7685 - name : Run Shiva Container
7786 id : shiva-runner
78- 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=$NAGA_COMMIT_HASH -e IPFS_API_KEY=${{secrets.IPFS_API_KEY}} --name shiva ghcr.io/lit-protocol/shiva:latest
87+ 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
7988 - name : Set up Node.js
8089 uses : actions/setup-node@v3
8190 with :
@@ -106,4 +115,34 @@ jobs:
106115 run : docker stop shiva && docker rm shiva
107116 - name : Post Pull Shiva Image
108117 if : steps.shiva-pull.outputs.exit_code == 0
109- run : docker rmi ghcr.io/lit-protocol/shiva
118+ run : docker rmi ghcr.io/lit-protocol/shiva
119+ ping-lit-configuration-guides :
120+ runs-on : ubuntu-latest
121+ # needs: [unit-tests, integration-tests] # Make sure this job runs after others complete
122+ steps :
123+ - name : Get PR labels
124+ id : pr-labels
125+ uses : actions/github-script@v6
126+ if : github.event_name == 'pull_request'
127+ with :
128+ script : |
129+ const labels = context.payload.pull_request.labels
130+ .map(label => label.name)
131+ .filter(name => name.startsWith('tag:'))
132+ .map(name => name.split(':')[1]);
133+ if (labels.length > 0) {
134+ core.setOutput('tag', labels[0]);
135+ } else {
136+ core.setOutput('skip', 'true');
137+ }
138+ - name : Trigger dependencies bot in lit-configuration-guides
139+ if : steps.pr-labels.outputs.skip != 'true'
140+ run : |
141+ TAG="${{ steps.pr-labels.outputs.tag }}"
142+ curl -X POST \
143+ -H "Accept: application/vnd.github.everest-preview+json" \
144+ -H "Authorization: token ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}" \
145+ https://api.github.com/repos/LIT-Protocol/lit-configuration-guides/dispatches \
146+ -d "{\"event_type\":\"dependency_update\", \"client_payload\": {\"labels\": [\"$TAG\"]}}"
147+ env :
148+ GH_PAT_LIT_CONFIGURATION_GUIDES_REPO : ${{ secrets.GH_PAT_LIT_CONFIGURATION_GUIDES_REPO }}
0 commit comments