-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·54 lines (53 loc) · 1.22 KB
/
release.sh
File metadata and controls
executable file
·54 lines (53 loc) · 1.22 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
#!/bin/bash
source ~/anaconda3/etc/profile.d/conda.sh
conda activate base
rm tests.log
rm dist* -r
rm -r .pytest_cache
rm -r build
rm -r watson-reqs
conda remove -n watson-reqs --all -y
rm -R *egg-info
rm -R .tox
set -e
#tox > tests.log
#tests_results=$(cat tests.log | grep "congratulations")
#if ! [[ -z ${tests_results} ]]; then
echo "Building"
set +e
rm tests.log
rm dist* -r
rm -r .pytest_cache
rm -r build
rm -r watson-reqs
conda remove -n watson-reqs --all -y
set -e
conda create -n watson-reqs python=3.11 -y
conda activate watson-reqs
python3 -m pip install pip -U
python3 -m pip install numpy==2.1.1
git_tag=$1
sed -i '6s/.*/version = "'${git_tag}'"/' setup.py
sed -i '1s/.*/__version__ = "'${git_tag}'"/' watson/__init__.py
python3 -m pip install .
python3 -m pip list --format=freeze > requirements.txt
conda deactivate
git pull
git add setup.py
git add watson/__init__.py
git add requirements.txt
git commit -m "Preparing release ${git_tag}"
git tag ${git_tag} -m "New release"
git push && git push --tags
#else
# echo "Failed tests"
#fi
set +e
rm -R watson-reqs
rm dist* -r
rm -r .pytest_cache
rm -r build
rm -R *egg-info
rm -R .tox
conda remove -n watson-reqs --all -y
set -e