GitHub ããææ°ãã¼ã¸ã§ã³ã® release ã® tar ball ãæã£ã¦ãã¦ãå±éãã¦ããã«ããããã¨ããããã«ãã¹ã¯ãªããå
ã§ãã¼ã¸ã§ã³æ
å ±ã®åãè¾¼ã¿ã« git
ã³ãã³ãã使ã£ã¦ãã .git
ãå梱ããã¦ããªããããgit
ã³ãã³ããããã¦ãã«ãã§ããªãã¨ãããã¿ã¼ã³ã«ééããå ´åã®å¯¾å¦æ³ã«ã¤ãã¦ã¾ã¨ããã(æ»
å¤ã«ãªãã)
å ·ä½ä¾ããããã¨ã以ä¸ã®ãããªãã®ã§ããã
git rev-parse
ã§ã½ã¼ã¹ã«åãè¾¼ãããã®ã³ãããããã·ã¥ãåãåºãã¦ããããå½ç¶ãªãã .git
ããªããã°åããããã®ãã¨ã®åå¨ãã§ãã¯ã§ fatal ã«ãªã£ã¦ãã¾ãããã«ããã§ããªãã¨ããç¶æ³ã¨ãªãã
ãã®ä¾ã§ã¯ä»£æ¿æ¡ã¨ã㦠commit_hash.txt
ãäºåã«ããã°ãããã使ãã¨ããåå²ããããããGitHub API ããã³ãããããã·ã¥ãæã£ã¦ãã¦ãæ¸ãè¾¼ãã§ãããã¨ã§ .git
ããªãã¦ãããã«ãã§ããããã«ãªãã
$ echo `curl --no-progress-meter -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/ethereum/solidity/tags | jq ".[] | select(.name == \"v${PV}\") | .commit.sha" | cut -b 2-9` > commit_hash.txt
ãªãã¸ããªã®ã¿ã°ä¸è¦§ãåå¾ãã API ãå©ãã
ããã¨ä»¥ä¸ã®ãã㪠JSON ãåå¾ã§ããã
[ { "name": "v0.8.4", "zipball_url": "https://api.github.com/repos/ethereum/solidity/zipball/refs/tags/v0.8.4", "tarball_url": "https://api.github.com/repos/ethereum/solidity/tarball/refs/tags/v0.8.4", "commit": { "sha": "c7e474f243fa6bd6d6c172118b95d52113b5fbad", "url": "https://api.github.com/repos/ethereum/solidity/commits/c7e474f243fa6bd6d6c172118b95d52113b5fbad" }, "node_id": "MDM6UmVmNDA4OTI4MTc6cmVmcy90YWdzL3YwLjguNA==" }, { "name": "v0.8.3", "zipball_url": "https://api.github.com/repos/ethereum/solidity/zipball/refs/tags/v0.8.3", "tarball_url": "https://api.github.com/repos/ethereum/solidity/tarball/refs/tags/v0.8.3", "commit": { "sha": "8d00100c4e9d211830a5dbf6a1f964d98648480d", "url": "https://api.github.com/repos/ethereum/solidity/commits/8d00100c4e9d211830a5dbf6a1f964d98648480d" }, "node_id": "MDM6UmVmNDA4OTI4MTc6cmVmcy90YWdzL3YwLjguMw==" }, : ]
ãã®ä¸ãã対å¿ãã tar ball ã®ãã¼ã¸ã§ã³ã®ã³ãããããã·ã¥ã jq
ã§åãåºãããã¡ã¤ã«ã«æ¸ãè¾¼ãã°ã§ããããã¨ãªãã