Skip to content

Commit 0168b9a

Browse files
authored
Merge pull request #33 from IBM/bumpversion
Add semantic-release workflow
2 parents d74b9e6 + 4f49593 commit 0168b9a

File tree

5 files changed

+94
-49
lines changed

5 files changed

+94
-49
lines changed

.bumpversion.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 1.0.22
3+
commit = True
4+
message = Update version {current_version} -> {new_version}
5+
6+
[bumpversion:file:ibm_secrets_manager_sdk/version.py]
7+
search = __version__ = '{current_version}'
8+
replace = __version__ = '{new_version}'
9+
10+
[bumpversion:file:setup.py]
11+
search = __version__ = '{current_version}'
12+
replace = __version__ = '{new_version}'

.github/workflows/create-release-and-publish.yml

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,59 @@ name: Publish a new release
55

66
on:
77
push:
8-
branches:
8+
branches:
99
- main
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
18-
- name: Changelog
19-
uses: scottbrenner/generate-changelog-action@master
20-
- name: Create Release
21-
id: create_release
22-
uses: actions/create-release@latest
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
25-
with:
26-
tag_name: v1.0.${{ github.run_number }}
27-
release_name: Release v1.0.${{ github.run_number }}
28-
body: |
29-
${{ steps.Changelog.outputs.changelog }}
30-
draft: false
31-
prerelease: false
32-
- uses: actions/checkout@v2
33-
- name: Set up Python 3.9
34-
uses: actions/setup-python@v2
35-
with:
36-
python-version: 3.9
37-
- name: Install pypa/build
38-
run: >-
39-
python -m
40-
pip install
41-
build
42-
--user
43-
- name: Build a binary wheel and a source tarball
44-
run: >-
45-
python -m
46-
build
47-
--sdist
48-
--wheel
49-
--outdir dist/
50-
.
51-
- name: Publish distribution to PyPI
52-
uses: pypa/gh-action-pypi-publish@master
53-
with:
54-
password: ${{ secrets.PYPI_API_TOKEN }}
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: setup nodejs
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '16'
23+
24+
- name: release using semantic-release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
GIT_AUTHOR_NAME: secrets.automation.dev
28+
GIT_AUTHOR_EMAIL: [email protected]
29+
GIT_COMMITTER_NAME: secrets.automation.dev
30+
GIT_COMMITTER_EMAIL: [email protected]
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install python
34+
pip install --user bumpversion
35+
npm install @semantic-release/changelog
36+
npm install @semantic-release/exec
37+
npm install @semantic-release/git
38+
npm install @semantic-release/github
39+
npx semantic-release
40+
41+
- uses: actions/checkout@v2
42+
- name: Set up Python 3.9
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: 3.9
46+
- name: Install pypa/build
47+
run: >-
48+
python -m
49+
pip install
50+
build
51+
--user
52+
- name: Build a binary wheel and a source tarball
53+
run: >-
54+
python -m
55+
build
56+
--sdist
57+
--wheel
58+
--outdir dist/
59+
.
60+
- name: Publish distribution to PyPI
61+
uses: pypa/gh-action-pypi-publish@master
62+
with:
63+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ jobs:
1111
build:
1212

1313
runs-on: ubuntu-latest
14-
14+
strategy:
15+
matrix:
16+
python-version: [ 3.9 ]
1517
steps:
1618
- uses: actions/checkout@v2
17-
- name: Set up Python 3.7
19+
- name: Set up Python ${{ matrix.python-version }}
1820
uses: actions/setup-python@v2
1921
with:
20-
python-version: 3.7
22+
python-version: ${{ matrix.python-version }}
2123
- name: Install dependencies
2224
run: |
2325
python -m pip install --upgrade pip
@@ -34,4 +36,4 @@ jobs:
3436
SERVICE_URL: https://9476d663-dc80-4132-aff6-4585ebbdfb2d.us-south.secrets-manager.appdomain.cloud
3537
DNS_CONFIG_CRN: "crn:v1:staging:public:internet-svcs-ci:global:a/791f5fb10986423e97aa8512f18b7e65:dc08a28a-9181-45db-bf0d-a8733a5796b6::"
3638
CA_CONFIG_PRIVATE_KEY: ${{ secrets.CA_CONFIG_PRIVATE_KEY }}
37-
DNS_CONFIG_API_KEY: ${{ secrets.DNS_CONFIG_API_KEY }}
39+
DNS_CONFIG_API_KEY: ${{ secrets.DNS_CONFIG_API_KEY }}

.releaserc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"debug": true,
3+
"branches": [ "main" ],
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
"@semantic-release/changelog",
8+
[
9+
"@semantic-release/exec",
10+
{
11+
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
12+
}
13+
],
14+
[
15+
"@semantic-release/git",
16+
{
17+
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ the [IBM Cloud® Secrets Manager APIs](https://cloud.ibm.com/apidocs/secrets-man
2323
The IBM Cloud Secrets Manager Python SDK allows developers to programmatically interact with the following IBM Cloud
2424
services:
2525

26-
Service name | Imported class name
27-
--- | ---
28-
[Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | SecretsManagerV1
26+
| Service name | Imported class name |
27+
|------------------------------------------------------------------|----------------------|
28+
| [Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | SecretsManagerV1 |
2929

3030
## Prerequisites
3131

0 commit comments

Comments
 (0)