Skip to content

Commit 2645013

Browse files
authored
Fix release process (#545)
almost same as line/line-bot-sdk-nodejs#561
1 parent 02348a7 commit 2645013

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.github/workflows/auto-testing.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
python generate-code.py
3434
- name: Update version in linebot/__about__.py
3535
run: |
36-
sed -i 's/__version__ = "__LINE_BOT_SDK_PYTHON_VERSION__"/__version__ = "12.34.5"/g' linebot/__about__.py
36+
VERSION="12.3.0"
37+
VERSION=${VERSION#v}
38+
sed -i "s/__version__ = '__LINE_BOT_SDK_PYTHON_VERSION__'/__version__ = '$VERSION'/g" linebot/__about__.py
3739
cat linebot/__about__.py
3840
- name: Test with pytest
3941
run: |

.github/workflows/publish-to-pypi.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Upload Python Package
55

66
on:
77
release:
8-
types: [created]
8+
types: [published]
99

1010
jobs:
1111
deploy:
@@ -24,12 +24,11 @@ jobs:
2424
run: |
2525
python -m pip install --upgrade pip
2626
pip install setuptools wheel twine
27-
- name: Show Version Number
28-
run: |
29-
echo "Version=${{ github.event.release.tag_name }}"
3027
- name: Update version in linebot/__about__.py
3128
run: |
32-
sed -i 's/__version__ = "__LINE_BOT_SDK_PYTHON_VERSION__"/__version__ = "'${{ github.event.release.tag_name }}'"/g' linebot/__about__.py
29+
VERSION=${{ github.event.release.tag_name }}
30+
VERSION=${VERSION#v}
31+
sed -i "s/__version__ = '__LINE_BOT_SDK_PYTHON_VERSION__'/__version__ = '$VERSION'/g" linebot/__about__.py
3332
cat linebot/__about__.py
3433
- name: Build and publish
3534
env:

linebot/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""Meta data of line-bot-sdk."""
1616

1717

18-
__version__ = "__LINE_BOT_SDK_PYTHON_VERSION__"
18+
__version__ = '__LINE_BOT_SDK_PYTHON_VERSION__'
1919
__author__ = 'LINE Corporation'
2020
__copyright__ = 'Copyright 2016, LINE Corporation'
2121
__license__ = 'Apache 2.0'

0 commit comments

Comments
 (0)