@@ -146,79 +146,3 @@ jobs:
146146 files : |
147147 ./connector-definition/dist/connector-definition.tgz
148148 fail_on_unmatched_files : true
149-
150- - name : Update ndc-hub
151- env :
152- REGISTRY_NAME : hasura
153- CONNECTOR_NAME : ndc-python-lambda
154- COMMIT_HASH : ${{ needs.build-connector.outputs.commit_hash }}
155- SHA256 : ${{ needs.build-connector.outputs.sha256 }}
156- GH_TOKEN : ${{ secrets.PAT_TOKEN }}
157- run : |
158- # Clone ndc-hub repository
159- git clone https://github.com/hasura/ndc-hub.git
160- cd ndc-hub
161-
162- # Create a new branch
163- NEW_BRANCH="update-${{ env.CONNECTOR_NAME }}-connector-v${{ steps.get-version.outputs.tagged_version }}"
164- git checkout -b $NEW_BRANCH
165-
166- cd registry/${{ env.REGISTRY_NAME }}/python
167-
168- # Create releases directory if it doesn't exist
169- mkdir -p releases/v${{ steps.get-version.outputs.tagged_version }}
170-
171- # Create connector-packaging.json
172- cat << EOF > releases/v${{ steps.get-version.outputs.tagged_version }}/connector-packaging.json
173- {
174- "version": "v${{ steps.get-version.outputs.tagged_version }}",
175- "uri": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.get-version.outputs.tagged_version }}/connector-definition.tgz",
176- "checksum": {
177- "type": "sha256",
178- "value": "$SHA256"
179- },
180- "source": {
181- "hash": "$COMMIT_HASH"
182- },
183- "test": {
184- "test_config_path": "../../tests/test-config.json"
185- }
186- }
187- EOF
188-
189- # Update metadata.json to remove 'packages' field if it exists and update 'latest_version'
190- jq --arg version_tag "v${{ steps.get-version.outputs.tagged_version }}" \
191- --arg commit_hash "$COMMIT_HASH" \
192- 'if has("packages") then del(.packages) else . end |
193- .overview.latest_version = $version_tag |
194- if has("source_code") then
195- .source_code.version += [{
196- "tag": $version_tag,
197- "hash": $commit_hash,
198- "is_verified": false
199- }]
200- else
201- . + {"source_code": {"version": [{
202- "tag": $version_tag,
203- "hash": $commit_hash,
204- "is_verified": false
205- }]}}
206- end' \
207- metadata.json > tmp.json && mv tmp.json metadata.json
208-
209- # Commit changes
210- git config user.name "GitHub Action"
211- git config user.email "action@github.com"
212- git add metadata.json README.md releases
213- git commit -m "Update ${{ env.CONNECTOR_NAME }} connector metadata to version ${{ steps.get-version.outputs.tagged_version }}"
214-
215- # Push changes
216- git push https://${{ secrets.PAT_TOKEN }}@github.com/hasura/ndc-hub.git HEAD:$NEW_BRANCH
217-
218- # Create PR using GitHub CLI
219- cd ../..
220- gh pr create --repo hasura/ndc-hub \
221- --base main \
222- --head $NEW_BRANCH \
223- --title "Update ${{ env.CONNECTOR_NAME }} connector to v${{ steps.get-version.outputs.tagged_version }}" \
224- --body "This PR updates the ${{ env.CONNECTOR_NAME }} connector metadata to version ${{ steps.get-version.outputs.tagged_version }}."
0 commit comments