Removed unecessary fields #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Release Creation and PyPI Publishing | |
on: | |
push: | |
branches: ["main"] | |
permissions: | |
contents: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
create-release-and-publish: | |
name: 🏷️ Create Release and Publish to PyPI | |
runs-on: ubuntu-22.04 | |
if: startsWith(github.event.head_commit.message, 'Bump version to') | |
timeout-minutes: 10 | |
steps: | |
- name: 📥 Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 📝 Extract Version | |
id: version | |
run: | | |
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'Bump version to \K[^ ]+') | |
echo "Version detected: $VERSION" | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: 🏷️ Get Previous Tag | |
id: previoustag | |
run: | | |
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | |
echo "Previous tag: $PREV_TAG" | |
echo "tag=$PREV_TAG" >> $GITHUB_OUTPUT | |
- name: 📝 Generate Commit List | |
id: commit_list | |
run: | | |
COMMITS=$(git log --pretty=format:"- [%s](https://github.com/${{ github.repository }}/commit/%H)" ${{ steps.previoustag.outputs.tag }}..HEAD | grep -v "^- \[Bump version to" || echo "- No significant changes in this release") | |
echo "commits<<EOF" >> $GITHUB_OUTPUT | |
echo "$COMMITS" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: 🐍 Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
cache: pip | |
check-latest: true | |
- name: 🔧 Install Build Tools | |
run: python -m pip install --upgrade pip build twine | |
- name: 🏗️ Build Package | |
run: python -m build --sdist --wheel | |
- name: ✅ Validate Metadata | |
run: twine check dist/* | |
- name: 🌍 Set Timezone | |
uses: szenius/set-timezone@v2.0 | |
with: | |
timezoneLinux: "UTC" | |
- name: 🚀 Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.version.outputs.version }} | |
name: "🎉 StreamSnapper ${{ steps.version.outputs.version }} - Summary" | |
body: | | |
## 📦 Installation Options | |
StreamSnapper is available on [GitHub](https://github.com/henrique-coder/streamsnapper) and [PyPI](https://pypi.org/project/streamsnapper). | |
### Available Extras: | |
- 🎬 YouTube Tools: `streamsnapper[youtube]` | |
- 🔄 Merger: `streamsnapper[merger]` | |
- ✨ All Features: `streamsnapper[all]` | |
> **Important:** Install using `pip install -U streamsnapper[EXTRA]`.`. Installing without extras won't provide any additional features. | |
### 📋 Changelog: | |
${{ steps.commit_list.outputs.commits }} | |
### 📊 Compare Changes | |
[View all changes](https://github.com/henrique-coder/streamsnapper/compare/${{ steps.previoustag.outputs.tag }}...v${{ steps.version.outputs.version }}) | |
draft: false | |
prerelease: false | |
files: | | |
dist/*.whl | |
dist/*.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🚀 Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |