forked from MESAHub/mesa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·42 lines (29 loc) · 960 Bytes
/
release
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
#!/bin/bash
VERSION="$1"
if [[ ! -n ${VERSION}} ]]; then
echo 'Please specify version number'
exit 1
fi
cd ${MESA_DIR} || exit 1
# Do the work in a sperate branch
git checkout -b release/${VERSION}
# Add version_number file
echo ${VERSION} > data/version_number
git add -f data/version_number
# Update dox
sed -i "s/PROJECT_NUMBER\ \ \ .*/PROJECT_NUMBER\ \ \ \ \ \ \ \ \ =\ ${VERSION}/" Doxyfile
git add Doxyfile
# Update docs/source/conf.py
sed -i 's/release\ =.*/release\ =\ '"'${VERSION}'"'/' docs/source/conf.py
sed -i 's/version\ =.*/version\ =\ '"'${VERSION}'"'/' docs/source/conf.py
git add docs/source/conf.py
git commit -a -m "Release: ${VERSION}"
git tag ${VERSION}
# Make the archive
git archive --prefix=mesa-${VERSION}/ --format=zip ${VERSION} > mesa-${VERSION}.zip
echo "Now check the archive builds before pushing the changes"
exit 0
# Cleanup when testing
git checkout main
git tag -d ${VERSION}
git branch -D release/${VERSION}