33
44name : build
55
6- env :
7- package : tinyscript
8-
96on :
107 push :
118 branches : [ "main" ]
129 pull_request :
1310 branches : [ "main" ]
1411
1512permissions :
13+ actions : write
1614 id-token : write # for OIDC
1715 contents : read
1816
1917jobs :
18+ prepare :
19+ runs-on : ubuntu-latest
20+ outputs :
21+ package : ${{ steps.pkg.outputs.package }}
22+ steps :
23+ - name : Compute package name from the repository's
24+ id : pkg
25+ run : |
26+ name="${GITHUB_REPOSITORY##*/}"
27+ echo "package=${name#python-}" >> $GITHUB_OUTPUT
2028 build :
29+ needs : prepare
2130 runs-on : ${{ matrix.os }}
2231 strategy :
2332 fail-fast : false
2433 matrix :
2534 os : [ubuntu-latest]
2635 python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
36+ env :
37+ package : ${{ needs.prepare.outputs.package }}
2738 steps :
28- - uses : actions/checkout@v4
39+ - uses : actions/checkout@v5
2940 - name : Set up Python ${{ matrix.python-version }}
30- uses : actions/setup-python@v5
41+ uses : actions/setup-python@v6
3142 with :
3243 python-version : ${{ matrix.python-version }}
3344 - name : Install pandoc
@@ -42,16 +53,18 @@ jobs:
4253 run : |
4354 pytest --cov=$package
4455 coverage :
45- needs : build
56+ needs : [prepare, build]
4657 runs-on : ubuntu-latest
4758 env :
4859 cov_badge_path : docs/coverage.svg
60+ package : ${{ needs.prepare.outputs.package }}
61+ python_version : " 3.13"
4962 steps :
50- - uses : actions/checkout@v4
51- - name : Set up Python ${{ matrix.python-version }}
52- uses : actions/setup-python@v5
63+ - uses : actions/checkout@v5
64+ - name : Set up Python ${{ env.python_version }}
65+ uses : actions/setup-python@v6
5366 with :
54- python-version : " 3.13 "
67+ python-version : ${{ env.python_version }}
5568 - name : Install pandoc
5669 run : sudo apt-get install -y pandoc notification-daemon
5770 - name : Install ${{ env.package }}
@@ -79,15 +92,15 @@ jobs:
7992 git commit -m "Updated coverage.svg"
8093 - name : Push changes
8194 if : steps.changed_files.outputs.files_changed == 'true'
82- uses : ad-m/github-push-action@v1.0.0
95+ uses : ad-m/github-push-action@master
8396 with :
8497 github_token : ${{ secrets.github_token }}
8598 branch : ${{ github.ref }}
8699 deploy :
87100 runs-on : ubuntu-latest
88- needs : coverage
101+ needs : [prepare, coverage]
89102 steps :
90- - uses : actions/checkout@v4
103+ - uses : actions/checkout@v5
91104 with :
92105 fetch-depth : 0
93106 - name : Check for version change
@@ -104,7 +117,7 @@ jobs:
104117 awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
105118 mv -f README README.md
106119 - if : steps.filter.outputs.version == 'true'
107- name : Build ${{ env .package }} package
120+ name : Build ${{ needs.prepare.outputs .package }} package
108121 run : python3 -m pip install --upgrade build && python3 -m build
109122 - if : steps.filter.outputs.version == 'true'
110123 name : Publish to PyPI
0 commit comments