-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathmanage.sh
More file actions
executable file
·81 lines (68 loc) · 2.48 KB
/
manage.sh
File metadata and controls
executable file
·81 lines (68 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -o errexit -o nounset -o pipefail
source "$(dirname ${BASH_SOURCE[0]})/common.sh"
[[ $# -eq 0 ]] && user_error "expected action as argument"
readonly action=$1
if [[ $action == @(push|fetch|update|default) ]]; then
[[ $# -ne 1 ]] && user_error "expected no arguments for $action"
elif [[ $action == @(release|delete) ]]; then
readonly tag_name=$2
[[ $# -ne 2 ]] && user_error "expected tag name as argument for $action"
else
user_error "unrecognized action"
fi
if [[ $OFFICIAL_BUILD = true ]]; then
export GIT_AUTHOR_NAME=GrapheneOS
export GIT_AUTHOR_EMAIL=contact@grapheneos.org
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
fi
for repo in "${aosp_forks[@]}"; do
echo -e "\n>>> $(tput setaf 3)Handling $repo$(tput sgr0)"
cd $repo
git checkout $branch
if [[ $action == delete ]]; then
git tag -d $tag_name || true
git push origin --delete $tag_name || true
elif [[ $action == release ]]; then
git tag -s $tag_name -m $tag_name
git push origin $tag_name
elif [[ $action == update ]]; then
git fetch upstream --tags
git rebase --onto $aosp_tag $aosp_tag_old
git push -f
elif [[ $action == push ]]; then
git push
elif [[ $action == fetch ]]; then
git fetch upstream --tags
elif [[ $action == default ]]; then
gh repo edit GrapheneOS/$repo --default-branch $branch
fi
cd ..
done
for repo in ${independent[@]}; do
echo -e "\n>>> $(tput setaf 3)Handling $repo$(tput sgr0)"
cd $repo
git checkout $branch
if [[ $action == delete ]]; then
git tag -d $tag_name || true
git push origin --delete $tag_name || true
elif [[ $action == release ]]; then
if [[ $repo == @(kernel_manifest-pixel|kernel_manifest-6.1|kernel_manifest-6.6|kernel_manifest-6.12|platform_manifest) ]]; then
git checkout -B tmp
sed -i s%refs/heads/$branch%refs/tags/$tag_name% default.xml
git commit default.xml -m $tag_name
git push -fu origin tmp
else
git tag -s $tag_name -m $tag_name
git push origin $tag_name
fi
elif [[ $action == push ]]; then
git push
elif [[ $action == default ]]; then
if [[ $repo != @(hardened_malloc|kernel_pixel|kernel_pixel_muzel|platform_external_vanadium) ]]; then
gh repo edit GrapheneOS/$repo --default-branch $branch
fi
fi
cd ..
done