File tree 3 files changed +15
-28
lines changed
3 files changed +15
-28
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,11 @@ jobs:
21
21
with :
22
22
python-version : ${{ matrix.python-version }}
23
23
24
- - name : Install dependencies
24
+ - name : Install dependencies and run CI
25
25
run : |
26
26
python -m pip install --upgrade pip
27
- pip install pytest
28
- pip install -e .
29
-
30
- - name : Run tests
31
- run : pytest
27
+ pip install build pytest pytest-cov setuptools_scm
28
+ make ci
32
29
33
30
publish :
34
31
needs : test
@@ -41,23 +38,16 @@ jobs:
41
38
with :
42
39
python-version : ' 3.x'
43
40
44
- - name : Install build tools
45
- run : |
46
- python -m pip install --upgrade pip
47
- pip install build twine
48
-
49
41
- name : Verify tag version matches package version
50
42
run : |
51
- PACKAGE_VERSION=$(python setup.py --version)
52
- TAG_VERSION=${GITHUB_REF#refs/tags/v}
43
+ pip install twine
44
+ PACKAGE_VERSION=$(python -m setuptools_scm)
45
+ TAG_VERSION=${GITHUB_REF#refs/tags/} # Remove 'refs/tags/' prefix
53
46
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
54
47
echo "Package version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)"
55
48
exit 1
56
49
fi
57
50
58
- - name : Build package
59
- run : python -m build
60
-
61
51
- name : Publish to TestPyPI
62
52
if : contains(github.ref, 'test')
63
53
env :
70
60
env :
71
61
TWINE_USERNAME : __token__
72
62
TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
73
- run : twine upload dist/*
63
+ run : make ci. dist
74
64
75
65
- name : Create Release
76
66
uses : softprops/action-gh-release@v1
Original file line number Diff line number Diff line change 12
12
runs-on : windows-latest
13
13
strategy :
14
14
matrix :
15
- python-version : ['3.11', '3. 12']
15
+ python-version : ['3.12']
16
16
architecture : ['x64']
17
17
18
18
steps :
@@ -31,17 +31,11 @@ jobs:
31
31
- name : Install dependencies
32
32
run : |
33
33
python -m pip install --upgrade pip
34
- pip install pytest pytest-cov
35
- pip install -e .
34
+ pip install build pytest pytest-cov
36
35
37
36
- name : Run tests
38
37
run : |
39
- pytest --cov=cedarscript_ast_parser tests/
40
- - name : Test PyPI installation
41
- run : |
42
- pip uninstall cedarscript-ast-parser -y
43
- pip install cedarscript-ast-parser
44
- python -c "from cedarscript_ast_parser import CEDARScriptASTParser; CEDARScriptASTParser()"
38
+ make ci
45
39
46
40
# Optional: Upload artifacts if your package generates any
47
41
- name : Upload artifacts
Original file line number Diff line number Diff line change 1
1
.PHONY : all dist d clean c version v install i test t build b
2
2
3
- all : clean install test build version
3
+ ci : clean install test
4
+ all : ci build version
4
5
5
- dist d : all
6
+ dist d : all ci.dist
7
+
8
+ ci.dist :
6
9
scripts/check-version.sh
7
10
twine upload dist/*
8
11
You can’t perform that action at this time.
0 commit comments