Skip to content

Commit 334bd7e

Browse files
committed
refactor: isolated version update and build script
1 parent cd50f3d commit 334bd7e

2 files changed

Lines changed: 43 additions & 35 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,28 @@ name: Publish cryptlex.lexfloatclient package
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
libraryVersion:
7-
description: 'Library Version'
8-
required: true
9-
default: ''
10-
packageVersion:
11-
description: 'Package Version'
12-
required: true
13-
default: ''
145

156
jobs:
16-
update-version:
17-
runs-on: ubuntu-latest
18-
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@v2
21-
22-
- name: Update Package Version
23-
run: |
24-
sed -i '/version=/!b;c \ \ \ \ version="${{ github.event.inputs.packageVersion }}",' setup.py
25-
26-
- name: Update Library Version
27-
run: |
28-
sed -i '/lexfloatclient_libs_version =/!b;clexfloatclient_libs_version = "v${{ github.event.inputs.libraryVersion }}"' pre-publish.py
29-
30-
- name: Commit, Tag and Push
31-
run: |
32-
git add pre-publish.py
33-
git add setup.py
34-
git config user.name github-actions
35-
git config user.email github-actions@github.com
36-
git commit -m "updated version" | exit 0
37-
git tag ${{ github.event.inputs.packageVersion }}
38-
git push & git push --tags
39-
407
deploy:
41-
needs: update-version
428
runs-on: ubuntu-latest
43-
449
steps:
4510
- uses: actions/checkout@v2
11+
4612
- run: git pull origin master --ff-only
13+
4714
- name: Set up Python
4815
uses: actions/setup-python@v1
4916
with:
5017
python-version: '3.x'
18+
5119
- name: Install dependencies
5220
run: |
5321
python -m pip install --upgrade pip
5422
pip install setuptools wheel twine
23+
5524
- name: Download Native Libs
5625
run: python pre-publish.py
26+
5727
- name: Build and publish
5828
env:
5929
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Update version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
libraryVersion:
7+
description: 'Library Version'
8+
required: true
9+
default: ''
10+
packageVersion:
11+
description: 'Package Version'
12+
required: true
13+
default: ''
14+
15+
jobs:
16+
update-version:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Update Package Version
23+
run: |
24+
sed -i '/version=/!b;c \ \ \ \ version="${{ github.event.inputs.packageVersion }}",' setup.py
25+
26+
- name: Update Library Version
27+
run: |
28+
sed -i '/lexfloatclient_libs_version =/!b;clexfloatclient_libs_version = "v${{ github.event.inputs.libraryVersion }}"' pre-publish.py
29+
30+
- name: Commit, Tag and Push
31+
run: |
32+
git add pre-publish.py
33+
git add setup.py
34+
git config user.name github-actions
35+
git config user.email github-actions@github.com
36+
git commit -m "updated version" | exit 0
37+
git tag ${{ github.event.inputs.packageVersion }}
38+
git push & git push --tags

0 commit comments

Comments
 (0)