this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/ci: use cue-lang/cuelang.org workflow_dispatch for tip

See https://cuelang.org/cl/557408 for the history on this change.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I39b059e9827757c93ac60e243d1d347c965ced56
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/557443
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+29 -12
+2 -2
.github/workflows/release.yml
··· 91 91 GITHUB_TOKEN: ${{ secrets.CUECKOO_GITHUB_PAT }} 92 92 - if: startsWith(github.ref, 'refs/tags/v') 93 93 name: Re-test cuelang.org 94 - run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --request POST --data-binary "{\"event_type\":\"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 94 + run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Re-test post release of ${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 95 95 - if: startsWith(github.ref, 'refs/tags/v') 96 96 name: Trigger unity build 97 - run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --request POST --data-binary "{\"event_type\":\"Check against CUE ${GITHUB_REF##refs/tags/}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"${GITHUB_REF##refs/tags/}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches' 97 + run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Check against CUE ${GITHUB_REF##refs/tags/}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"${GITHUB_REF##refs/tags/}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches'
+2 -2
.github/workflows/tip_triggers.yml
··· 14 14 if: ${{github.repository == 'cue-lang/cue'}} 15 15 steps: 16 16 - name: Trigger tip.cuelang.org deploy 17 - run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --request POST --data-binary "{\"event_type\":\"Rebuild tip against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"rebuild_tip\"}}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 17 + run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"ref\":\"master\"}" https://api.github.com/repos/cue-lang/cuelang.org/actions/workflows/update_tip.yml/dispatches' 18 18 - name: Trigger unity build 19 - run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --request POST --data-binary "{\"event_type\":\"Check against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches' 19 + run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Check against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches'
+19 -1
internal/ci/base/github.cue
··· 308 308 309 309 name: string 310 310 run: #""" 311 - \#(_curlGitHubAPI) -f --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#arg))) https://api.github.com/repos/\#(#githubRepositoryPath)/dispatches 311 + \#(_curlGitHubAPI) --fail --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#arg))) https://api.github.com/repos/\#(#githubRepositoryPath)/dispatches 312 + """# 313 + } 314 + 315 + workflowDispatch: json.#step & { 316 + #githubRepositoryPath: *githubRepositoryPath | string 317 + #botGitHubUserTokenSecretsKey: *botGitHubUserTokenSecretsKey | string 318 + #workflowID: string 319 + 320 + // params are defined per https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event 321 + #params: *{ 322 + ref: defaultBranch 323 + } | _ 324 + 325 + _curlGitHubAPI: curlGitHubAPI & {#tokenSecretsKey: #botGitHubUserTokenSecretsKey, _} 326 + 327 + name: string 328 + run: #""" 329 + \#(_curlGitHubAPI) --fail --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#params))) https://api.github.com/repos/\#(#githubRepositoryPath)/actions/workflows/\#(#workflowID)/dispatches 312 330 """# 313 331 } 314 332
+6 -7
internal/ci/github/tip_triggers.cue
··· 24 24 "runs-on": _repo.linuxMachine 25 25 if: "${{github.repository == '\(_repo.githubRepositoryPath)'}}" 26 26 steps: [ 27 - _repo.repositoryDispatch & { 27 + _repo.workflowDispatch & { 28 28 name: "Trigger tip.cuelang.org deploy" 29 29 #githubRepositoryPath: _repo.cuelangRepositoryPath 30 - #arg: { 31 - event_type: "Rebuild tip against ${GITHUB_SHA}" 32 - client_payload: { 33 - type: "rebuild_tip" 34 - } 35 - } 30 + 31 + // #workflowID corresponds to the filename of the update_tip 32 + // workflow in the cue-lang/cuelang.org repo. If we could constrain 33 + // this across repos we would. 34 + #workflowID: "update_tip.yml" 36 35 }, 37 36 _repo.repositoryDispatch & { 38 37 name: "Trigger unity build"