Connector publishing automation #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Hub DB from GH Registry | |
on: | |
push: | |
branches: | |
- lyndon/registry-automation # TODO: Remove the branch response | |
paths: | |
- registry/** | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
paths: | |
- registry/** | |
jobs: | |
update_registry_db: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch_depth: 1 | |
- name: Get all connector version package changes | |
id: connector-version-changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
json: true | |
escape_json: false | |
files: | | |
registry/**/releases/**/package.json | |
- name: Print out all the changed filse | |
env: | |
ADDED_FILES: ${{ steps.connector-version-changed-files.outputs.added_files }} | |
MODIFIED_FILES: ${{ steps.connector-version-changed-files.outputs.modified_files }} | |
DELETED_FILES: ${{ steps.connector-version-changed-files.outputs.deleted_files }} | |
run: | | |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > connector_version_changes.json | |
- name: List changed files | |
id: list_files | |
run: | | |
jq . connector_version_changes.json | |
- name: Get all connector metadata changes | |
id: connector-metadata-changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
json: true | |
escape_json: false | |
files_yaml: | | |
registry: | |
- registry/**/logo.png | |
- registry/**/logo.svg | |
- registry/**/README.md | |
- registry/**/metadata.json | |
- name: Print out all the changed filse | |
env: | |
ADDED_FILES: ${{ steps.connector-metadata-changed-files.outputs.added_files }} | |
MODIFIED_FILES: ${{ steps.connector-metadata-changed-files.outputs.modified_files }} | |
DELETED_FILES: ${{ steps.connector-metadata-changed-files.outputs.deleted_files }} | |
run: | | |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > connector_metadata_changes.json | |
- name: List changed files | |
id: list_files_1 | |
run: | | |
jq . connector_metadata_changes.json | |
# - name: Pseudocode for Next steps | |
# id: next_steps | |
# run: | | |
# echo 'Detect status - added/modified/removed files' | |
# echo 'for each removed connector, remove from registry db' | |
# echo 'for each added connector, create a stub in the registry db' | |
# echo 'for each modified connector:' | |
# echo ' * Download tgz' | |
# echo ' * Re-upload tgz' | |
# echo ' * Extract' | |
# echo ' * Build payload for API' | |
# echo ' * PUT to API (gql)' | |
# - name: Setup Go | |
# uses: actions/setup-go@v4 | |
# with: | |
# go-version: 1.21.x | |
# - name: Run registry automation program | |
# env: | |
# CHANGED_FILES_PATH: "changed_files.json" | |
# run: | | |
# mv changed_files.json registry-automation/changed_files.json | |
# cd registry-automation | |
# go run main.go ci |