Skip to content

Commit ef953c9

Browse files
committed
[CI] different scheme for versioning
1 parent d6e40ae commit ef953c9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish To PyPI
33
on:
44
push:
55
branches: ['main']
6-
6+
77
jobs:
88
build-publish:
99
runs-on: ubuntu-latest
@@ -12,18 +12,22 @@ jobs:
1212
- uses: actions/checkout@v2
1313

1414
- 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+
1719
- name: Set up Python 3.12
1820
uses: actions/setup-python@v3
1921
with:
2022
python-version: "3.12"
2123

22-
- name: Install dependencies
24+
- name: Install dependencies
2325
run: pip install build twine
2426

2527
- name: Build wheel
26-
run: python -m build
28+
run: |
29+
echo "Building version ${PACKAGE_VERSION}"
30+
python -m build
2731
2832
- name: Publish distribution to PyPI
2933
env:

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import setuptools
2+
import os
23

34
with open("README.md", "r") as fh:
45
long_description = fh.read()
56

7+
version = os.getenv("PACKAGE_VERSION", "0.0.0")
8+
69
setuptools.setup(
710
name="cs3apis",
11+
version=version,
812
setup_requires=['setuptools_scm'],
913
author="CS3 Organization",
1014
author_email="[email protected]",

0 commit comments

Comments
 (0)