@@ -3,59 +3,113 @@ name: Dispatch Release to juno-std
33on :
44 release :
55 types : [released]
6- push :
7- tags :
8- - ' v[0-9]+.[0-9]+.[0-9]+'
9-
106env :
117 JUNO_REPO : " https://github.com/CosmosContracts/juno.git"
12- JUNO_DIR : " ../dependencies/juno/ "
8+ JUNO_DIR : " proto "
139 COSMOS_SDK_REPO : " https://github.com/cosmos/cosmos-sdk.git"
14- COSMOS_SDK_REV : " v0.50.13 "
15- COSMOS_SDK_DIR : " ../dependencies/cosmos-sdk/ "
10+ COSMOS_SDK_REV : " v0.53.4 "
11+ COSMOS_SDK_DIR : " proto "
1612 WASMD_REPO : " https://github.com/CosmWasm/wasmd.git"
17- WASMD_REV : " v0.54.0 "
18- WASMD_DIR : " ../dependencies/wasmd/ "
13+ WASMD_REV : " v0.54.2 "
14+ WASMD_DIR : " proto "
1915 COMETBFT_REPO : " https://github.com/cometbft/cometbft.git"
20- COMETBFT_REV : " v0.38.17 "
21- COMETBFT_DIR : " ../dependencies/cometbft/ "
16+ COMETBFT_REV : " v0.38.19 "
17+ COMETBFT_DIR : " proto "
2218 IBC_GO_REPO : " https://github.com/cosmos/ibc-go.git"
2319 IBC_GO_REV : " v8.7.0"
24- IBC_GO_DIR : " ../dependencies/ibc-go/ "
20+ IBC_GO_DIR : " proto "
2521 ICS23_REPO : " https://github.com/cosmos/ics23.git"
2622 ICS23_REV : " go/v0.11.0"
27- ICS23_DIR : " ../dependencies/ics23/ "
23+ ICS23_DIR : " proto "
2824
2925jobs :
3026 dispatch :
3127 runs-on : ubuntu-latest
3228 steps :
33- - name : Build repo_config JSON
34- id : build_repo_config
35- env :
36- GITHUB_EVENT_RELEASE_TAG : ${{ github.event.release.tag_name }}
37- run : |
38- printf '[\n {"name": "juno", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": [], "is_main": true},\n {"name": "cosmos-sdk", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": ["reflection", "autocli"], "is_main": false},\n {"name": "wasmd", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": [], "is_main": false},\n {"name": "cometbft", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": [], "is_main": false},\n {"name": "ibc-go", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": [], "is_main": false},\n {"name": "ics23", "repo": "%s", "rev": "%s", "dir": "%s", "exclude_mods": [], "is_main": false}\n]\n' \
39- "$JUNO_REPO" "$GITHUB_EVENT_RELEASE_TAG" "$JUNO_DIR" \
40- "$COSMOS_SDK_REPO" "$COSMOS_SDK_REV" "$COSMOS_SDK_DIR" \
41- "$WASMD_REPO" "$WASMD_REV" "$WASMD_DIR" \
42- "$COMETBFT_REPO" "$COMETBFT_REV" "$COMETBFT_DIR" \
43- "$IBC_GO_REPO" "$IBC_GO_REV" "$IBC_GO_DIR" \
44- "$ICS23_REPO" "$ICS23_REV" "$ICS23_DIR" > repo_config.json
45- cat repo_config.json
46- echo "json=$(cat repo_config.json)" >> $GITHUB_OUTPUT
47- shell : bash
48-
49- - name : Dispatch release event with repo_config
50- uses : peter-evans/repository-dispatch@v3
29+ - name : Dispatch release event
30+ uses : actions/github-script@v8
5131 with :
52- token : ${{ secrets.DISPATCH_TOKEN }}
53- repository : CosmosContracts/juno-std
54- event-type : juno-release
55- client-payload : |
56- {
57- "is_draft": "${{ github.event.release.draft }}",
58- "is_prerelease": "${{ github.event.release.prerelease }}",
59- "release_tag": "${{ github.event.release.tag_name }}",
60- "repo_config": "${{ steps.build_repo_config.outputs.json }}"
32+ github-token : ${{ secrets.DISPATCH_TOKEN }}
33+ script : |
34+ const { context, core, github } = require('@actions/github-script');
35+
36+ // Resolve target repository (owner/repo) from env
37+ const repoStr = "CosmosContracts/juno-std";
38+ if (!repoStr.includes('/')) {
39+ core.setFailed(`Invalid repository: '${repoStr}'`);
40+ return;
41+ }
42+ const [targetOwner, targetRepo] = "CosmosContracts/juno-std".split('/', 2);
43+
44+ // Determine release_tag and flags based on event type or manual inputs
45+ const inputs = (context.payload && context.payload.inputs) || {};
46+ const releaseTag = inputs.release_tag || '';
47+ const isDraft = String(inputs.is_draft || '').toLowerCase() === 'true';
48+ const isPrerelease = String(inputs.is_prerelease || '').toLowerCase() === 'true';
49+
50+ if (!releaseTag) {
51+ core.setFailed('Unable to determine release_tag');
52+ return;
6153 }
54+
55+ // Build 'repos' as a structured JSON object keyed by name
56+ const repos = {
57+ juno: {
58+ name: 'juno',
59+ repo: process.env.JUNO_REPO,
60+ rev: releaseTag,
61+ dir: process.env.JUNO_DIR,
62+ exclude_mods: [],
63+ },
64+ cosmos_sdk: {
65+ name: 'cosmos',
66+ repo: process.env.COSMOS_SDK_REPO,
67+ rev: process.env.COSMOS_SDK_REV,
68+ dir: process.env.COSMOS_SDK_DIR,
69+ exclude_mods: ['cosmos/benchmark', 'cosmos/counter', 'cosmos/epochs', 'cosmos/protocolpool],
70+ },
71+ wasmd: {
72+ name: 'wasm',
73+ repo: process.env.WASMD_REPO,
74+ rev: process.env.WASMD_REV,
75+ dir: process.env.WASMD_DIR,
76+ exclude_mods: [],
77+ },
78+ cometbft: {
79+ name: 'cometbft',
80+ repo: process.env.COMETBFT_REPO,
81+ rev: process.env.COMETBFT_REV,
82+ dir: process.env.COMETBFT_DIR,
83+ exclude_mods: [],
84+ },
85+ ibc_go: {
86+ name: 'ibc-go',
87+ repo: process.env.IBC_GO_REPO,
88+ rev: process.env.IBC_GO_REV,
89+ dir: process.env.IBC_GO_DIR,
90+ exclude_mods: [],
91+ },
92+ ics23: {
93+ name: 'ics23',
94+ repo: process.env.ICS23_REPO,
95+ rev: process.env.ICS23_REV,
96+ dir: process.env.ICS23_DIR,
97+ exclude_mods: [],
98+ },
99+ };
100+
101+ const payload = {
102+ is_draft: isDraft,
103+ is_prerelease: isPrerelease,
104+ release_tag: releaseTag,
105+ repos,
106+ };
107+
108+ core.info(`Dispatching to ${targetOwner}/${targetRepo} with payload: ${JSON.stringify(payload)}`);
109+ await github.rest.repos.createDispatchEvent({
110+ owner: targetOwner,
111+ repo: targetRepo,
112+ event_type: "juno-release",
113+ client_payload: payload,
114+ });
115+ core.info('Repository dispatch event sent successfully.');
0 commit comments