-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
executable file
·40 lines (31 loc) · 978 Bytes
/
release.sh
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
#!/bin/sh
#
# This file is part of Blokada.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Copyright © 2023 Blocka AB. All rights reserved.
#
# @author Karol Gusak ([email protected])
#
set -e
if [ "$#" -ne 3 ]; then
echo "Error: You must provide the version number. ./release.sh XX YY ZZ" >&2
exit 1
fi
./sync-translations.sh
# Drops leading zeros
major=${2#0}
minor=${3#0}
tag="$1.$major.$minor"
code="$1$2$3"
commit="release: $tag"
echo "Marking release: $tag..."
sed -Ei '' "s/CURRENT_PROJECT_VERSION = ((23|24|25).*)\;/CURRENT_PROJECT_VERSION = $code\;/; s/MARKETING_VERSION = ((23|24|25).*)\;/MARKETING_VERSION = $tag\;/" IOS.xcodeproj/project.pbxproj
git add IOS.xcodeproj/project.pbxproj
git commit -m "$commit"
git tag $tag
echo "Done. Run this to push:"
echo "git push --atomic origin main $tag"