Skip to content

Commit f14f2e0

Browse files
committed
Github publish workflow
1 parent 41cdce1 commit f14f2e0

File tree

22 files changed

+299
-211
lines changed

22 files changed

+299
-211
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '32 11 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'python' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
33+
# Learn more:
34+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v2
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v1
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
49+
50+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51+
# If this step fails, then you should remove it and run the build manually (see below)
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
# ℹ️ Command-line programs to run using the OS shell.
56+
# 📚 https://git.io/JvXDl
57+
58+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
59+
# and modify them (or add more) to build your code if your project
60+
# uses a compiled language
61+
62+
#- run: |
63+
# make bootstrap
64+
# make release
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v1
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,69 @@
1-
name: Publish Commander to PyPi
1+
name: Publish CLI to PyPi
22

33
on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: Version to release (Tag from Keeper-Security/keeper-sdk-pyton)
7+
description: Version to release (Tag from Keeper-Security/keeper-sdk-python)
88
required: true
99

1010
jobs:
1111
build-n-publish:
12-
name: Build and publish Keeper SDK for Python 📦 to PyPI
12+
name: Build and publish Keeper CLI for Python to TestPyPI
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 25 # To keep builds from running too long
1515

1616
steps:
1717
- name: Checkout source code
1818
uses: actions/checkout@v2
1919

20-
- name: Set up Python 3.10
20+
- name: Set up Python 3.11
2121
uses: actions/setup-python@v4
2222
with:
23-
python-version: '3.10'
23+
python-version: '3.11'
2424
architecture: 'x64'
2525

2626
- name: Build the package
2727
run: |
2828
python -m pip install -U setuptools pip build wheel twine
29-
python -m build --wheel
29+
python -m build --wheel keepercli-package
3030
3131
- name: Archive the package
3232
uses: actions/upload-artifact@v3
3333
with:
34-
name: KeeperSdkWheel
34+
name: KeeperCLIWheel
3535
retention-days: 1
36-
path: dist/*
36+
path: keepercli-package/dist/*
3737
if-no-files-found: error
3838

39-
- name: Publish Commander to test PyPi
39+
- name: Publish keepercli to test PyPi
4040
env:
4141
TWINE_USERNAME: __token__
4242
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
4343
run: |
44-
twine upload -r testpypi dist/*
45-
44+
twine upload -r testpypi keepercli-package/dist/*
4645
4746
publish-pypi:
48-
name: Publish Keeper SDK to PyPi
47+
name: Publish Keeper CLI to PyPi
4948
runs-on: ubuntu-latest
5049
needs: [build-n-publish]
5150
environment: prod
5251

5352
steps:
5453
- uses: actions/download-artifact@v3
5554
with:
56-
name: CommanderWheel
57-
path: dist
55+
name: KeeperCLIWheel
56+
path: keepercli-package/dist
5857

59-
- name: Set up Python 3.10
58+
- name: Set up Python 3.11
6059
uses: actions/setup-python@v4
6160
with:
62-
python-version: '3.10'
63-
architecture: 'x64'
64-
65-
- name: Retrieve secrets from Keeper
66-
id: ksecrets
67-
uses: Keeper-Security/ksm-action@master
68-
with:
69-
keeper-secret-config: ${{ secrets.KSM_COMMANDER_SECRET_CONFIG }}
70-
secrets: |
71-
gD5LOOhI5QbnSFk8mIg3gg/field/password > PYPI_PASSWORD
61+
python-version: '3.11'
7262

73-
- name: Publish to PyPi
63+
- name: Publish keepercli to PyPi
7464
env:
7565
TWINE_USERNAME: __token__
76-
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
66+
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
7767
run: |
7868
python -m pip install -U setuptools pip wheel twine
79-
twine upload dist/*
69+
twine upload -r pypi keepercli-package/dist/*

.github/workflows/publish-sdk.yml

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,88 @@
1-
name: Publish Keeper SDK to PyPi
1+
name: Publish Keeper SDK to PyPI
22

33
on: [workflow_dispatch]
44

55
jobs:
6-
build-wheel:
7-
name: Build and publish Keeper SDK for Python 📦 to PyPI
6+
build-and-test:
7+
name: Build and test Keeper SDK package
88
runs-on: ubuntu-latest
9-
timeout-minutes: 25 # To keep builds from running too long
9+
timeout-minutes: 25
1010

1111
steps:
1212
- name: Checkout source code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414

15-
- name: Set up Python 3.11
16-
uses: actions/setup-python@v4
15+
- name: Set up Python 3.13
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.11'
18+
python-version: '3.13'
19+
20+
- name: Install dependencies
21+
run: |
22+
pip install keepersdk-package/
23+
24+
- name: Run unit tests
25+
run: python -m unittest discover -s keepersdk-package/unit_tests/
1926

2027
- name: Build the package
2128
run: |
22-
python3 -m pip install -U setuptools build wheel twine
29+
python3 -m pip install -U build wheel twine
2330
python3 -m build --wheel keepersdk-package
2431
2532
- name: Archive the package
26-
uses: actions/upload-artifact@v3
33+
uses: actions/upload-artifact@v4
2734
with:
2835
name: KeeperSdkWheel
2936
retention-days: 1
3037
path: keepersdk-package/dist/*
3138
if-no-files-found: error
3239

33-
- name: Publish Commander to test PyPi
40+
publish-test-pypi:
41+
name: Publish to Test PyPI
42+
runs-on: ubuntu-latest
43+
needs: [build-and-test]
44+
environment: test
45+
46+
steps:
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: KeeperSdkWheel
50+
path: keepersdk-package/dist
51+
52+
- name: Set up Python 3.13
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.13'
56+
57+
- name: Publish to Test PyPI
3458
env:
3559
TWINE_USERNAME: __token__
3660
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
3761
run: |
38-
twine upload -r testpypi dist/*
39-
62+
python -m pip install -U twine
63+
twine upload --repository testpypi keepersdk-package/dist/*
4064
4165
publish-pypi:
42-
name: Publish Keeper SDK to PyPi
66+
name: Publish to Production PyPI
4367
runs-on: ubuntu-latest
44-
needs: [build-wheel]
68+
needs: [publish-test-pypi]
4569
environment: prod
4670

4771
steps:
48-
- uses: actions/download-artifact@v3
72+
- uses: actions/download-artifact@v4
4973
with:
50-
name: CommanderWheel
51-
path: dist
52-
53-
- name: Set up Python 3.10
54-
uses: actions/setup-python@v4
55-
with:
56-
python-version: '3.11'
74+
name: KeeperSdkWheel
75+
path: keepersdk-package/dist
5776

58-
- name: Retrieve secrets from Keeper
59-
id: ksecrets
60-
uses: Keeper-Security/ksm-action@master
77+
- name: Set up Python 3.13
78+
uses: actions/setup-python@v5
6179
with:
62-
keeper-secret-config: ${{ secrets.KSM_COMMANDER_SECRET_CONFIG }}
63-
secrets: |
64-
gD5LOOhI5QbnSFk8mIg3gg/field/password > PYPI_PASSWORD
80+
python-version: '3.13'
6581

66-
- name: Publish to PyPi
82+
- name: Publish to PyPI
6783
env:
6884
TWINE_USERNAME: __token__
69-
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
85+
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
7086
run: |
71-
python -m pip install -U setuptools pip wheel twine
72-
twine upload dist/*
87+
python -m pip install -U twine
88+
twine upload keepersdk-package/dist/*
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Test with pytest
1+
name: Test with unittest
22

33
on:
44
pull_request:
55
branches:
6-
- masterlet'
6+
- master
77
workflow_dispatch:
88

99
env:
1010
PYTHONUNBUFFERED: 1
1111

1212
jobs:
13-
test-with-pytest:
13+
test-with-unittest:
1414
strategy:
1515
matrix:
1616
python-version: ['3.8', '3.14']
@@ -22,14 +22,13 @@ jobs:
2222
uses: actions/checkout@v4
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828

29-
- name: Install package with test dependencies
29+
- name: Install package
3030
run: |
31-
cd keepersdk-package
32-
pip install .[test]
31+
pip install -e keepersdk-package/
3332
3433
- name: Run unit tests
35-
run: pytest keepersdk-package/unit_tests/
34+
run: python -m unittest discover -s keepersdk-package/unit_tests/

keepercli-package/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ cbor2; sys_platform == "darwin" and python_version>='3.10'
88
pyobjc-framework-LocalAuthentication; sys_platform == "darwin" and python_version>='3.10'
99
winrt-runtime; sys_platform == "win32"
1010
winrt-Windows.Foundation; sys_platform == "win32"
11-
winrt-Windows.Security.Credentials.UI; sys_platform == "win32"
11+
winrt-Windows.Security.Credentials.UI; sys_platform == "win32"

keepercli-package/src/keepercli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# Contact: commander@keepersecurity.com
1010
#
1111

12-
__version__ = '17.0.0'
12+
__version__ = '1.0.0-beta01'
1313

keepersdk-package/mypy.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
[mypy]
22
warn_no_return = False
33
files = src/
4-
python_version = 3.8
4+
python_version = 3.9
55

66
[mypy-keepersdk.proto.*]
77
ignore_errors = True
8+
9+
[mypy-fido2.*]
10+
follow_imports = skip
11+
ignore_errors = True
12+
13+
[mypy-keepersdk.authentication.yubikey]
14+
ignore_errors = True

keepersdk-package/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
attrs>=23.1.0
2-
certifi
3-
requests>=2.31.0
4-
cryptography>=41.0.7
2+
requests>=2.32.2
3+
cryptography>=45.0.1
54
protobuf>=5.28.3
6-
websockets>=12.0
5+
websockets>=13.1
76
fido2>=2.0.0; python_version>='3.10'

keepersdk-package/setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ package_dir =
2626
include_package_data = True
2727
install_requires =
2828
attrs>=23.1.0
29-
requests>=2.31.0
30-
cryptography>=40.0.0
31-
protobuf>=4.25.0
32-
websockets>=12.0
29+
requests>=2.32.2
30+
cryptography>=45.0.1
31+
protobuf>=5.28.3
32+
websockets>=13.1
3333
fido2>=2.0.0; python_version>='3.10'
3434

3535

keepersdk-package/src/keepersdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
#
1111
from . import background
1212

13-
__version__ = '0.9.10'
13+
__version__ = '0.9.11'
1414

1515
background.init()

0 commit comments

Comments
 (0)