cuelang.org/go@v0.13.0/internal/ci/github/tip_triggers.cue (about)

     1  // Copyright 2022 The CUE Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package github
    16  
    17  // The tip_triggers workflow. This fires for each new commit that hits the
    18  // default branch or the default branch's test branch.
    19  workflows: tip_triggers: _repo.bashWorkflow & {
    20  
    21  	name: "Triggers on push to tip"
    22  	on: push: branches: [_repo.defaultBranch, _repo.testDefaultBranch]
    23  	jobs: push: {
    24  		"runs-on": _repo.linuxMachine
    25  		if:        "${{github.repository == '\(_repo.githubRepositoryPath)'}}"
    26  		steps: [
    27  			_repo.repositoryDispatch & {
    28  				name:                          "Trigger unity build"
    29  				#githubRepositoryPath:         _repo.unityRepositoryPath
    30  				#botGitHubUserTokenSecretsKey: "PORCUEPINE_GITHUB_PAT"
    31  				#arg: {
    32  					event_type: "Check against ${GITHUB_SHA}"
    33  					client_payload: {
    34  						type: "unity"
    35  						payload: versions: """
    36  							"commit:${GITHUB_SHA}"
    37  							"""
    38  					}
    39  				}
    40  			},
    41  
    42  			// This triggers the cuelang.org tipdeploy workflow, that ultimately
    43  			// deploys tip.cuelang.org. The specific commit that triggered this
    44  			// workflow (inside tip_triggers) isn't used by the cuelang.org build
    45  			// unless it also happens to be the tip of cue-lang/cue, therefore
    46  			// there's no dispatch payload/etc that communicates the commit ref.
    47  			_repo.workflowDispatch & {
    48  				name:                          "Trigger cuelang.org tipdeploy"
    49  				#githubRepositoryPath:         _repo.cuelangRepositoryPath
    50  				#botGitHubUserTokenSecretsKey: "CUECKOO_GITHUB_PAT"
    51  				#workflowID:                   "tipdeploy.yaml"
    52  			},
    53  		]
    54  	}
    55  }