diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 95c1823dd..f0d2dd63b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -111,7 +111,7 @@ jobs: ./andromeda-deploy trigger-schema-parser: - needs: [deploy, build_schemas] + needs: [deploy] runs-on: ubuntu-latest steps: - name: Set Branch Based on Kernel @@ -176,4 +176,63 @@ jobs: git push else echo "No changes to commit" - fi \ No newline at end of file + fi + + trigger-armour-workflow: + needs: [trigger-schema-parser] + runs-on: ubuntu-latest + steps: + - name: Wait for schema updates + run: | + echo "Waiting 6 minutes for schema updates to propagate..." + sleep 360 + echo "Wait complete, proceeding with Armor workflow trigger" + + - name: Download version-map + uses: actions/download-artifact@v4 + with: + name: contracts + path: "artifacts" + + - name: Extract version map + run: | + cd artifacts + cat version_map.json + cp version_map.json ../version_map.json + + - name: Trigger Armor Workflow + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.CI_PAT }} + script: | + const kernelAddress = '${{ inputs.kernel_address }}'; + const testnetKernels = '${{ vars.TESTNET_KERNELS }}'; + const testnetStagingKernels = '${{ vars.TESTNET_STAGING_KERNELS }}'; + + // Read the version map + const fs = require('fs'); + const versionMap = fs.readFileSync('version_map.json', 'utf8'); + + let workflowFile; + if (kernelAddress === testnetKernels) { + workflowFile = 'develop.yml'; + } else if (kernelAddress === testnetStagingKernels) { + workflowFile = 'staging.yml'; + } else { + core.setFailed('Error: Kernel not found in known configurations'); + return; + } + + try { + await github.rest.actions.createWorkflowDispatch({ + owner: 'andromedaprotocol', + repo: 'andromeda-armour', + workflow_id: workflowFile, + ref: 'main', + inputs: { + version_map: versionMap + } + }); + } catch (error) { + core.setFailed(`Failed to trigger Armor workflow: ${error.message}`); + } \ No newline at end of file