Skip to content

Commit a8379c8

Browse files
committed
Added auto release to CI workflow
1 parent 4cb1a75 commit a8379c8

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/test-and-publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,46 @@ jobs:
144144
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
145145
poetry publish
146146
147+
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
148+
name: Extract version
149+
id: extract_version
150+
run: |
151+
VERSION=$(poetry version --short)
152+
echo "version=$VERSION" >> $GITHUB_OUTPUT
153+
echo "📋 Extracted version: $VERSION"
154+
155+
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
156+
name: Create Git Tag
157+
run: |
158+
git config user.name github-actions
159+
git config user.email [email protected]
160+
git tag -a "v${{ steps.extract_version.outputs.version }}" -m "Release v${{ steps.extract_version.outputs.version }}"
161+
git push origin "v${{ steps.extract_version.outputs.version }}"
162+
163+
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
164+
name: Create GitHub Release
165+
uses: softprops/action-gh-release@v1
166+
with:
167+
tag_name: "v${{ steps.extract_version.outputs.version }}"
168+
name: "Release v${{ steps.extract_version.outputs.version }}"
169+
body: |
170+
## Changes in v${{ steps.extract_version.outputs.version }}
171+
172+
This release was automatically created from the main branch.
173+
174+
### Installation
175+
```bash
176+
pip install python-lyrics-transcriber==${{ steps.extract_version.outputs.version }}
177+
```
178+
179+
### Assets
180+
- Python package published to PyPI
181+
- Frontend assets included in the package
182+
183+
For detailed changes, see the commit history.
184+
draft: false
185+
prerelease: false
186+
files: |
187+
dist/*.whl
188+
dist/*.tar.gz
189+

0 commit comments

Comments
 (0)