1+ name : On Release Workflow
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ test :
9+ runs-on : ubuntu-latest
10+ strategy :
11+ fail-fast : false
12+ matrix :
13+ python-version : ["3.10", "3.11", "3.12", "3.13"]
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v3
18+
19+ - name : Set up Python ${{ matrix.python-version }}
20+ uses : actions/setup-python@v5
21+ with :
22+ python-version : ${{ matrix.python-version }}
23+
24+ - name : Install dependencies
25+ run : |
26+ python -m pip install --upgrade pip
27+ pip install pytest coverage
28+
29+ - name : Install make
30+ run : sudo apt-get install make
31+
32+ - name : Run tests
33+ run : make tests -k
34+
35+ - name : Upload test reports
36+ if : success() || failure()
37+ uses : actions/upload-artifact@v4
38+ with :
39+ name : test-reports-${{ matrix.python-version }}
40+ path : tests_reports/
41+
42+ - name : publish test report
43+ if : success() || failure()
44+ uses : mikepenz/action-junit-report@v5
45+ with :
46+ report_paths : tests_reports/**/report.xml
47+ include_passed : true
48+ check_name : Pytest Test Report (${{ matrix.python-version }})
49+
50+ build :
51+ runs-on : ubuntu-latest
52+ needs : test
53+ steps :
54+ - name : Checkout code
55+ uses : actions/checkout@v4
56+
57+ - name : Set up Python 3.10
58+ uses : actions/setup-python@v5
59+ with :
60+ python-version : 3.10
61+
62+ - name : Install dependencies
63+ run : |
64+ python -m pip install --upgrade pip
65+ pip install build
66+
67+ - name : Build package
68+ run : make VERSION=${{ github.event.release.tag_name }}
69+
70+ - name : Upload package artifacts
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : package-artifacts-${{ github.event.release.tag_name }}
74+ path : |
75+ dist/*.tar.gz
76+ dist/*.whl
77+
78+ - name : Publish release assets
79+ uses : AButler/upload-release-assets@v3.0
80+ with :
81+ files : " dist/*"
82+ repo-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments