Make hyprland version a variable for easy replacing. Make script
Some checks failed
Build hyprland-git / Build and push image (push) Failing after 4m47s
Some checks failed
Build hyprland-git / Build and push image (push) Failing after 4m47s
automate more of update process
This commit is contained in:
@@ -3,6 +3,21 @@ set -euxo pipefail
|
||||
|
||||
curl_opts=(--connect-timeout 10 --retry 7 --retry-connrefused -Ss -X POST)
|
||||
|
||||
oldHyprlandVersion="$(sed -n 's/.*hyprland_version \(.*\)/\1/p' hyprland-git.spec)"
|
||||
newHyprlandVersion="$(curl -L \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"https://api.github.com/repos/hyprwm/Hyprland/releases" | jq -r 'first.name' | sed -e "s/^v//")"
|
||||
|
||||
oldBumpVersion="$(sed -n 's/.*bumpver \(.*\)/\1/p' hyprland-git.spec)"
|
||||
newBumpVersion=oldBumpVersion
|
||||
|
||||
if [[ "$oldHyprlandVersion" == "$newHyprlandVersion" ]]; then
|
||||
newBumpVersion=$((newBumpVersion+1))
|
||||
else
|
||||
newBumpVersion=1
|
||||
fi
|
||||
|
||||
oldHyprlandCommit="$(sed -n 's/.*hyprland_commit \(.*\)/\1/p' hyprland-git.spec)"
|
||||
newHyprlandCommit="$(curl -s -H "Accept: application/vnd.github.VERSION.sha" "https://api.github.com/repos/hyprwm/Hyprland/commits/main")"
|
||||
|
||||
@@ -28,8 +43,10 @@ newUdis86Commit="$(curl -L \
|
||||
"https://api.github.com/repos/hyprwm/Hyprland/contents/subprojects/udis86?ref=$newHyprlandCommit" | jq -r '.sha')"
|
||||
|
||||
sed -e "s/$oldHyprlandCommit/$newHyprlandCommit/" \
|
||||
-e "/%global bumpver/s/$oldBumpVersion/$newBumpVersion/" \
|
||||
-e "/%global commits_count/s/$oldCommitsCount/$newCommitsCount/" \
|
||||
-e "s/$oldCommitDate/$newCommitDate/" \
|
||||
-e "s/$oldProtocolsCommit/$newProtocolsCommit/" \
|
||||
-e "s/$oldUdis86Commit/$newUdis86Commit/" \
|
||||
-e "/%global hyprland_version/s/$oldHyprlandVersion/$newHyprlandVersion/" \
|
||||
-i hyprland-git.spec
|
||||
|
||||
Reference in New Issue
Block a user