Skip to content

Commit aeb032e

Browse files
committed
fixed version issue with python sdk
1 parent a3e81f0 commit aeb032e

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,37 @@ jobs:
6565
go-version: '1.21.x'
6666
- name: Get Version
6767
id: get_version
68-
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
68+
run: |
69+
# Remove the 'v' prefix from the tag
70+
VERSION=${GITHUB_REF#refs/tags/v}
71+
echo "VERSION=$VERSION" >> $GITHUB_ENV
72+
echo "::set-output name=VERSION::$VERSION"
6973
7074
- name: Create version files
7175
run: |
7276
mkdir -p sdk/dotnet
73-
echo "${GITHUB_REF#refs/tags/v}" > sdk/dotnet/version.txt
77+
echo "$VERSION" > sdk/dotnet/version.txt
78+
79+
# Update Python package version
80+
mkdir -p sdk/python
81+
cat > sdk/python/setup.py <<EOL
82+
from setuptools import setup, find_packages
83+
setup(
84+
name="pgEdge_pulumi_pgedge",
85+
version="${VERSION}",
86+
packages=find_packages(),
87+
install_requires=[
88+
"pulumi>=3.0.0,<4.0.0",
89+
],
90+
)
91+
EOL
7492
7593
- name: Build and Publish Node.js SDK
7694
working-directory: ./sdk/nodejs
7795
run: |
7896
npm install
7997
sed -i 's/"name": "@pgEdge\/pulumi-pgedge"/"name": "@pgedge\/pulumi-pgedge"/g' package.json
80-
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version
98+
npm version ${{ env.VERSION }} --no-git-tag-version
8199
npm run build
82100
npm publish --access=public
83101
env:
@@ -88,7 +106,11 @@ jobs:
88106
run: |
89107
python -m pip install --upgrade pip
90108
python -m pip install build twine
109+
# Clean any existing builds
110+
rm -rf dist/ build/ *.egg-info/
111+
# Build the package
91112
python -m build
113+
# Upload to PyPI
92114
python -m twine upload dist/*
93115
env:
94116
TWINE_USERNAME: __token__

0 commit comments

Comments
 (0)