Skip to content

Commit ded8b3f

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

21 files changed

Lines changed: 251 additions & 218 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,71 @@
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
15-
15+
permissions:
16+
contents: read
17+
1618
steps:
1719
- name: Checkout source code
1820
uses: actions/checkout@v2
1921

20-
- name: Set up Python 3.10
22+
- name: Set up Python 3.11
2123
uses: actions/setup-python@v4
2224
with:
23-
python-version: '3.10'
25+
python-version: '3.11'
2426
architecture: 'x64'
2527

2628
- name: Build the package
2729
run: |
2830
python -m pip install -U setuptools pip build wheel twine
29-
python -m build --wheel
31+
python -m build --wheel keepercli-package
3032
3133
- name: Archive the package
3234
uses: actions/upload-artifact@v3
3335
with:
34-
name: KeeperSdkWheel
36+
name: KeeperCLIWheel
3537
retention-days: 1
36-
path: dist/*
38+
path: keepercli-package/dist/*
3739
if-no-files-found: error
3840

39-
- name: Publish Commander to test PyPi
41+
- name: Publish keepercli to test PyPi
4042
env:
4143
TWINE_USERNAME: __token__
4244
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
4345
run: |
44-
twine upload -r testpypi dist/*
45-
46+
twine upload -r testpypi keepercli-package/dist/*
4647
4748
publish-pypi:
48-
name: Publish Keeper SDK to PyPi
49+
name: Publish Keeper CLI to PyPi
4950
runs-on: ubuntu-latest
5051
needs: [build-n-publish]
5152
environment: prod
5253

5354
steps:
5455
- uses: actions/download-artifact@v3
5556
with:
56-
name: CommanderWheel
57-
path: dist
57+
name: KeeperCLIWheel
58+
path: keepercli-package/dist
5859

59-
- name: Set up Python 3.10
60+
- name: Set up Python 3.11
6061
uses: actions/setup-python@v4
6162
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
63+
python-version: '3.11'
7264

73-
- name: Publish to PyPi
65+
- name: Publish keepercli to PyPi
7466
env:
7567
TWINE_USERNAME: __token__
76-
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
68+
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
7769
run: |
7870
python -m pip install -U setuptools pip wheel twine
79-
twine upload dist/*
71+
twine upload -r pypi keepercli-package/dist/*

.github/workflows/publish-sdk.yml

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,96 @@
1-
name: Publish Keeper SDK to PyPi
2-
3-
on: [workflow_dispatch]
1+
name: Publish Keeper SDK to PyPI
42

3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version to release (tag or branch)
8+
required: true
59
jobs:
6-
build-wheel:
7-
name: Build and publish Keeper SDK for Python 📦 to PyPI
10+
build-and-test:
11+
name: Build and test Keeper SDK package
812
runs-on: ubuntu-latest
9-
timeout-minutes: 25 # To keep builds from running too long
13+
timeout-minutes: 25
14+
permissions:
15+
contents: read
1016

1117
steps:
1218
- name: Checkout source code
13-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.event.inputs.version }}
1422

15-
- name: Set up Python 3.11
16-
uses: actions/setup-python@v4
23+
- name: Set up Python 3.13
24+
uses: actions/setup-python@v5
1725
with:
18-
python-version: '3.11'
26+
python-version: '3.13'
27+
28+
- name: Install dependencies
29+
run: |
30+
pip install keepersdk-package/
31+
32+
- name: Run unit tests
33+
run: python -m unittest discover -s keepersdk-package/unit_tests/
1934

2035
- name: Build the package
2136
run: |
22-
python3 -m pip install -U setuptools build wheel twine
37+
python3 -m pip install -U build wheel twine
2338
python3 -m build --wheel keepersdk-package
2439
2540
- name: Archive the package
26-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
2742
with:
2843
name: KeeperSdkWheel
2944
retention-days: 1
3045
path: keepersdk-package/dist/*
3146
if-no-files-found: error
3247

33-
- name: Publish Commander to test PyPi
48+
publish-test-pypi:
49+
name: Publish to Test PyPI
50+
runs-on: ubuntu-latest
51+
needs: [build-and-test]
52+
environment: test
53+
54+
steps:
55+
- uses: actions/download-artifact@v4
56+
with:
57+
name: KeeperSdkWheel
58+
path: keepersdk-package/dist
59+
60+
- name: Set up Python 3.13
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: '3.13'
64+
65+
- name: Publish to Test PyPI
3466
env:
3567
TWINE_USERNAME: __token__
3668
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
3769
run: |
38-
twine upload -r testpypi dist/*
39-
70+
python -m pip install -U twine
71+
twine upload --repository testpypi keepersdk-package/dist/*
4072
4173
publish-pypi:
42-
name: Publish Keeper SDK to PyPi
74+
name: Publish to Production PyPI
4375
runs-on: ubuntu-latest
44-
needs: [build-wheel]
76+
needs: [publish-test-pypi]
4577
environment: prod
4678

4779
steps:
48-
- uses: actions/download-artifact@v3
49-
with:
50-
name: CommanderWheel
51-
path: dist
52-
53-
- name: Set up Python 3.10
54-
uses: actions/setup-python@v4
80+
- uses: actions/download-artifact@v4
5581
with:
56-
python-version: '3.11'
82+
name: KeeperSdkWheel
83+
path: keepersdk-package/dist
5784

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

66-
- name: Publish to PyPi
90+
- name: Publish to PyPI
6791
env:
6892
TWINE_USERNAME: __token__
69-
TWINE_PASSWORD: ${{ steps.ksecrets.outputs.PYPI_PASSWORD }}
93+
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
7094
run: |
71-
python -m pip install -U setuptools pip wheel twine
72-
twine upload dist/*
95+
python -m pip install -U twine
96+
twine upload keepersdk-package/dist/*
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
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']
1717

1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
1921

2022
steps:
2123
- name: Checkout branch
2224
uses: actions/checkout@v4
2325

2426
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
2628
with:
2729
python-version: ${{ matrix.python-version }}
2830

29-
- name: Install package with test dependencies
31+
- name: Install package
3032
run: |
31-
cd keepersdk-package
32-
pip install .[test]
33+
pip install -e keepersdk-package/
3334
3435
- name: Run unit tests
35-
run: pytest keepersdk-package/unit_tests/
36+
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)