Skip to content

Commit

Permalink
Structured project files and updated some things
Browse files Browse the repository at this point in the history
  • Loading branch information
henrique-coder committed Jan 6, 2025
1 parent 9fabc15 commit a92ee3e
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 62 deletions.
4 changes: 4 additions & 0 deletions .github/release-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package:
name: "streamsnapper"
title: "StreamSnapper"
description: "StreamSnapper is an intuitive library designed to simplify, improve, and organize YouTube and Youtube Music media streams. It offers scraping functions with higher speed extraction and efficiency with the latest tools to perform such processes."
30 changes: 25 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@ jobs:
timeout-minutes: 10

steps:
- name: 🔒 Security Scan Dependencies
uses: step-security/harden-runner@v2
with:
egress-policy: audit

- name: 📥 Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 📚 Load Release Config
id: release_config
run: |
PACKAGE_NAME=$(yq '.package.name' .github/release-config.yaml)
PACKAGE_TITLE=$(yq '.package.title' .github/release-config.yaml)
PACKAGE_DESC=$(yq '.package.description' .github/release-config.yaml)
echo "pkg_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
echo "pkg_title=$PACKAGE_TITLE" >> $GITHUB_OUTPUT
echo "pkg_desc=$PACKAGE_DESC" >> $GITHUB_OUTPUT
- name: 📝 Extract Version and Text
id: version_info
run: |
Expand Down Expand Up @@ -61,7 +77,8 @@ jobs:
check-latest: true

- name: 🔧 Install Build Tools
run: python -m pip install --upgrade pip build twine
run: |
python -m pip install --upgrade pip build twine yq
- name: 🏗️ Build Package
run: python -m build --sdist --wheel
Expand All @@ -78,21 +95,21 @@ jobs:
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version_info.outputs.version }}
name: ${{ steps.version_info.outputs.extra_text != '' && format('🎉 StreamSnapper {0} - {1}', steps.version_info.outputs.version, steps.version_info.outputs.extra_text) || format('🎉 StreamSnapper {0}', steps.version_info.outputs.version) }}
name: ${{ steps.version_info.outputs.extra_text != '' && format('🎉 {0} {1} - {2}', steps.release_config.outputs.pkg_title, steps.version_info.outputs.version, steps.version_info.outputs.extra_text) || format('🎉 {0} {1}', steps.release_config.outputs.pkg_title, steps.version_info.outputs.version) }}
body: |
## 📦 Summary
> _StreamSnapper is an intuitive library designed to simplify, improve, and organize YouTube and Youtube Music media streams. It offers scraping functions with higher speed extraction and efficiency with the latest tools to perform such processes._
> _${{ steps.release_config.outputs.pkg_desc }}_
❇️ Available for automatic installation at [PyPI](https://pypi.org/project/streamsnapper) and manual installation at [GitHub](https://github.com/henrique-coder/streamsnapper).
❇️ Available for automatic installation at [PyPI](https://pypi.org/project/${{ steps.release_config.outputs.pkg_name }}) and manual installation at [GitHub](https://github.com/${{ github.repository }}).
### 📋 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_info.outputs.version }})
[View all changes](https://github.com/${{ github.repository }}/compare/${{ steps.previoustag.outputs.tag }}...v${{ steps.version_info.outputs.version }})
draft: false
prerelease: false
files: |
Expand All @@ -103,3 +120,6 @@ jobs:

- name: 🚀 Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# IDE
.idea
.venv

# Cache
__pycache__
.ruff_cache

# Directories
.debug
.ruff_cache

# Files
requirements-dev.txt
debugging.py
dev.py
download_media.py
tempCodeRunnerFile.py

# Extensions
# ...
62 changes: 12 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ classifiers = [
python = "^3.9"
httpx = { version = "0.28.1", optional = false }
scrapetube = { version = "2.5.1", optional = false }
turbodl = { version = "0.1.5", optional = false }
turbodl = { version = "0.1.7", optional = false }
yt-dlp = { version = "2024.12.23", optional = false }
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
orjson
platformdirs
poetry
rich
ruff
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
httpx == 0.28.1
scrapetube == 2.5.1
turbodl == 0.1.5
turbodl == 0.1.7
yt-dlp == 2024.12.23
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include = ["streamsnapper/*.py", "streamsnapper/platforms/*.py", "tests/*.py"]
include = ["streamsnapper/*.py"]
exclude = [".venv", "__pycache__", ".ruff_cache"]
target-version = "py313"
line-length = 130
Expand Down
10 changes: 10 additions & 0 deletions ruff_formatter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Built-in imports
from subprocess import run


def main() -> None:
run(['ruff', 'format'])


if __name__ == '__main__':
main()

0 comments on commit a92ee3e

Please sign in to comment.