Skip to content

Commit fcd0ba8

Browse files
committed
fixes
1 parent 1e1d7b9 commit fcd0ba8

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

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

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
- 'pyproject.toml'
1313
- 'setup.py'
1414
workflow_dispatch:
15+
16+
permissions:
17+
contents: write
18+
1519
jobs:
1620
deploy:
1721
runs-on: ubuntu-latest
@@ -22,9 +26,19 @@ jobs:
2226
token: ${{ secrets.GH_TOKEN }}
2327
fetch-depth: 0
2428

29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install poetry
38+
2539
- name: Get current version
2640
run: |
27-
current_version=$(grep 'version =' pyproject.toml | cut -d'"' -f2)
41+
current_version=$(grep '^version' pyproject.toml | head -1 | cut -d'"' -f2)
2842
echo "CURRENT_VERSION=$current_version" >> $GITHUB_ENV
2943
3044
- name: Bump version
@@ -34,31 +48,13 @@ jobs:
3448
new_version="${major}.${minor}.${patch}"
3549
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
3650
37-
- name: Update version in setup.py
38-
run: |
39-
sed -i "s/version='.*'/version='$NEW_VERSION'/" setup.py
40-
4151
- name: Update version in pyproject.toml
4252
run: |
43-
sed -i "s/version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
44-
45-
- name: Commit version bump
46-
run: |
47-
git config --global user.name "github-actions[bot]"
48-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
49-
git add .
50-
git commit -m "Auto bump version to $NEW_VERSION"
51-
git push origin main
52-
53-
- name: Set up Python
54-
uses: actions/setup-python@v5
55-
with:
56-
python-version: '3.12'
53+
sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" pyproject.toml
5754
58-
- name: Install dependencies
55+
- name: Update version in setup.py
5956
run: |
60-
python -m pip install --upgrade pip
61-
pip install poetry
57+
sed -i "s/version='.*'/version='$NEW_VERSION'/" setup.py
6258
6359
- name: Re-run poetry lockfile
6460
run: poetry lock
@@ -74,3 +70,12 @@ jobs:
7470
with:
7571
user: __token__
7672
password: ${{ secrets.PYPI_API_TOKEN }}
73+
skip-existing: true
74+
75+
- name: Commit version bump
76+
run: |
77+
git config --global user.name "github-actions[bot]"
78+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
79+
git add pyproject.toml setup.py
80+
git commit -m "Auto bump version to $NEW_VERSION"
81+
git push origin main

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
'colorama',
1313
'requests',
1414
],
15-
python_requires='>=3.9,<3.13',
15+
python_requires='>=3.9,<4.0',
1616
)

0 commit comments

Comments
 (0)