File tree 2 files changed +63
-1
lines changed
2 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ __pycache__/
2
2
* .py [cod ]
3
3
* .out
4
4
/build /
5
- /dist /
5
+ /dist * /
6
6
/tmp /
7
7
src /spdx_tools /spdx /parser /tagvalue /parsetab.py
8
8
/.cache /
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # SPDX-FileCopyrightText: 2023 spdx contributors
3
+ #
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ set -euo pipefail
6
+
7
+ if [ $# -eq 0 ]; then
8
+ cat<< EOF
9
+ Usage:
10
+ $0 \$ VERSION
11
+ Example:
12
+ $0 0.8.0rc2
13
+ where 0.8.0rc2 is the version and v0.8.0rc2 is the corresponding tag.
14
+ EOF
15
+ exit 0
16
+ fi
17
+
18
+
19
+ version=" $1 "
20
+ tag=" v${version} "
21
+ tar_gz=" https://github.com/spdx/tools-python/releases/download/${tag} /spdx_tools_dist.tar.gz"
22
+ tag_dir=" dist-${tag} "
23
+
24
+ cd -- " $( dirname " $0 " ) /.."
25
+
26
+ if ! command -v twine & > /dev/null; then
27
+ echo " twine could not be found"
28
+ echo " maybe load venv with"
29
+ echo " . ./venv/bin/activate"
30
+ echo " . ./venv/bin/activate.fish"
31
+ echo
32
+
33
+ if [[ -d ./venv/bin/ ]]; then
34
+ echo " will try to activate ./venv ..."
35
+
36
+ source ./venv/bin/activate
37
+
38
+ if ! command -v twine & > /dev/null; then
39
+ echo " twine still could not be found"
40
+ exit 1
41
+ fi
42
+ else
43
+ exit 1
44
+ fi
45
+ fi
46
+
47
+
48
+ if [[ -d " $tag_dir " ]]; then
49
+ echo " the dir \" $tag_dir \" already exists, exiting for safety"
50
+ exit 1
51
+ fi
52
+
53
+ mkdir -p " $tag_dir "
54
+ (cd " $tag_dir " && wget -c " $tar_gz " -O - | tar --strip-components=1 -xz)
55
+
56
+ twine check " ${tag_dir} /spdx-tools-${version} .tar.gz" " ${tag_dir} /spdx_tools-${version} -py3-none-any.whl"
57
+ read -r -p " Do you want to upload? [y/N] " response
58
+ case " $response " in
59
+ [yY][eE][sS]|[yY])
60
+ twine upload -r pypi " ${tag_dir} /spdx-tools-${version} .tar.gz" " ${tag_dir} /spdx_tools-${version} -py3-none-any.whl"
61
+ ;;
62
+ esac
You can’t perform that action at this time.
0 commit comments