Skip to content

Commit

Permalink
Merge branch 'main' into complete-devices
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Nov 13, 2023
2 parents 3adac25 + 51a7ae4 commit be354f8
Show file tree
Hide file tree
Showing 123 changed files with 11,934 additions and 3,560 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

74 changes: 39 additions & 35 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,60 @@ name: macOS

on: [push, pull_request]

# Adapted from https://github.com/sabnzbd/sabnzbd/blob/develop/.github/workflows/build_release.yml#L80
jobs:
build:

runs-on: macos-latest
runs-on: macos-11

env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
CFLAGS: -arch x86_64 -arch arm64
ARCHFLAGS: -arch x86_64 -arch arm64

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Install Poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.12.0'
cache: poetry

- name: Install dependencies
run: |
brew update
brew install swig
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run unit tests
run: poetry run pytest -v

- name: Build
run: poetry build
run: poetry install

- name: Install from tar.gz
- name: Explicitly use universal versions
run: |
pip install dist/*.tar.gz
ykman --version
[[ -z "$(ykman --version | grep -E "not found|missing")" ]]
pip uninstall -y yubikey-manager
- name: Install from wheel
run: |
pip install dist/*.whl
ykman --version
[[ -z "$(ykman --version | grep -E "not found|missing")" ]]
pip uninstall -y yubikey-manager
# Export exact versions
poetry export --without-hashes > requirements.txt
grep cryptography requirements.txt > cryptography.txt
grep cffi requirements.txt > source-reqs.txt
grep pyscard requirements.txt >> source-reqs.txt
# Remove non-universal packages
poetry run pip uninstall -y cryptography cffi pyscard
# Build cffi from source to get universal build
poetry run pip install --upgrade -r source-reqs.txt --no-binary :all:
# Explicitly install pre-build universal build of cryptography
poetry run pip download -r cryptography.txt --platform macosx_10_12_universal2 --only-binary :all: --no-deps --dest .
poetry run pip install -r cryptography.txt --no-cache-dir --no-index --find-links .
- name: PyInstaller
run: |
pip install pyinstaller
pip install dist/*.whl
pyinstaller ykman.spec
dist/ykman --version
[[ -z "$(dist/ykman --version | grep -E "not found|missing")" ]]
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
mv dist/ykman dist/ykman-$REF
poetry run pyinstaller ykman.spec
dist/ykman/ykman --version
[[ -z "$(dist/ykman/ykman --version | grep -E "not found|missing")" ]]
- name: Copy scripts
shell: bash
run: cp -r resources/macos dist/scripts

- name: Build installer
working-directory: ./dist
run: ./scripts/make_pkg.sh

- name: Upload build
uses: actions/upload-artifact@v1
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/scan.yml

This file was deleted.

40 changes: 34 additions & 6 deletions .github/workflows/source-package.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Build a source package
name: Source package

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: Install dependencies
run: |
Expand All @@ -31,11 +30,40 @@ jobs:
poetry build
mkdir artifacts
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
mv dist/yubikey-manager-*.tar.gz artifacts/yubikey-manager-$REF.tar.gz
mv dist/yubikey_manager-*.tar.gz artifacts/yubikey_manager-$REF.tar.gz
mv dist/yubikey_manager-*.whl artifacts/yubikey_manager-$REF.whl
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubikey-manager-source-package
path: artifacts

docs:
runs-on: ubuntu-latest
name: Build sphinx documentation

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install python dependencies
run: |
sudo apt-get update
sudo apt-get install -qq swig libpcsclite-dev
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Build sphinx documentation
run: poetry run make -C docs/ html

- name: Upload documentation
uses: actions/upload-artifact@v1
with:
name: yubikey-manager-docs
path: docs/_build/html
25 changes: 11 additions & 14 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,26 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
python: [ '3.x' ]

name: Python ${{ matrix.python }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Install Poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: '3.12.0'
cache: poetry

- name: Install dependencies
run: |
sudo apt-get install -qq swig libpcsclite-dev
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Run pre-commit hooks
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit install
pre-commit run --all-files --verbose
Expand All @@ -44,10 +42,9 @@ jobs:
- name: PyInstaller
run: |
pip install pyinstaller
pyinstaller ykman.spec
dist/ykman --version
[[ -z "$(dist/ykman --version | grep -E "not found|missing")" ]]
poetry run pyinstaller ykman.spec
dist/ykman/ykman --version
[[ -z "$(dist/ykman/ykman --version | grep -E "not found|missing")" ]]
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
mv dist/ykman dist/ykman-$REF
Expand Down
50 changes: 22 additions & 28 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.0'
cache: poetry

- name: Install dependencies
run: |
choco install swig
python -m pip install --upgrade pip
pip install poetry
poetry install
shell: powershell
run: poetry install

- name: Run unit tests
run: poetry run pytest -v
Expand All @@ -27,6 +31,7 @@ jobs:
- name: Install from tar.gz
shell: bash
run: |
python -m pip install --upgrade pip
pip install dist/*.tar.gz
ykman --version
[[ -z "$(ykman --version | grep -E "not found|missing")" ]]
Expand All @@ -40,31 +45,20 @@ jobs:
[[ -z "$(ykman --version | grep -E "not found|missing")" ]]
pip uninstall -y yubikey-manager
- name: Clone PyInstaller
uses: actions/checkout@v2
with:
repository: pyinstaller/pyinstaller
ref: 90431c010a23b1c9080fcb44f932d4615bb71825
path: pyinstaller

- name: Build PyInstaller
- name: PyInstaller
shell: bash
run: |
cd pyinstaller/bootloader
python waf distclean all
cd ..
pip install .
cd ..
poetry run pyinstaller ykman.spec
dist/ykman/ykman.exe --version
[[ -z "$(dist/ykman/ykman.exe --version | grep -E "not found|missing")" ]]
- name: Build exe
- name: Copy scripts
shell: bash
run: |
pip install dist/*.whl
pyinstaller ykman.spec
dist/ykman.exe --version
[[ -z "$(dist/ykman.exe --version | grep -E "not found|missing")" ]]
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
mv dist/ykman.exe dist/ykman-$REF.exe
run: cp -r resources/win dist/scripts

- name: Build installer
working-directory: ./dist
run: .\scripts\make_msi.ps1

- name: Upload build
uses: actions/upload-artifact@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ykman-gui.pkg
ykman-script.py
ykman.pkg
lib/
**/_build

# Libraries unpacked by Windows VM
/libjson-c*.dll
Expand Down
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
rev: 1.7.5
hooks:
- id: bandit
exclude: ^test(s)?/ # keep in sync with .bandit file
exclude: ^(test(s)?/|docs/) # keep in sync with .bandit file
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v1.5.1
hooks:
- id: mypy
exclude: ^tests/ # keep in sync with mypy.ini
exclude: ^(tests/|docs/) # keep in sync with mypy.ini
additional_dependencies: []
Loading

0 comments on commit be354f8

Please sign in to comment.