-
-
Notifications
You must be signed in to change notification settings - Fork 10
107 lines (93 loc) · 3.94 KB
/
deploy.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Build and Deploy TAF
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
architecture: ['x64', 'x86']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up 32-bit Python on Windows
if: matrix.os == 'windows-latest' && matrix.architecture == 'x86'
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: 'x86'
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-add-repository -y ppa:yubico/stable
sudo apt-get update
sudo apt-get install -qq libykpers-1-1 python-pyscard swig libpcsclite-dev
pip install --upgrade pip
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install ykpers libyubikey libusb swig openssl
mkdir -p taf/libs
wget -c https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-mac.zip -O - | tar -xz -C ./yk
find ./yk/lib -name '*.dylib' -exec cp '{}' taf/libs ';'
find /usr/local/Cellar/json-c/ -name '*.dylib' -exec cp '{}' taf/libs ';'
rm -rf yk
find /usr/local/Cellar/libusb/ -name '*.dylib' -exec cp '{}' taf/libs ';'
install_name_tool -change @executable_path/../lib/libyubikey.0.dylib @loader_path/libyubikey.0.dylib taf/libs/libykpers-1.dylib
install_name_tool -change @executable_path/../lib/libjson-c.2.dylib @loader_path/libjson-c.2.dylib taf/libs/libykpers-1.dylib
- name: Install dependencies (Windows x64)
if: matrix.os == 'windows-latest' && matrix.architecture == 'x64'
run: |
choco install swig -y
choco upgrade swig
wget https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0-win64.zip -OutFile "ykpers-1.20.0-win64.zip"
7z x ykpers-1.20.0-win64.zip -o".\ykpers"
Copy-Item ".\ykpers\bin\*.dll" ".\taf\libs" -Force -verbose
wget https://github.com/libusb/libusb/releases/download/v1.0.22/libusb-1.0.22.7z -OutFile "libusb-1.0.22.7z"
7z x libusb-1.0.22.7z -o".\libusb"
Copy-Item ".\libusb\MinGW64\dll\*.dll" ".\taf\libs" -Force -verbose
- name: Install dependencies (Windows x86)
if: matrix.os == 'windows-latest' && matrix.architecture == 'x86'
run: |
echo "Skipping 32-bit setup on non-Windows OS"
- name: Install tools
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Build TAF
run: |
python setup.py sdist bdist_wheel clean --all
- name: Copy files
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist/
- name: Upload to TestPyPi
if: startsWith(github.ref, 'refs/tags/v')
run: |
python -m pip install twine
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
env:
TWINE_USERNAME: ${{ secrets.TESTPYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TESTPYPI_PASSWORD }}
# - name: Upload wheels to PyPI
# if: startsWith(github.ref, 'refs/tags/v')
# run: |
# python -m pip install twine
# twine check dist/*
# twine upload --skip-existing dist/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }}
# env:
# PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
# PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# displayName: "Upload wheels"