forked from cue-lang/cue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from anduintransaction/anduin
feat: patch registry client to publish compatible oras layers
- Loading branch information
Showing
18 changed files
with
342 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Snapshot | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
||
concurrency: snapshot | ||
|
||
jobs: | ||
snapshot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Install CUE | ||
run: go install ./cmd/cue | ||
|
||
- name: Install GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
install-only: true | ||
version: v2.2.0 | ||
|
||
- name: Run GoReleaser with CUE | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: cue cmd release | ||
working-directory: ./internal/ci/goreleaser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dev-build: | ||
go build -o ./dist/cue-dev ./cmd/cue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cue.cache/ | ||
data/ | ||
!cue.mod/module.cue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
nuke: | ||
sudo rm -rf ./cue.cache/mod && \ | ||
rm -rf ./data/* && \ | ||
mkdir -p ./cue.cache ./data | ||
|
||
publish-module1: | ||
cd ./module1 && \ | ||
../cue.sh mod publish v1.0.1 | ||
|
||
eval-module2: | ||
cd ./module2 && \ | ||
../cue.sh mod tidy && \ | ||
../cue.sh export ./main.cue | ||
|
||
oras-pull: | ||
cd data && \ | ||
oras pull localhost:5000/anduin.com/module1:v1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Example using multi modules with Cue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/env bash | ||
|
||
here=`cd $(dirname $BASH_SOURCE); pwd` | ||
|
||
export ANDUIN_CUE_DEBUG="true" | ||
export CUE_CACHE_DIR=$here/cue.cache/ | ||
export CUE_REGISTRY=file://$here/registry.cue | ||
|
||
$here/../../../dist/cue-dev $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
services: | ||
zot: | ||
image: ghcr.io/project-zot/zot-linux-amd64:v2.1.1 | ||
ports: | ||
- 5000:5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module: "anduin.com/module1@v1" | ||
|
||
source: kind: "self" | ||
|
||
language: { | ||
version: "v0.11.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
asdasdasdasd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package module1 | ||
|
||
import "math" | ||
|
||
data: { | ||
// Simple labels don't need to be quoted. | ||
one: 1 | ||
two: 2 | ||
piPlusOne: math.Pi + 1 | ||
|
||
// Field names must be quoted if they contain | ||
// special characters, such as hyphen and space. | ||
"quoted field names": { | ||
"two-and-a-half": 2.5 | ||
"three point three": 3.3 | ||
"four^four": math.Pow(4, 4) | ||
} | ||
|
||
aList: [ | ||
1, | ||
2, | ||
3, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package module1 | ||
|
||
data2: { | ||
foo: "bar" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package submodules | ||
|
||
data3: { | ||
fizz: "fizz" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module: "anduin.com/module2@v1" | ||
language: { | ||
version: "v0.11.0" | ||
} | ||
source: { | ||
kind: "self" | ||
} | ||
deps: { | ||
"anduin.com/module1@v1": { | ||
v: "v1.0.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package module2 | ||
|
||
import ( | ||
"anduin.com/module1" | ||
"anduin.com/module1/submodules" | ||
) | ||
|
||
foo: module1.data | ||
bar: module1.data2 | ||
fizz: submodules.data3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defaultRegistry: { | ||
registry: "localhost:5000+insecure" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ package goreleaser | |
config: { | ||
#latest: bool @tag(latest, type=bool) | ||
|
||
version: 2 | ||
version: 2 | ||
project_name: "cue" | ||
// Note that gomod.proxy is ignored by `goreleaser release --snapshot`, | ||
// which we use in CI to test the goreleaser config and build, | ||
|
@@ -30,7 +30,6 @@ config: { | |
goos: *[ | ||
"darwin", | ||
"linux", | ||
"windows", | ||
] | _ | ||
goarch: *[ | ||
"amd64", | ||
|
@@ -68,82 +67,8 @@ config: { | |
// For those reasons, let goreleaser create the release, but leaving it as a draft. | ||
draft: true | ||
} | ||
checksum: name_template: "checksums.txt" | ||
checksum: name_template: "checksums.txt" | ||
snapshot: version_template: "{{ .Tag }}-next" | ||
// As explained above, we write our own release notes. | ||
changelog: disable: true | ||
|
||
brews: [{ | ||
if !#latest { | ||
skip_upload: true | ||
} | ||
repository: { | ||
owner: "cue-lang" | ||
name: "homebrew-tap" | ||
} | ||
commit_author: { | ||
name: "cueckoo" | ||
email: "[email protected]" | ||
} | ||
homepage: "https://cuelang.org" | ||
description: "CUE is an open source data constraint language which aims to simplify tasks involving defining and using data." | ||
test: """ | ||
system \"#{bin}/cue version\" | ||
""" | ||
}] | ||
|
||
dockers: [{ | ||
image_templates: [ | ||
"docker.io/cuelang/cue:{{ .Version }}-amd64", | ||
] | ||
dockerfile: "cmd/cue/Dockerfile" | ||
use: "buildx" | ||
build_flag_templates: [ | ||
"--platform=linux/amd64", | ||
"--label=org.opencontainers.image.title={{ .ProjectName }}", | ||
"--label=org.opencontainers.image.description={{ .ProjectName }}", | ||
"--label=org.opencontainers.image.url=https://github.com/cue-lang/cue", | ||
"--label=org.opencontainers.image.source=https://github.com/cue-lang/cue", | ||
"--label=org.opencontainers.image.version={{ .Version }}", | ||
"--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}", | ||
"--label=org.opencontainers.image.revision={{ .FullCommit }}", | ||
"--label=org.opencontainers.image.licenses=Apache 2.0", | ||
] | ||
}, { | ||
image_templates: [ | ||
"docker.io/cuelang/cue:{{ .Version }}-arm64", | ||
] | ||
goarch: "arm64" | ||
dockerfile: "cmd/cue/Dockerfile" | ||
use: "buildx" | ||
build_flag_templates: [ | ||
"--platform=linux/arm64", | ||
"--label=org.opencontainers.image.title={{ .ProjectName }}", | ||
"--label=org.opencontainers.image.description={{ .ProjectName }}", | ||
"--label=org.opencontainers.image.url=https://github.com/cue-lang/cue", | ||
"--label=org.opencontainers.image.source=https://github.com/cue-lang/cue", | ||
"--label=org.opencontainers.image.version={{ .Version }}", | ||
"--label=org.opencontainers.image.created={{ time \"2006-01-02T15:04:05Z07:00\" }}", | ||
"--label=org.opencontainers.image.revision={{ .FullCommit }}", | ||
"--label=org.opencontainers.image.licenses=Apache 2.0", | ||
] | ||
}] | ||
|
||
docker_manifests: [ | ||
{ | ||
name_template: "docker.io/cuelang/cue:{{ .Version }}" | ||
image_templates: [ | ||
"docker.io/cuelang/cue:{{ .Version }}-amd64", | ||
"docker.io/cuelang/cue:{{ .Version }}-arm64", | ||
] | ||
}, | ||
if #latest { | ||
name_template: "docker.io/cuelang/cue:latest" | ||
image_templates: [ | ||
"docker.io/cuelang/cue:{{ .Version }}-amd64", | ||
"docker.io/cuelang/cue:{{ .Version }}-arm64", | ||
] | ||
}, | ||
] | ||
} |
Oops, something went wrong.