@@ -2,11 +2,10 @@ name: Build & Release
22
33on :
44 push :
5- branches : ['**']
5+ branches :
6+ - master
67 pull_request :
7- branches : ['**']
88 workflow_dispatch :
9- # Allow workflow to be triggered manually.
109
1110permissions :
1211 contents : read
@@ -15,47 +14,44 @@ jobs:
1514 build :
1615 name : build-test (python ${{ matrix.python-version }})
1716 runs-on : ubuntu-latest
18-
17+
1918 strategy :
19+ fail-fast : false
2020 matrix :
21- python-version : ['3.10', '3.11', '3.12', '3.13' ]
21+ python-version : ['3.10', '3.11', '3.12']
2222
2323 steps :
2424 - name : Checkout repository
2525 uses : actions/checkout@v4
2626
27- - name : Set up Python ${{ matrix.python-version }}
27+ - name : Set up Python
2828 uses : actions/setup-python@v5
2929 with :
3030 python-version : ${{ matrix.python-version }}
31- cache : ' pip'
32-
33- - name : Install pandoc
34- run : |
35- sudo apt-get update
36- sudo apt-get install pandoc
37- pip install pypandoc
31+ cache : pip
3832
3933 - name : Install dependencies
40- run : pip install 'tox<4' tox-gh-actions
34+ run : |
35+ pip install 'tox<4' tox-gh-actions
4136
4237 - name : Run tests
4338 run : tox
4439
4540 create-release :
4641 name : semantic-release
47- if : " github.ref_name == 'master' && github.event_name != 'pull_request'"
42+ if : github.ref == 'refs/heads/ master' && github.event_name != 'pull_request'
4843 needs : build
4944 runs-on : ubuntu-latest
45+
5046 permissions :
5147 contents : write
5248
5349 steps :
5450 - name : Checkout repository
5551 uses : actions/checkout@v4
5652 with :
57- persist-credentials : false
5853 fetch-depth : 0
54+ persist-credentials : false
5955
6056 - name : Setup Node.js
6157 uses : actions/setup-node@v4
@@ -67,10 +63,16 @@ jobs:
6763 with :
6864 python-version : ' 3.10'
6965
70- - name : Install Publishing Tools
66+ - name : Install pandoc
67+ run : |
68+ sudo apt-get update
69+ sudo apt-get install -y pandoc
70+ pip install pypandoc
71+
72+ - name : Install publishing tools
7173 run : |
7274 pip install bump2version build twine
73- npm install
75+ npm ci
7476
7577 - name : Run semantic-release
7678 env :
8082 - name : Publish to PyPI
8183 if : success()
8284 env :
83- PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
85+ TWINE_USERNAME : __token__
86+ TWINE_PASSWORD : ${{ secrets.PYPI_TOKEN }}
8487 run : |
8588 python -m build
86- python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
89+ python -m twine upload dist/*
0 commit comments