Skip to content

Commit

Permalink
feat(packages/scripts): add checksum(sha256) for files in OCI (#185)
Browse files Browse the repository at this point in the history
Fixes #182

Signed-off-by: wuhuizuo <wuhuizuo@126.com>

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo authored Dec 25, 2023
1 parent 9389024 commit f60e123
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/scripts/build-package-artifacts.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ function archive() {
popd
rm -rf $archive_dir
echo "$save_file"
sha256sum -b "$save_file" | cut -d ' ' -f1 > "$save_file.sha256"
# <<<<<<<<<<<<<<<< file: {{ .name }} <<<<<<<<<<<<<<<<
{{- end }}
}
Expand All @@ -168,6 +169,7 @@ function push_files() {
pushd "$release_ws"
oras push --artifact-type application/gzip ${destination}
{{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }}{{ printf " %s" .name }}{{- end }}
{{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }}{{ printf " %s.sha256" .name }}{{- end }}
popd

{{- $tag_suffix := printf "-%s_%s_%s" .profile .os .arch -}}
Expand Down Expand Up @@ -197,6 +199,7 @@ oci:
files:
{{- range (.artifacts | jq `map(select(.type == "file" or .type == null))`) }}
{{ printf "- %s" .name }}
{{ printf "- %s.sha256" .name }}
{{- end }}
EOF
}
Expand Down

0 comments on commit f60e123

Please sign in to comment.