-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·104 lines (89 loc) · 1.8 KB
/
release.sh
File metadata and controls
executable file
·104 lines (89 loc) · 1.8 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env bash
set -euo pipefail
REF="${REF:-development}"
usage() {
cat <<'EOF'
Usage:
./release.sh prepare-pr
./release.sh sync-back [--post-release] [--dry-run]
./release.sh release [--dry-run] [--with-docker-images]
Environment:
REF=development Branch ref to use for workflow dispatch
EOF
}
require_gh() {
command -v gh >/dev/null 2>&1 || {
echo "Error: gh is not installed." >&2
exit 1
}
}
run_prepare_pr() {
gh workflow run release_1_prepare_release_pr.yml --ref "$REF"
}
run_sync_back() {
local mode="reconcile"
local dry_run="false"
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run)
dry_run="true"
;;
--post-release)
mode="post-release"
;;
*)
usage >&2
echo "Error: unknown sync-back option: $1" >&2
exit 1
;;
esac
shift
done
gh workflow run release_3_sync_back.yml --ref "$REF" -f mode="$mode" -f dry_run="$dry_run"
}
run_release() {
local dry_run="false"
local with_docker_images="false"
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run)
dry_run="true"
;;
--with-docker-images)
with_docker_images="true"
;;
*)
usage >&2
echo "Error: unknown release option: $1" >&2
exit 1
;;
esac
shift
done
gh workflow run release_5_publish.yml --ref "$REF" -f dry-run-semantic-release="$dry_run" -f with-docker-images="$with_docker_images"
}
main() {
require_gh
case "${1:-}" in
prepare-pr)
run_prepare_pr
;;
sync-back)
shift
run_sync_back "$@"
;;
release)
shift
run_release "$@"
;;
-h|--help|help|"")
usage
;;
*)
usage >&2
echo "Error: unknown command: $1" >&2
exit 1
;;
esac
}
main "$@"