-
-
Notifications
You must be signed in to change notification settings - Fork 35
88 lines (71 loc) · 2.57 KB
/
Copy pathwindows.yml
File metadata and controls
88 lines (71 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Windows Build
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
windows-arch: ['x86', 'x64']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.windows-arch }}
- name: Install build tools
run: |
python --version
python -c "import struct; print(struct.calcsize('P') * 8)"
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
# We need wheel installed to build wheels
pip install wheel
choco install swig
swig -version
- name: Build
shell: cmd
run: |
python setup.py sdist
python setup.py bdist
python setup.py bdist_wheel
python setup.py install
copy /Y src\LowLevel.py PyKCS11\
pip show PyKCS11 | python -c "import sys; print([line for line in sys.stdin if line.startswith('Location:')][0].split(':',1)[1].strip())" > _tmp
set /p PYKCS11_INSTALL_DIR=<_tmp
copy /Y %PYKCS11_INSTALL_DIR%\PyKCS11\* PyKCS11\
del _tmp
- name: Tests
shell: cmd
run: |
curl -Lo softhsm.zip https://github.com/disig/SoftHSM2-for-Windows/releases/download/v2.5.0/SoftHSM2-2.5.0-portable.zip
7z -bb3 -oc:\\ x softhsm.zip
set SOFTHSM2_CONF=C:\SoftHSM2\etc\softhsm2.conf
set PATH=%PATH%;C:\SoftHSM2\lib\
c:\\SoftHSM2\\bin\\softhsm2-util --init-token --slot 0 --label "A token" --pin 1234 --so-pin 123456
python run_test.py --ignore=test/test_LowLevel.py
- uses: actions/upload-artifact@v7
with:
name: wheel-${{ matrix.python-version }}-${{ matrix.windows-arch }}
path: dist/*.whl
publish:
name: "PyPI Publish"
needs: "build"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: "ubuntu-latest"
environment:
name: pypi
url: https://pypi.org/p/pyscard
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1
- name: move wheels to dist/
run: |
mkdir -v dist
mv -v wheel-*/*.whl dist/
ls -al dist/
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0