File: github_app_private.txtar

package info (click to toggle)
golang-github-cue-lang-cue 0.12.0.-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,072 kB
  • sloc: sh: 57; makefile: 17
file content (40 lines) | stat: -rw-r--r-- 913 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Publish a CUE module under a private GitHub repository namespace
# where `cue login` has been set up with read-write access to the namespace.
# Publish a version for this new repository with `cue mod publish`,
# and then fetch the module as a dependency via cmd/cue.

github-repo-module private
env VERSION=v0.0.1
env MODVER=${MODULE}@v0

cd publish

exec cue mod init --source self ${MODVER}
exec cue mod publish ${VERSION}

cd ../depend

env-fill out_foo.cue
exec cue mod init --source self depend.localhost
exec cue mod tidy
exec cue export
cmp stdout export.golden

# TODO(mvdan): Use another registry token without access to this private repo
# and check that they cannot list, fetch, or publish any versions.

-- publish/foo.cue --
package publish

foo: "foo value"

-- depend/out_foo.cue --
package depend

import mt "${MODVER}:publish"

out: mt.foo
-- depend/export.golden --
{
    "out": "foo value"
}