Skip to content

Commit a217919

Browse files
committed
Added automated publishing
1 parent 2739e1e commit a217919

4 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .github/workflows/ci-cd.yml
2+
name: PyPI Publish
3+
on: push
4+
jobs:
5+
pypi-publish:
6+
name: Upload release to PyPI
7+
if: github.ref == 'refs/heads/master' # On main only
8+
runs-on: ubuntu-latest
9+
environment:
10+
name: pypi
11+
url: https://pypi.org/p/openpaygo
12+
permissions:
13+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
14+
steps:
15+
# retrieve your distributions here
16+
- name: Publish package distributions to PyPI
17+
uses: pypa/gh-action-pypi-publish@release/v1

openpaygo/decode_token.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class OpenPAYGOTokenDecoder(object):
88
MAX_UNUSED_OLDER_TOKENS = 8*2
99

1010
@classmethod
11-
def decode_token(cls, token, secret_key, last_count, used_counts=None, starting_code=None, value_divider=1, restricted_digit_set=False):
11+
def decode_token(cls, token, secret_key, count, used_counts=None, starting_code=None, value_divider=1, restricted_digit_set=False):
1212
secret_key = OpenPAYGOTokenShared.load_secret_key_from_hex(secret_key)
1313
if not starting_code:
1414
# We generate the starting code from the key if not provided
@@ -28,9 +28,9 @@ def decode_token(cls, token, secret_key, last_count, used_counts=None, starting_
2828
else:
2929
raise ValueError("Token is too long")
3030
if not extended_token:
31-
value, token_type, count, updated_counts = cls.get_activation_value_count_and_type_from_token(token, starting_code, secret_key, last_count, restricted_digit_set, used_counts)
31+
value, token_type, count, updated_counts = cls.get_activation_value_count_and_type_from_token(token, starting_code, secret_key, count, restricted_digit_set, used_counts)
3232
else:
33-
value, token_type, count, updated_counts = cls.get_activation_value_count_from_extended_token(token, starting_code, secret_key, last_count, restricted_digit_set, used_counts)
33+
value, token_type, count, updated_counts = cls.get_activation_value_count_from_extended_token(token, starting_code, secret_key, count, restricted_digit_set, used_counts)
3434
if value and value_divider:
3535
value = value / value_divider
3636
return value, token_type, count, updated_counts

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = openpaygo
3-
version = 0.1.2
3+
version = 0.1.3
44
url = https://github.com/openpaygo/openpaygo-python
55
description-file=README.md
66
license_files=LICENSE

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
setup(
55
name="openpaygo",
66
packages=find_packages(),
7-
version='0.1.2',
7+
version='0.1.3',
88
license='MIT',
99
author="Solaris Offgrid",
1010
url='https://github.com/openpaygo/openpaygo-python',

0 commit comments

Comments
 (0)