Skip to content

Commit 1bacfdd

Browse files
committed
update version in toml
1 parent b01db16 commit 1bacfdd

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,38 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
version:
13+
name: Update version
14+
runs-on: ubuntu-latest
15+
if: startsWith(github.ref, 'refs/tags/v')
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.9
23+
- name: Install poetry
24+
run: |
25+
pip install --upgrade poetry
26+
- name: Update version
27+
run: |
28+
VERSION=${GITHUB_REF#refs/tags/v}
29+
poetry version $VERSION
30+
- name: Commit changes
31+
run: |
32+
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
33+
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
34+
git commit -am "Update version"
35+
36+
- name: Push changes
37+
uses: ad-m/github-push-action@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
branch: ${{ github.ref }}
41+
1242
build:
43+
needs: [version]
1344
uses: ./.github/workflows/build.yml
1445

1546
publish:
@@ -20,11 +51,11 @@ jobs:
2051
needs: [build]
2152
steps:
2253
- name: Checkout code
23-
uses: actions/checkout@v4
54+
uses: actions/checkout@v2
2455
- name: Set up Python
25-
uses: actions/setup-python@v5
56+
uses: actions/setup-python@v2
2657
with:
27-
python-version: 3.12
58+
python-version: 3.9
2859
- name: Install flit
2960
run: |
3061
pip install flit
@@ -33,16 +64,15 @@ jobs:
3364
env:
3465
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
3566
FLIT_USERNAME: __token__
36-
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}
37-
67+
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
3868

3969
release:
4070
name: Create release
4171
runs-on: ubuntu-latest
4272
needs: [publish]
4373
steps:
4474
- name: Checkout
45-
uses: actions/checkout@v4
75+
uses: actions/checkout@v2
4676
- name: Extract release notes
4777
id: extract-release-notes
4878
uses: ffurrer2/extract-release-notes@v2

0 commit comments

Comments
 (0)