Skip to content

Commit 8abab0d

Browse files
committed
ci: update release-please for release automation
- Added bot for creating Release PR - Updated version information in __version__.py file - Added pypi publish steps in the actions
1 parent 158a690 commit 8abab0d

File tree

5 files changed

+47
-8
lines changed

5 files changed

+47
-8
lines changed

.github/workflows/release-please.yml

+31-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,40 @@ on:
44
- main
55
workflow_dispatch:
66

7+
permissions:
8+
id-token: write # for PYPI release
9+
710
name: release-please
811

912
jobs:
1013
release-please:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- name: Release
14-
uses: google-github-actions/release-please-action@v4
15-
with:
16-
token: ${{ secrets.CI_RELEASE_PLEASE_TOKEN }}
17-
release-type: simple
16+
- name: Release
17+
id: release
18+
uses: google-github-actions/release-please-action@v4
19+
with:
20+
token: ${{ secrets.BOT_TOKEN }}
21+
22+
- uses: actions/checkout@v3
23+
if: ${{ steps.release.outputs.release_created }}
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
if: ${{ steps.release.outputs.release_created }}
28+
with:
29+
python-version: '3.x'
30+
31+
- name: Install dependencies
32+
if: ${{ steps.release.outputs.release_created }}
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install build
36+
37+
- name: Build package
38+
if: ${{ steps.release.outputs.release_created }}
39+
run: python -m build
40+
41+
- name: Publish package
42+
if: ${{ steps.release.outputs.release_created }}
43+
uses: pypa/[email protected]

.release-please-manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

release-please-config.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"extra-files": [
6+
"src/commitlint/__version__.py"
7+
]
8+
}
9+
},
10+
"pull-request-header": "Release PR",
11+
"pull-request-title-pattern": "chore: release v${version}",
12+
"release-type": "simple"
13+
}

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ keywords =
1919
classifiers =
2020
Programming Language :: Python :: 3 :: Only
2121
Programming Language :: Python :: 3.8
22-
License :: OSI Approved :: GNU General Public License v3 (GPL-3.0)
2322

2423
url = https://github.com/opensource-nepal/commitlint
2524
project_urls =

src/commitlint/__version__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
This module contains the version information of the current commitlint.
3-
TODO: automatically bump version through CI.
3+
NOTE: The version is auto-updated by release-please action.
44
"""
55

6-
__version__ = "0.2.1"
6+
__version__ = "0.2.1" # x-release-please-version

0 commit comments

Comments
 (0)