mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-19 17:01:53 +00:00
fix: sort output
Signed-off-by: matttrach <matt.trachier@suse.com>
This commit is contained in:
parent
ecbc278ccf
commit
a0f14bb582
2 changed files with 3491 additions and 3483 deletions
6950
src/checksums.ts
6950
src/checksums.ts
File diff suppressed because it is too large
Load diff
|
|
@ -35,9 +35,12 @@ fetch_checksums() {
|
|||
return
|
||||
fi
|
||||
|
||||
local clean_v=$(echo "$tag" | sed 's/^v//' | sed 's/-pro$//' | sed 's/~pro$//')
|
||||
local major=$(echo "$clean_v" | cut -d. -f1 || echo "")
|
||||
local minor=$(echo "$clean_v" | cut -d. -f2 || echo "")
|
||||
local clean_v
|
||||
local major
|
||||
local minor
|
||||
clean_v=$(echo "$tag" | sed 's/^v//' | sed 's/-pro$//' | sed 's/~pro$//')
|
||||
major=$(echo "$clean_v" | cut -d. -f1 || echo "")
|
||||
minor=$(echo "$clean_v" | cut -d. -f2 || echo "")
|
||||
|
||||
if [[ "$major" =~ ^[0-9]+$ ]] && [[ "$minor" =~ ^[0-9]+$ ]]; then
|
||||
if [ "$major" -eq "$MIN_MAJOR" ] && [ "$minor" -lt "$MIN_MINOR" ]; then
|
||||
|
|
@ -92,7 +95,7 @@ for tag in $PRO_TAGS; do
|
|||
minor=$(echo "$clean_v" | cut -d. -f2 || echo "")
|
||||
|
||||
if [[ "$major" =~ ^[0-9]+$ ]] && [[ "$minor" =~ ^[0-9]+$ ]]; then
|
||||
if [ "$major" -lt 2 ] || ( [ "$major" -eq 2 ] && [ "$minor" -lt 7 ] ); then
|
||||
if [ "$major" -lt 2 ] || { [ "$major" -eq 2 ] && [ "$minor" -lt 7 ]; }; then
|
||||
if [[ "$tag" != *"-pro" ]]; then
|
||||
tag="${tag}-pro"
|
||||
fi
|
||||
|
|
@ -115,10 +118,15 @@ NEW_JSON=$(jq -n -R '
|
|||
' < "$FLAT_FILE")
|
||||
|
||||
MERGED_JSON=$(echo "$EXISTING_JSON" | jq --argjson new "$NEW_JSON" '. * $new')
|
||||
SORTED_JSON=$(echo "$MERGED_JSON" | jq -r 'keys[]' | sort -rV | jq -R . | jq -s 'map(select(length > 0))' | jq --argjson data "$MERGED_JSON" 'map({key: ., value: $data[.]}) | from_entries')
|
||||
|
||||
echo "// This file contains sha256 checksums of GoReleaser binaries." > "$OUT_FILE"
|
||||
echo "// Auto-generated by update-checksums.sh" >> "$OUT_FILE"
|
||||
echo -n "export const checksums: Record<string, Record<string, string>> = " >> "$OUT_FILE"
|
||||
echo "$MERGED_JSON;" >> "$OUT_FILE"
|
||||
rm -f "$OUT_FILE"
|
||||
touch "$OUT_FILE"
|
||||
{
|
||||
echo "// This file contains sha256 checksums of GoReleaser binaries."
|
||||
echo "// Auto-generated by update-checksums.sh"
|
||||
echo -n "export const checksums: Record<string, Record<string, string>> = "
|
||||
echo "$SORTED_JSON;"
|
||||
} >> "$OUT_FILE"
|
||||
|
||||
echo -e "\nSuccessfully updated src/checksums.ts!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue