1 #!/usr/bin/env nix-shell
2 #! nix-shell -i bash -p common-updater-scripts fd jq
7 REPO
="yandex-music-linux"
8 URL
="https://api.github.com/repos/$OWNER/$REPO"
9 RAW
="https://raw.githubusercontent.com/$OWNER/$REPO"
11 latest_release
="$(curl --silent "$URL/releases
/latest
")"
12 latest_tag
="$(curl --silent "$URL/tags?per_page
=1")"
13 commit_hash
="$(jq -r '.[0].commit.sha' <<<"$latest_tag")"
14 latest_commit
="$(curl --silent "$URL/commits
/$commit_hash"'')"
15 commit_message
="$(jq -r '.commit.message' <<<"$latest_commit")"
17 tag
=$
(jq
-r '.tag_name' <<<"$latest_release")
21 branch
=$
(jq
-r '.target_commitish' <<<"$latest_release")
23 date=$
(jq
-r '.created_at' <<<"$latest_release")
27 # update version; otherwise fail
28 update-source-version yandex-music
"$version" --ignore-same-hash
30 # set yandex-music dir
31 dir
="pkgs/by-name/ya/yandex-music"
34 "branch": "'"$branch"'",
35 "commit_hash": "'"$commit_hash"'",
36 "commit_message": "'"$commit_message"'",
39 }' >"$dir/info.json" ||
echo "Please run the script in the root of the Nixpkgs repo"
41 curl
--silent "$RAW/$commit_hash/utility/version_info.json" |\
42 jq .
> "$dir/ym_info.json" ||\
43 echo "Please run the script in the root of the Nixpkgs repo"