Skip to content

Commit 75d8a02

Browse files
Merge pull request #242 from Adyen/automation/release
Release v9.0.0
2 parents a526986 + 739facb commit 75d8a02

32 files changed

+520
-124
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"Breaking change":
2+
- '**'
3+
- '.*'
4+
- '.*/**'

.github/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
changelog:
2+
exclude:
3+
authors:
4+
- renovate[bot]
5+
- dependabot[bot]
6+
categories:
7+
- title: Breaking Changes 🛠
8+
labels:
9+
- Breaking change
10+
- title: New Features 💎
11+
labels:
12+
- Feature
13+
- title: Fixes ⛑️
14+
labels:
15+
- Fix
16+
- title: Other Changes 🖇️
17+
labels:
18+
- "*"

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/gh-release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Github Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
gh_release:
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Get the release script
16+
run: |
17+
wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Run tests"
2+
on:
3+
pull_request:
4+
branches:
5+
- automation/services
6+
7+
8+
jobs:
9+
tests:
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
runs-on: ubuntu-20.04
14+
# strategy:
15+
# matrix:
16+
# python-version: [ '3.6','3.7', '3.8' ]
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install tox
27+
sudo apt-get update
28+
sudo apt install libcurl4-openssl-dev
29+
- name: Test with tox
30+
run: tox
31+
32+
- name: Add label if tests fail
33+
uses: actions/labeler@v4
34+
if: ${{ failure() }}

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release request
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
release:
11+
permissions:
12+
contents: write
13+
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+

.github/workflows/services.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Python Library Services Generation
2+
3+
on: [ workflow_dispatch ]
4+
5+
jobs:
6+
generate:
7+
runs-on: ubuntu-latest
8+
name: Generate Services
9+
steps:
10+
- uses: actions/checkout@v3
11+
- run: make all
12+
- name: Set PR variables
13+
id: vars
14+
run: |
15+
echo ::set-output name=pr_title::"Update services"
16+
echo ::set-output name=pr_body::"OpenAPI spec or templates produced new services on $(date +%d-%m-%Y) \
17+
by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))."
18+
- name: Create Pull Request
19+
uses: peter-evans/create-pull-request@v5
20+
with:
21+
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
22+
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
23+
author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
24+
base: develop
25+
branch: automation/services
26+
title: ${{ steps.vars.outputs.pr_title }}
27+
body: ${{ steps.vars.outputs.pr_body }}
28+
add-paths: Adyen/services

Adyen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
AdyenDataProtectionApi,
2727
AdyenTransfersApi,
2828
AdyenStoredValueApi,
29-
AdyenBalancePlatformApi
29+
AdyenBalancePlatformApi,
3030
)
3131

3232
from .httpclient import HTTPClient

Adyen/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AdyenClient(object):
5050
APPLICATION_VERSION_HEADER_NAME = 'adyen-library-version'
5151
"""A requesting client that interacts with Adyen. This class holds the
5252
adyen logic of Adyen HTTP API communication. This is the object that can
53-
maintain its own username, password, merchant_account, hmac and skin_code.
53+
maintain its own username, password and hmac.
5454
When these values aren't within this object, the root adyen module
5555
variables will be used.
5656
@@ -95,7 +95,7 @@ def __init__(
9595
api_data_protection_version=None,
9696
api_transfers_version=None,
9797
api_stored_value_version=None,
98-
api_balance_platform_version=None
98+
api_balance_platform_version=None,
9999
):
100100
self.username = username
101101
self.password = password
@@ -212,8 +212,8 @@ def _determine_base_url_and_version(self, platform, service):
212212
'transfers': {
213213
'version': self.api_transfers_version,
214214
'base_url': {
215-
'live': settings.BASE_TRANSFERS_URL.format(platform),
216-
'test': settings.BASE_TRANSFERS_URL.format(platform)
215+
'live': settings.BASE_BTL_URL.format(platform),
216+
'test': settings.BASE_BTL_URL.format(platform)
217217
}
218218
},
219219
'storedValue': {
@@ -222,7 +222,7 @@ def _determine_base_url_and_version(self, platform, service):
222222
'live': settings.BASE_STORED_VALUE_URL.format(platform),
223223
'test': settings.BASE_STORED_VALUE_URL.format(platform)
224224
}
225-
}
225+
},
226226
}
227227

228228
version = versions_and_urls[service]['version']
@@ -360,7 +360,7 @@ def call_adyen_api(
360360
idempotency_key=None,
361361
**kwargs
362362
):
363-
"""This will call the adyen api. username, password, merchant_account,
363+
"""This will call the adyen api. username, password,
364364
and platform are pulled from root module level and or self object.
365365
AdyenResult will be returned on 200 response. Otherwise, an exception
366366
is raised.

Adyen/services/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .base import AdyenBase
2-
from .binLookup import AdyenBinlookupApi
2+
from .binlookup import AdyenBinlookupApi
33
from .checkout import AdyenCheckoutApi
44
from .payments import AdyenPaymentsApi
55
from .payouts import AdyenPayoutsApi

0 commit comments

Comments
 (0)