1+ name : build_wppm_test_publish
2+ # 2025-08-16: from TornadoWeb simple example, and full bash
3+ # object:
4+ # - learn the matrix method
5+ # - be compatible with cibuilds later
6+ # - copy the methods the most widly used
7+ #
8+ # using a predefined hashed wheel environnment: pylock.wppmbuild.toml
9+ # pip freeze>test.txt
10+ # python -m pip lock --no-deps --find-links=C:\WinP\packages.srcreq -r test.txt -o pylock.wppmbuild.toml
11+ # python -X utf8 -c "from wppm import wheelhouse as wh; wh.pylock_to_req('pylock.wppmbuild.toml', r'requir.wppmbuild.txt')"
12+ #
13+ on :
14+ workflow_dispatch :
15+ # Allow this workflow to be run manually (pushing to testpypi instead of pypi)
16+ permissions : {}
17+
18+ env :
19+ python-version : ' 3.13'
20+ WINPYrequirements : ' ./winpython/portable/cycle_2025_04/requir.wppmbuild.txt'
21+
22+ jobs :
23+ build_wheels :
24+ name : Build wheels on ${{ matrix.os }}
25+ runs-on : ${{ matrix.os }}
26+ strategy :
27+ fail-fast : false
28+ matrix :
29+ os : [windows-latest]
30+
31+ steps :
32+ - uses : actions/checkout@v4
33+ with :
34+ persist-credentials : false
35+
36+ - uses : actions/setup-python@v5
37+ name : Install Python
38+ with :
39+ python-version : ${{ env.python-version }}
40+
41+ - name : Install dependencies to build with bash
42+ shell : bash
43+ run : |
44+ python -m pip install --no-deps --require-hashes -r ${{ env.WINPYrequirements }}
45+
46+ # - name: Install dependencies to build with pwsh
47+ # shell: pwsh
48+ # run: |
49+ # python -m pip install --no-deps --require-hashes -r $env.WINPYrequirements
50+
51+ - name : try diagnose flit problem
52+ shell : bash
53+ run : |
54+ git status
55+ git status --ignored --untracked-files=all
56+
57+ - name : Build sdist
58+ shell : bash
59+ run : |
60+ python -m flit build && ls -l dist
61+
62+
63+ - name : prepare result
64+ shell : bash
65+ run : |
66+ mkdir wheelhouse
67+ cp dist/*.whl wheelhouse
68+
69+ - name : generate hashes wppm style
70+ shell : bash
71+ run : |
72+ DESTFILE="./wheelhouse/hashes.md"
73+ python -c "import sys;from wppm import hash; hash.print_hashes(sys.argv[1:])" wheelhouse/*.whl > $DESTFILE
74+
75+
76+ - name : List wheelhouse contents (for debugging)
77+ shell : bash
78+ run : |
79+ ls -1 wheelhouse
80+
81+ - uses : actions/upload-artifact@v4
82+ with :
83+ name : artifacts-${{ matrix.os }}
84+ path : ./wheelhouse/*.*
85+ retention-days : 3 # keeps artifact for 3 days
86+
87+ upload_pypi_test :
88+ name : Upload to PyPI (test)
89+ needs : [build_wheels]
90+ runs-on : windows-latest
91+ permissions :
92+ # This permission is required for pypi's "trusted publisher" feature
93+ id-token : write
94+ steps :
95+ - uses : actions/download-artifact@v4
96+ with :
97+ pattern : artifacts-*
98+ path : dist
99+ merge-multiple : true
100+
101+ - uses : pypa/gh-action-pypi-publish@release/v1
102+ with :
103+ repository-url : https://test.pypi.org/legacy/
104+ skip-existing : true
0 commit comments