Skip to content

Commit d81177b

Browse files
authored
Merge pull request #256 from Adyen/automation/release
Release v9.0.2
2 parents 1c26611 + 5220b41 commit d81177b

File tree

10 files changed

+34
-96
lines changed

10 files changed

+34
-96
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @Adyen/api-libraries-reviewers @rikterbeek @acampos1916 @candemiralp
1+
* @Adyen/integration-tools-testing

.github/workflows/gh-release.yml

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,16 @@
11
name: Github Release
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
88

99
jobs:
1010
gh_release:
1111
permissions:
1212
contents: write
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v3
16-
with:
17-
fetch-depth: 0
18-
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
19-
- name: Get the release script
20-
run: |
21-
wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts
22-
- name: Grab version
23-
uses: actions/github-script@v6
24-
id: release
25-
with:
26-
script: |
27-
const release = require('./.github/scripts/release.js')
28-
core.setOutput('version', release.setupPythonVersion())
29-
- name: Create new release
30-
env:
31-
GH_TOKEN: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
32-
run: |
33-
gh release create v${{steps.release.outputs.version}} \
34-
--title 'Adyen Python API Library v${{steps.release.outputs.version}}' \
35-
--generate-notes --target main
36-
- name: Delete the release script
37-
run: |
38-
rm -f ./.github/scripts/release.js
39-
- name: Update develop branch
40-
run: |
41-
git checkout develop
42-
git merge main
43-
git push origin develop
13+
uses: Adyen/adyen-node-api-library/.github/workflows/lib-gh-release.yml@develop
14+
with:
15+
project-name: Python
16+
secrets: inherit

.github/workflows/release.yml

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,15 @@
11
name: Release request
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- develop
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
88

99
jobs:
1010
release:
1111
permissions:
1212
contents: write
1313
pull-requests: write
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
ref: main
19-
- name: Reset promotion branch
20-
run: |
21-
git fetch origin develop:develop
22-
git reset --hard develop
23-
- name: Get the release script
24-
run: |
25-
wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts
26-
- name: Prepare release request
27-
uses: actions/github-script@v6
28-
id: release
29-
with:
30-
script: |
31-
const release = require('./.github/scripts/release.js')
32-
const options = { github, context, core, getCurrentVersion: release.setupPythonVersion };
33-
await release.bump(options);
34-
- name: Bump version
35-
uses: actions/github-script@v6
36-
with:
37-
script: |
38-
const release = require('./.github/scripts/release.js')
39-
await release.updatePythonVersion("${{steps.release.outputs.nextVersion}}");
40-
- name: Delete the release script
41-
run: |
42-
rm -f ./.github/scripts/release.js
43-
- name: Create Pull Request
44-
id: cpr
45-
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5.0.1
46-
with:
47-
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
48-
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
49-
author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
50-
branch: automation/release
51-
title: Release v${{steps.release.outputs.nextVersion}}
52-
body: |
53-
Merged pull requests to be released:
54-
${{steps.release.outputs.changelog}}
55-
commit-message: "chore(release): bump to ${{steps.release.outputs.nextVersion}}"
56-
delete-branch: true
57-
- name: Enable Pull Request Automerge
58-
if: steps.cpr.outputs.pull-request-operation == 'created'
59-
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
60-
with:
61-
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
62-
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
63-
merge-method: merge
64-
14+
uses: Adyen/adyen-node-api-library/.github/workflows/lib-release.yml@develop
15+
secrets: inherit

Adyen/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
API_LEGAL_ENTITY_MANAGEMENT_VERSION = "v3"
2727
API_STORED_VALUE_VERSION = "v46"
2828
LIB_NAME = "adyen-python-api-library"
29-
LIB_VERSION = "9.0.1"
29+
LIB_VERSION = "9.0.2"

Adyen/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def generate_notification_sig(dict_object, hmac_key):
3737
def is_valid_hmac_notification(dict_object, hmac_key):
3838
dict_object = dict_object.copy()
3939

40+
if 'notificationItems' in dict_object:
41+
dict_object = dict_object['notificationItems'][0]['NotificationRequestItem']
42+
4043
if 'additionalData' in dict_object:
4144
if dict_object['additionalData']['hmacSignature'] == "":
4245
raise ValueError("Must Provide hmacSignature in additionalData")

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,14 @@ generateCheckoutTest: build/spec $(openapi-generator-jar)
8888
--skip-validate-spec
8989
cp $(output)/api/api-test.py test/methodNamesTests/checkoutTest.py
9090
rm -rf build
91+
92+
## Releases
93+
94+
version:
95+
grep version= setup.py | tr -d \', | awk -F '=' '{ printf "currentVersion=%s\n", $$2 }' >> "$$GITHUB_OUTPUT"
96+
97+
bump:
98+
perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' setup.py Adyen/settings.py
99+
100+
101+
.PHONY: $(services) version bump

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Adyen APIs Library for Python
44

5-
[![version](https://img.shields.io/pypi/v/Adyen.svg)](https://docs.adyen.com/development-resources/libraries)
5+
[![version](https://img.shields.io/pypi/v/Adyen.svg)](https://pypi.org/project/Adyen/)
66

77
This is the officially supported Python library for using Adyen's APIs.
88

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[bdist_wheel]
22

33
[metadata]
4-
description-file = README.md
4+
description_file = README.md
55

66
[egg_info]
77
tag_build =

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name='Adyen',
55
packages=find_packages(include="Adyen*"),
6-
version='9.0.1',
6+
version='9.0.2',
77
maintainer='Adyen',
88
maintainer_email='[email protected]',
99
description='Adyen Python Api',

test/UtilTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_notification_request_item_hmac(self):
4949
{'hmacSignature': hmac_calculation_str})
5050
self.assertTrue(hmac_validate)
5151

52-
def test_notifications_with_slashes(self):
52+
def test_webhooks_with_slashes(self):
5353
hmac_key = "74F490DD33F7327BAECC88B2947C011FC02D014A473AAA33A8EC93E4DC069174"
5454
with open('test/mocks/util/backslash_notification.json') as file:
5555
backslash_notification = load(file)

0 commit comments

Comments
 (0)