File tree 3 files changed +43
-12
lines changed
3 files changed +43
-12
lines changed Original file line number Diff line number Diff line change 35
35
python -m pip install --upgrade pip
36
36
python -m pip install build
37
37
38
+ - name : Check git status (not Windows)
39
+ if : runner.os != 'Windows'
40
+ run : |
41
+ if [[ -z "$(git status --porcelain)" ]]; then
42
+ echo "No changes found."
43
+ else
44
+ echo "Changes detected. Please commit or discard changes before publishing."
45
+ git status --porcelain
46
+ exit 1
47
+ fi
48
+
49
+ - name : Check git status (Windows)
50
+ if : runner.os == 'Windows'
51
+ run : |
52
+ if (-not (git status --porcelain)) {
53
+ Write-Output "No changes found."
54
+ } else {
55
+ Write-Output "Changes detected. Please commit or discard changes before publishing."
56
+ git status --porcelain
57
+ exit 1
58
+ }
59
+
38
60
- name : Build the package
39
61
run : python -m build --outdir .
40
62
Original file line number Diff line number Diff line change 32
32
with :
33
33
fetch-depth : 0 # IMPORTANT: otherwise the current tag does not get fetched and the build version gets worse
34
34
35
- - name : Check Git status
35
+ - name : Check git status
36
36
run : |
37
37
if [[ -z "$(git status --porcelain)" ]]; then
38
38
echo "No changes found."
Original file line number Diff line number Diff line change 58
58
# # Run the unit tests for Python 3.8 until 3.11
59
59
# #
60
60
Test :
61
- needs : [Build ]
61
+ needs : [Pre-Commit ]
62
62
uses : ./.github/workflows/_test.yaml
63
63
strategy :
64
64
matrix :
72
72
# #
73
73
CodeCov :
74
74
if : |
75
- success() &&
76
- github.actor == 'btschwertfeger' &&
77
- github.event_name == 'push'
78
- needs : [Test]
75
+ (success() && github.actor == 'btschwertfeger')
76
+ && (github.event_name == 'push' || github.event_name == 'release')
77
+ needs : [Pre-Commit]
79
78
uses : ./.github/workflows/_codecov.yaml
80
79
with :
81
80
os : ubuntu-latest
@@ -87,11 +86,17 @@ jobs:
87
86
# #
88
87
UploadTestPyPI :
89
88
if : |
90
- success() &&
91
- github.actor == 'btschwertfeger' &&
92
- github.ref == 'refs/heads/master' &&
93
- github.event_name == 'push'
94
- needs : [Test]
89
+ (
90
+ success()
91
+ && github.actor == 'btschwertfeger'
92
+ && github.ref == 'refs/heads/master'
93
+ )
94
+ && (github.event_name == 'push' || github.event_name == 'release')
95
+ needs :
96
+ - Build
97
+ - Build-Doc
98
+ - Test
99
+ - CodeQL
95
100
name : Upload current version to Test PyPI
96
101
uses : ./.github/workflows/_pypi_publish.yaml
97
102
with :
@@ -106,7 +111,11 @@ jobs:
106
111
success() &&
107
112
github.actor == 'btschwertfeger' &&
108
113
github.event_name == 'release'
109
- needs : [Test]
114
+ needs :
115
+ - Build
116
+ - Build-Doc
117
+ - Test
118
+ - CodeQL
110
119
name : Upload the current release to PyPI
111
120
uses : ./.github/workflows/_pypi_publish.yaml
112
121
with :
You can’t perform that action at this time.
0 commit comments