-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy.sh
executable file
·32 lines (22 loc) · 1.25 KB
/
deploy.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
RELEASE_DATE=$(date +%Y-%m-%d)
LATEST_VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed -En 's/v//p')
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
RELEASE_NUMBER="${1}"
echo $(ls)
git config --global user.email "[email protected]"
git config --global user.name "Ismaël Lachheb"
## update version information
sed -i 's/version="'${LATEST_VERSION}'"/version="'${RELEASE_NUMBER}'"/g' data/com.github.lachhebo.Gabtag.appdata.xml.in
sed -i 's/release date="'[1234567890-]*'"/release date="'${RELEASE_DATE}'"/g' data/com.github.lachhebo.Gabtag.appdata.xml.in
sed -i 's/'${LATEST_VERSION}'/'${RELEASE_NUMBER}'/g' src/version.py
## commit those modification and create a new release tag
git commit -am 'upgrade version to '${RELEASE_NUMBER}
git tag -a ${RELEASE_NUMBER} -m "version"${RELEASE_NUMBER}
git push
git push --tags
## clone flathub repo and update manifest to match latest tags
git clone https://github.com/flathub/com.github.lachhebo.Gabtag.git
cd com.github.lachhebo.Gabtag
sed -i 's/"tag": "'${LATEST_TAG}'"/"tag": "'${RELEASE_NUMBER}'"/g' com.github.lachhebo.Gabtag.json
git commit -am "upgrade to new version "${RELEASE_NUMBER}
git push https://lachhebo:${PASSWORD_DEPLOYEMENT}@github.com/flathub/com.github.lachhebo.Gabtag.git