1010 description : ' Component docs to update'
1111 type : choice
1212 options :
13- - compactc
13+ - compact
1414 - dapp-connector
1515 - midnight-indexer
1616 - ledger
1717 - midnight-js
1818 - testkit-js
1919 - wallet
2020 - onchain-runtime
21- branch_compactc :
22- description : ' Compactc branch'
23- default : ' testnet '
21+ branch_compact :
22+ description : ' Compact branch'
23+ default : ' main '
2424 branch_dapp_connector :
2525 description : ' DApp Connector branch'
2626 default : ' main'
3232 default : ' ledger-7.0.0'
3333 branch_indexer :
3434 description : ' Midnight Indexer branch'
35- default : ' v3 .0.0'
35+ default : ' v4 .0.0'
3636 branch_wallet :
3737 description : ' Wallet branch'
3838 default : ' main'
4242 branch_onchain_runtime :
4343 description : ' Onchain Runtime branch'
4444 default : ' onchain-runtime-2.0.1'
45+ indexer_schema_version :
46+ description : ' Indexer schema version'
47+ default : ' v4'
4548
4649permissions :
4750 contents : write
@@ -64,36 +67,30 @@ jobs:
6467 git config --global user.name "Midnight CI GitHub Action"
6568 git config --global url.https://${{ secrets.GH_TOKEN }}@github.com/.insteadOf https://github.com/
6669
67- - name : Clone compactc repo
68- if : ${{ github.event.inputs.component == 'compactc ' }}
70+ - name : Clone compact repo
71+ if : ${{ github.event.inputs.component == 'compact ' }}
6972 run : |
7073 mkdir ./temp
7174 cd temp
72- git clone --branch ${{ github.event.inputs.branch_compactc }} https://github.com/midnightntwrk/compactc.git
75+ git clone --branch "$BRANCH_COMPACT" https://github.com/LFDT-Minokawa/compact
76+ env :
77+ BRANCH_COMPACT : ${{ github.event.inputs.branch_compact }}
7378
7479 - name : Clone ledger repo
7580 if : ${{ github.event.inputs.component == 'ledger' }}
7681 run : |
7782 mkdir ./temp
7883 cd temp
79- git clone --branch ${{ github.event.inputs.branch_ledger }} https://github.com/midnightntwrk/midnight-ledger.git
80-
81- - name : Update compact-runtime
82- if : ${{ github.event.inputs.component == 'compactc' }}
83- run : |
84- DEST_DIR=api-reference/compact-runtime
85- SRC_DIR=temp/compactc/doc/api/runtime
86- rm -rf ${DEST_DIR} || true
87- mkdir ${DEST_DIR}
88- cp -r ${SRC_DIR}/* ${DEST_DIR}
89- echo -e "# Compact runtime API\n\n$(cat ${DEST_DIR}/README.md)" > ${DEST_DIR}/README.md
84+ git clone --branch "$BRANCH_LEDGER" https://github.com/midnightntwrk/midnight-ledger.git
85+ env :
86+ BRANCH_LEDGER : ${{ github.event.inputs.branch_ledger }}
9087
9188 - name : Update DApp connector
9289 if : ${{ github.event.inputs.component == 'dapp-connector' }}
9390 run : |
9491 mkdir ./temp
9592 cd temp
96- git clone --branch ${{ github.event.inputs.branch_dapp_connector }} https://github.com/midnightntwrk/midnight-dapp-connector-api.git
93+ git clone --branch "$BRANCH_DAPP_CONNECTOR" https://github.com/midnightntwrk/midnight-dapp-connector-api.git
9794 cd ..
9895 DEST_DIR=api-reference/dapp-connector
9996 SRC_DIR=temp/midnight-dapp-connector-api/docs/api
@@ -109,6 +106,8 @@ jobs:
109106 if [ -f ./temp/backup-readme.md ]; then
110107 cp ./temp/backup-readme.md ${DEST_DIR}/README.md
111108 fi
109+ env :
110+ BRANCH_DAPP_CONNECTOR : ${{ github.event.inputs.branch_dapp_connector }}
112111
113112 - name : Update ledger
114113 if : ${{ github.event.inputs.component == 'ledger' }}
@@ -125,58 +124,68 @@ jobs:
125124 run : |
126125 mkdir ./temp
127126 cd temp
128- git clone --branch ${{ github.event.inputs.branch_midnight_js }} https://github.com/midnightntwrk/midnight-js.git
127+ git clone --branch "$BRANCH_MIDNIGHT_JS" https://github.com/midnightntwrk/midnight-js.git
129128 cd ..
130129 DEST_DIR=api-reference/midnight-js
131130 SRC_DIR=temp/midnight-js/docs/api/midnight-js
132131 rm -rf ${DEST_DIR} || true
133132 mkdir ${DEST_DIR}
134133 cp -r ${SRC_DIR}/* ${DEST_DIR}
135134 echo -e "# Midnight JS API\n\n$(cat ${DEST_DIR}/README.md)" > ${DEST_DIR}/README.md
135+ env :
136+ BRANCH_MIDNIGHT_JS : ${{ github.event.inputs.branch_midnight_js }}
136137
137138 - name : Update testkit-js
138139 if : ${{ github.event.inputs.component == 'testkit-js' }}
139140 run : |
140141 mkdir ./temp
141142 cd temp
142- git clone --branch ${{ github.event.inputs.branch_midnight_js }} https://github.com/midnightntwrk/midnight-js.git
143+ git clone --branch "$BRANCH_MIDNIGHT_JS" https://github.com/midnightntwrk/midnight-js.git
143144 cd ..
144145 DEST_DIR=api-reference/testkit-js
145146 SRC_DIR=temp/midnight-js/docs/api/testkit-js
146147 rm -rf ${DEST_DIR} || true
147148 mkdir ${DEST_DIR}
148149 cp -r ${SRC_DIR}/* ${DEST_DIR}
149150 echo -e "# Testkit JS API\n\n$(cat ${DEST_DIR}/README.md)" > ${DEST_DIR}/README.md
151+ env :
152+ BRANCH_MIDNIGHT_JS : ${{ github.event.inputs.branch_midnight_js }}
150153
151154 - name : Update midnight-indexer
152155 if : ${{ github.event.inputs.component == 'midnight-indexer' }}
153156 run : |
154157 mkdir ./temp
155158 cd temp
156- git clone --branch ${{ github.event.inputs.branch_indexer }} https://github.com/midnightntwrk/midnight-indexer.git
159+ git clone --branch "$BRANCH_INDEXER" https://github.com/midnightntwrk/midnight-indexer.git
157160 cd ..
161+ INDEXER_SCHEMA_VERSION="$INDEXER_SCHEMA_VERSION"
158162 DEST_DIR=api-reference/midnight-indexer
159- SRC_DIR=temp/midnight-indexer/docs/api/v3
163+ SRC_DIR=temp/midnight-indexer/docs/api/${INDEXER_SCHEMA_VERSION}
160164 STATIC_DIR=static/midnight-indexer
161165 rm -rf ${DEST_DIR} || true
162166 mkdir ${DEST_DIR}
163167 cp -r ${SRC_DIR}/* ${DEST_DIR}
164168 mv ${DEST_DIR}/api-documentation.md ${DEST_DIR}/README.md
165- sed -E -i 's|\[\`indexer-api/graphql/schema-v3\.graphql\`\]\(.*\)|[midnight-indexer-api-schema](pathname:///midnight-indexer/schema-v3.graphql)|g' ${DEST_DIR}/README.md
166- cp temp/midnight-indexer/indexer-api/graphql/schema-v3.graphql ${STATIC_DIR}
169+ sed -E -i 's|\[\`indexer-api/graphql/schema-${INDEXER_SCHEMA_VERSION}\.graphql\`\]\(.*\)|[midnight-indexer-api-schema](pathname:///midnight-indexer/schema-${INDEXER_SCHEMA_VERSION}.graphql)|g' ${DEST_DIR}/README.md
170+ cp temp/midnight-indexer/indexer-api/graphql/schema-${INDEXER_SCHEMA_VERSION}.graphql ${STATIC_DIR}
171+ env :
172+ BRANCH_INDEXER : ${{ github.event.inputs.branch_indexer }}
173+ INDEXER_SCHEMA_VERSION : ${{ github.event.inputs.indexer_schema_version }}
167174
168175 - name : Update wallet
169176 if : ${{ github.event.inputs.component == 'wallet' }}
170177 run : |
171178 mkdir ./temp
172179 cd temp
173- git clone --branch ${{ github.event.inputs.branch_wallet }} https://github.com/midnightntwrk/midnight-wallet.git
180+ git clone --branch "$BRANCH_WALLET" https://github.com/midnightntwrk/midnight-wallet.git
174181 cd ..
175182 DEST_DIR=static/midnight-wallet/snippets
176183 SRC_DIR=temp/midnight-wallet/packages/docs-snippets/src/snippets
177184 rm -rf ${DEST_DIR} || true
178185 mkdir -p ${DEST_DIR}
179186 cp -r ${SRC_DIR}/* ${DEST_DIR}
187+ env :
188+ BRANCH_WALLET : ${{ github.event.inputs.branch_wallet }}
180189
181190 - name : Inject H1 header into midnight-js packages
182191 if : ${{ github.event.inputs.component == 'midnight-js' }}
@@ -199,41 +208,43 @@ jobs:
199208 run : |
200209 mkdir ./temp
201210 cd temp
202- git clone --branch ${{ github.event.inputs.branch_onchain_runtime }} https://github.com/midnightntwrk/midnight-ledger.git
211+ git clone --branch "$BRANCH_ONCHAIN_RUNTIME" https://github.com/midnightntwrk/midnight-ledger.git
203212 cd ..
204213 DEST_DIR=api-reference/onchain-runtime
205214 SRC_DIR=temp/midnight-ledger/docs/api/midnight-onchain-runtime
206215 rm -rf ${DEST_DIR} || true
207216 mkdir ${DEST_DIR}
208217 cp -r ${SRC_DIR}/* ${DEST_DIR}
209218 echo -e "# Onchain Runtime API\n\n$(cat ${DEST_DIR}/README.md)" > ${DEST_DIR}/README.md
219+ env :
220+ BRANCH_ONCHAIN_RUNTIME : ${{ github.event.inputs.branch_onchain_runtime }}
210221
211222 - name : Update Compact standard library
212- if : ${{ github.event.inputs.component == 'compactc ' }}
223+ if : ${{ github.event.inputs.component == 'compact ' }}
213224 run : |
214225 DEST_DIR=docs/compact/standard-library
215- SRC_DIR=temp/compactc/ doc/api/CompactStandardLibrary
226+ SRC_DIR=temp/doc/api/CompactStandardLibrary
216227 rm -rf ${DEST_DIR} || true
217228 mkdir ${DEST_DIR}
218229 cp -r ${SRC_DIR}/* ${DEST_DIR}
219230 echo -e "# Compact standard library\n\n$(cat ${DEST_DIR}/README.md)" > ${DEST_DIR}/README.md
220231
221- - name : Update static assets from compactc
222- if : ${{ github.event.inputs.component == 'compactc ' }}
232+ - name : Update static assets from compact
233+ if : ${{ github.event.inputs.component == 'compact ' }}
223234 run : |
224235 DEST_DIR=static/language
225- SRC_1=temp/compactc /doc/Compact.html
226- SRC_2=temp/compactc/ doc/ledger-adt.mdx
236+ SRC_1=temp/compact /doc/Compact.html
237+ SRC_2=temp/doc/ledger-adt.mdx
227238 rm -rf ${DEST_DIR} || true
228239 mkdir ${DEST_DIR}
229240 cp -r ${SRC_1} ${DEST_DIR}/compact.html
230241 cp -r ${SRC_2} ${DEST_DIR}/ledger-adt.mdx
231242
232243 - name : Update compiler usage
233- if : ${{ github.event.inputs.component == 'compactc ' }}
244+ if : ${{ github.event.inputs.component == 'compact ' }}
234245 run : |
235246 DEST=docs/compact/compilation-and-tooling/compiler-usage.mdx
236- SRC=temp/compactc/ doc/compiler-usage.md
247+ SRC=temp/doc/compiler-usage.md
237248 cp -r ${SRC} ${DEST}
238249
239250 - name : Add changes
@@ -270,6 +281,8 @@ jobs:
270281 - name : Create a PR
271282 if : ${{ steps.prep.outputs.UPDATE == 'true' }}
272283 run : |
273- gh pr create --base ${{ github.event.inputs.branch_merge }} --title 'Merge API documentation from ${{ github.event.inputs.component }} ' --body 'Merging API documentation - created by Midnight CI Github Action'
284+ gh pr create --base "$BRANCH_MERGE" --title 'Merge API documentation from "$COMPONENT" ' --body 'Merging API documentation - created by Midnight CI Github Action'
274285 env :
275286 GH_TOKEN : ${{ secrets.GH_TOKEN }}
287+ BRANCH_MERGE : ${{ github.event.inputs.branch_merge }}
288+ COMPONENT : ${{ github.event.inputs.component }}
0 commit comments