File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Publish To PyPI
3
3
on :
4
4
push :
5
5
branches : ['main']
6
-
6
+
7
7
jobs :
8
8
build-publish :
9
9
runs-on : ubuntu-latest
@@ -12,18 +12,22 @@ jobs:
12
12
- uses : actions/checkout@v2
13
13
14
14
- name : Set environnment package version from commit
15
- run : echo "PACKAGE_VERSION=v0.0.0-$(date +%Y%m%d)-${{ github.sha }}" >> $GITHUB_ENV # use same convention as Go bindings
16
-
15
+ run : |
16
+ SHORT_SHA=$(echo ${{ github.sha }} | cut -c-12)
17
+ echo "PACKAGE_VERSION=0.2.$(date +%Y%m%d).${SHORT_SHA}" >> $GITHUB_ENV # use same convention as Go bindings
18
+
17
19
- name : Set up Python 3.12
18
20
uses : actions/setup-python@v3
19
21
with :
20
22
python-version : " 3.12"
21
23
22
- - name : Install dependencies
24
+ - name : Install dependencies
23
25
run : pip install build twine
24
26
25
27
- name : Build wheel
26
- run : python -m build
28
+ run : |
29
+ echo "Building version ${PACKAGE_VERSION}"
30
+ python -m build
27
31
28
32
- name : Publish distribution to PyPI
29
33
env :
Original file line number Diff line number Diff line change 1
1
import setuptools
2
+ import os
2
3
3
4
with open ("README.md" , "r" ) as fh :
4
5
long_description = fh .read ()
5
6
7
+ version = os .getenv ("PACKAGE_VERSION" , "0.0" )
8
+
6
9
setuptools .setup (
7
10
name = "cs3apis" ,
11
+ version = version ,
8
12
setup_requires = ['setuptools_scm' ],
9
13
author = "CS3 Organization" ,
10
14
You can’t perform that action at this time.
0 commit comments