Skip to content

Commit b588568

Browse files
fix(ci): change semantic versioning workflow
1 parent aeea4dc commit b588568

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/release-pipeline.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,30 +104,30 @@ jobs:
104104
run: |
105105
git config --global user.name "semantic-release"
106106
git config --global user.email "semantic-release@users.noreply.github.com"
107+
107108
# Debug information
108109
echo "Current git status:"
109110
git status
110111
echo "Current branch:"
111112
git branch
112113
113-
# Run semantic release with verbose output
114-
echo "Running semantic-release version"
115-
VERSION_OUTPUT=$(poetry run semantic-release --verbose version)
116-
echo "$VERSION_OUTPUT"
114+
# Run semantic-release with output capturing
115+
poetry run semantic-release --verbose version 2>&1 | tee version_output.txt
117116
118-
# Extract version information
119-
if echo "$VERSION_OUTPUT" | grep -q "The next version is"; then
117+
# Check if a new version was created
118+
if grep -q "The next version is" version_output.txt; then
119+
# Get the new version from pyproject.toml
120120
NEW_VERSION=$(poetry run python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
121+
echo "New version detected: $NEW_VERSION"
121122
echo "new_release_published=true" >> $GITHUB_OUTPUT
122123
echo "new_release_version=$NEW_VERSION" >> $GITHUB_OUTPUT
123-
echo "New version: $NEW_VERSION"
124124
125125
# Publish the release
126-
echo "Publishing release"
127126
poetry run semantic-release --verbose publish
128127
else
129128
echo "No version bump needed"
130129
echo "new_release_published=false" >> $GITHUB_OUTPUT
130+
echo "new_release_version=" >> $GITHUB_OUTPUT
131131
fi
132132
env:
133133
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -156,6 +156,11 @@ jobs:
156156
username: ${{ github.actor }}
157157
password: ${{ secrets.GITHUB_TOKEN }}
158158

159+
- name: Debug outputs
160+
run: |
161+
echo "New release published: ${{ needs.semantic-release.outputs.new_release_published }}"
162+
echo "New release version: ${{ needs.semantic-release.outputs.new_release_version }}"
163+
159164
- name: Build and push Docker image
160165
uses: docker/build-push-action@v5
161166
with:
@@ -183,6 +188,11 @@ jobs:
183188
- name: Set up Helm
184189
uses: azure/setup-helm@v1
185190

191+
- name: Debug outputs
192+
run: |
193+
echo "New release published: ${{ needs.semantic-release.outputs.new_release_published }}"
194+
echo "New release version: ${{ needs.semantic-release.outputs.new_release_version }}"
195+
186196
- name: Update Helm Chart version and app version
187197
run: |
188198
VERSION="${{ needs.semantic-release.outputs.new_release_version }}"

0 commit comments

Comments
 (0)