forked from p2p-org/solana-swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
upversion
executable file
·29 lines (23 loc) · 851 Bytes
/
upversion
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
#!/bin/bash
# exit when any command fails
set -e
# check if CHANGELOG was added
log=`sed -n '/^## '$1'/p;q' CHANGELOG.md`
if [ -z "$log" ]
then
echo "CHANGELOG for version $1 must be added! (The CHANGELOG.md file must start with '## $1')"; exit 1;
else
echo "CHANGELOG added, releasing version $1"
fi
# set version in README.md
gsed -i 's/pod '\'SolanaSwift\'', '\''~> '.*''\''/pod '\'SolanaSwift\'', '\''~> '$1'\'\''/g' README.md
gsed -i 's/solana-swift", from: "'.*'")/solana-swift", from: "'$1'")/g' README.md
# set version in podspec
gsed -i 's/s.version.*= '.*'/s.version = '\'''$1'\'\''/g' SolanaSwift.podspec
# commit and tag
git add 'SolanaSwift.podspec' 'README.md'
git commit -m "feat: upversion to '$1'"
git tag ''$1''
git push origin main --tags
# upload in cocoapods
pod trunk push SolanaSwift.podspec --allow-warnings