File tree 4 files changed +46
-15
lines changed
4 files changed +46
-15
lines changed Original file line number Diff line number Diff line change 83
83
version : v2.2.0
84
84
- name : Run GoReleaser with CUE
85
85
env :
86
+ CUE_LOGINS : ${{ secrets.NOTCUECKOO_CUE_LOGINS }}
86
87
GITHUB_TOKEN : ${{ secrets.CUECKOO_GITHUB_PAT }}
87
- run : cue cmd release
88
+ run : |-
89
+ export CUE_CONFIG_DIR=$(mktemp -d)
90
+ echo "$CUE_LOGINS" > $CUE_CONFIG_DIR/logins.json
91
+ cue cmd release
88
92
working-directory : ./internal/ci/goreleaser
89
93
- name : Re-test cuelang.org
90
94
if : startsWith(github.ref, 'refs/tags/v')
Original file line number Diff line number Diff line change
1
+ // Copyright 2024 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
+ import (
18
+ " github.com/cue-tmp/jsonschema-pub/exp1/githubactions "
19
+ )
20
+
21
+ // _registryReadOnlyAccessStep defines a step that configures
22
+ // a read-only Central Registry access credential. The actual
23
+ // command should be placed in the _run field.
24
+ _registryReadOnlyAccessStep : githubactions .#Step & {
25
+ _run ! : string
26
+ env : {
27
+ // Note: this token has read-only access to the registry
28
+ // and is used only because we need some credentials
29
+ // to pull dependencies from the Central Registry.
30
+ CUE_LOGINS : " ${{ secrets.NOTCUECKOO_CUE_LOGINS }} "
31
+ }
32
+ run : """
33
+ export CUE_CONFIG_DIR=$(mktemp -d)
34
+ echo "$CUE_LOGINS" > $CUE_CONFIG_DIR/logins.json
35
+ \(_run )
36
+ """
37
+ }
Original file line number Diff line number Diff line change @@ -79,12 +79,12 @@ workflows: release: _repo.bashWorkflow & {
79
79
version : _repo .goreleaserVersion
80
80
}
81
81
},
82
- githubactions . #Step & {
82
+ _registryReadOnlyAccessStep & {
83
83
// Note that the logic for what gets run at release time
84
84
// is defined with the release command in CUE.
85
85
name : " Run GoReleaser with CUE "
86
86
env : GITHUB_TOKEN : " ${{ secrets.CUECKOO_GITHUB_PAT }} "
87
- run : " cue cmd release "
87
+ _run : " cue cmd release "
88
88
" working-directory " : " ./internal/ci/goreleaser "
89
89
},
90
90
_repo .repositoryDispatch & {
Original file line number Diff line number Diff line change @@ -108,19 +108,9 @@ workflows: trybot: _repo.bashWorkflow & {
108
108
// work.
109
109
_isLatestLinux : " (\(goVersion ) == '\(_repo .latestGo )' && \(matrixRunner ) == '\(_repo .linuxMachine )') "
110
110
111
- _goGenerate : githubactions . #Step & {
111
+ _goGenerate : _registryReadOnlyAccessStep & {
112
112
name : " Generate "
113
- env : {
114
- // Note: this token has read-only access to the registry
115
- // and is used only because we need some credentials
116
- // to pull dependencies from the Central Registry.
117
- CUE_LOGINS : " ${{ secrets.NOTCUECKOO_CUE_LOGINS }} "
118
- }
119
- run : """
120
- export CUE_CONFIG_DIR=$(mktemp -d)
121
- echo "$CUE_LOGINS" > $CUE_CONFIG_DIR/logins.json
122
- go generate ./...
123
- """
113
+ _run : " go generate ./... "
124
114
// The Go version corresponds to the precise version specified in
125
115
// the matrix. Skip windows for now until we work out why re-gen is flaky
126
116
if : _isLatestLinux
You can’t perform that action at this time.
0 commit comments