Skip to content

Commit c366489

Browse files
authored
Merge pull request #130 from Rohit-8541/align-enhance-github-actions
feat: align and enhance GitHub Actions workflows
2 parents 33b9788 + 9dae7bd commit c366489

File tree

8 files changed

+56
-113
lines changed

8 files changed

+56
-113
lines changed

.bumpversion.cfg

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

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
steps:
3737
- name: Checkout repository
3838
uses: actions/checkout@v6
39+
with:
40+
fetch-depth: 0
3941

4042
# Initializes the CodeQL tools for scanning.
4143
- name: Initialize CodeQL

.github/workflows/create-release.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ on:
55
push:
66
branches:
77
- main
8+
89
jobs:
910
release:
1011
runs-on: ubuntu-latest
11-
permissions:
12+
permissions:
1213
contents: write
1314
steps:
1415
- name: Checkout code
@@ -17,25 +18,26 @@ jobs:
1718
fetch-depth: 0
1819
token: ${{ secrets.ADMIN_TOKEN }}
1920

20-
- name: setup nodejs
21+
- name: Setup Node.js
2122
uses: actions/setup-node@v6
2223
with:
2324
node-version: '24'
2425

25-
- name: release using semantic-release
26+
- name: Setup Python
27+
uses: actions/setup-python@v6
28+
with:
29+
python-version: '3.9'
30+
31+
- name: Install dependencies
32+
run: |
33+
pip install --user bump-my-version
34+
npm install
35+
36+
- name: Release using semantic-release
2637
env:
2738
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
2839
GIT_AUTHOR_NAME: secrets.automation.dev
2940
GIT_AUTHOR_EMAIL: secrets.automation.dev@il.ibm.com
3041
GIT_COMMITTER_NAME: secrets.automation.dev
3142
GIT_COMMITTER_EMAIL: secrets.automation.dev@il.ibm.com
32-
run: |
33-
sudo apt-get update
34-
sudo apt-get install python3
35-
pip install --user bumpversion
36-
npm install @semantic-release/changelog
37-
npm install @semantic-release/exec
38-
npm install @semantic-release/git
39-
npm install @semantic-release/github
40-
npm install @semantic-release/release-notes-generator -D
41-
npx semantic-release
43+
run: npx semantic-release
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: publish artifact
1+
name: Publish artifact
2+
23
on:
34
workflow_dispatch:
45
release:
@@ -10,20 +11,26 @@ jobs:
1011
permissions:
1112
contents: read
1213
steps:
13-
- uses: actions/checkout@v6
14+
- name: Checkout code
15+
uses: actions/checkout@v6
1416
with:
17+
fetch-depth: 0
1518
token: ${{ secrets.ADMIN_TOKEN }}
16-
- name: Set up Python 3.9
19+
20+
- name: Set up Python
1721
uses: actions/setup-python@v6
1822
with:
19-
python-version: 3.14
23+
python-version: '3.9'
24+
2025
- name: Install build dependencies
2126
run: |
2227
python -m pip install --upgrade pip
2328
python -m pip install hatchling build --user
24-
- name: Build a binary wheel and a source tarball
29+
30+
- name: Build distribution
2531
run: |
2632
python -m build --sdist --wheel --outdir dist/ .
33+
2734
- name: Publish distribution to PyPI
2835
uses: pypa/gh-action-pypi-publish@release/v1
2936
with:

.releaserc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,27 @@
1111
{"type": "patch","release": "patch"}
1212
]}],
1313
"@semantic-release/release-notes-generator",
14-
"@semantic-release/changelog",
1514
[
1615
"@semantic-release/exec",
1716
{
18-
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
17+
"verifyReleaseCmd": "echo \"Verifying release ${nextRelease.version}\"",
18+
"prepareCmd": "bump-my-version bump ${nextRelease.type} --allow-dirty --new-version ${nextRelease.version}"
1919
}
2020
],
2121
[
2222
"@semantic-release/git",
2323
{
24-
"message": "chore(release): ${nextRelease.version} [skip ci] release notes\n\n${nextRelease.notes}"
24+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
25+
"assets": ["pyproject.toml", "ibm_secrets_manager_sdk/version.py"]
2526
}
2627
],
27-
"@semantic-release/github"
28+
[
29+
"@semantic-release/github",
30+
{
31+
"successComment": false,
32+
"failComment": false,
33+
"releasedLabels": false
34+
}
35+
]
2836
]
2937
}

CHANGELOG.md

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"devDependencies": {
3-
"@semantic-release/changelog": "^6.0.3",
43
"@semantic-release/exec": "^7.1.0",
54
"@semantic-release/git": "^10.0.1",
65
"@semantic-release/github": "^12.0.6",

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ dependencies = [
3434
Repository = "https://github.com/IBM/secrets-manager-python-sdk"
3535
Documentation = "https://cloud.ibm.com/apidocs/secrets-manager"
3636
Issues = "https://github.com/IBM/secrets-manager-python-sdk/issues"
37-
Changelog = "https://github.com/IBM/secrets-manager-python-sdk/blob/main/CHANGELOG.md"
3837

3938
[project.optional-dependencies]
4039
dev = [
@@ -57,3 +56,18 @@ packages = ["ibm_secrets_manager_sdk"]
5756
[tool.black]
5857
line-length = 120
5958
skip-string-normalization = true
59+
60+
[tool.bumpversion]
61+
current_version = "2.1.19"
62+
commit = true
63+
message = "Update version {current_version} -> {new_version}"
64+
65+
[[tool.bumpversion.files]]
66+
filename = "ibm_secrets_manager_sdk/version.py"
67+
search = "__version__ = '{current_version}'"
68+
replace = "__version__ = '{new_version}'"
69+
70+
[[tool.bumpversion.files]]
71+
filename = "pyproject.toml"
72+
search = "version = \"{current_version}\""
73+
replace = "version = \"{new_version}\""

0 commit comments

Comments
 (0)