From ee55bcd3ca343de2e6e9a17258129cc7363b1b8f Mon Sep 17 00:00:00 2001 From: kouloumos Date: Thu, 2 Jan 2025 17:12:54 +0200 Subject: [PATCH] chore(release): Add release workflow --- .github/workflows/release.yml | 52 ++++++++++++++++++++ poetry.lock | 89 ++++++++++++++++++++++++++++++++++- pyproject.toml | 13 ++++- 3 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1d6e645 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install Poetry + uses: snok/install-poetry@v1 + + - name: Install dependencies + run: poetry install + + - name: Configure Git + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + - name: Bump version and update changelog + id: bump + run: | + output=$(poetry run cz bump --yes) + tag=$(echo "$output" | grep "tag to create:" | awk '{print $4}') + echo "::set-output name=version::${tag}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build package + run: poetry build + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + body_path: CHANGELOG.md + tag_name: ${{ steps.bump.outputs.version }} + files: | + dist/*.whl + dist/*.tar.gz diff --git a/poetry.lock b/poetry.lock index be01a80..f1552c6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -178,6 +178,20 @@ files = [ {file = "appnope-0.1.4.tar.gz", hash = "sha256:1de3860566df9caf38f01f86f65e0e13e379af54f9e4bee1e66b48f2efffd1ee"}, ] +[[package]] +name = "argcomplete" +version = "3.5.3" +description = "Bash tab completion for argparse" +optional = false +python-versions = ">=3.8" +files = [ + {file = "argcomplete-3.5.3-py3-none-any.whl", hash = "sha256:2ab2c4a215c59fd6caaff41a869480a23e8f6a5f910b266c1808037f4e375b61"}, + {file = "argcomplete-3.5.3.tar.gz", hash = "sha256:c12bf50eded8aebb298c7b7da7a5ff3ee24dffd9f5281867dfe1424b58c55392"}, +] + +[package.extras] +test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] + [[package]] name = "argon2-cffi" version = "23.1.0" @@ -600,6 +614,29 @@ traitlets = ">=4" [package.extras] test = ["pytest"] +[[package]] +name = "commitizen" +version = "4.1.0" +description = "Python commitizen client tool" +optional = false +python-versions = ">=3.9" +files = [ + {file = "commitizen-4.1.0-py3-none-any.whl", hash = "sha256:2e6c5fbd442cab4bcc5a04bc86ef2196ef84bcf611317d6c596e87f5bb4c09f5"}, + {file = "commitizen-4.1.0.tar.gz", hash = "sha256:4f2d9400ec411aec1c738d4c63fc7fd5807cd6ddf6be970869e03e68b88ff718"}, +] + +[package.dependencies] +argcomplete = ">=1.12.1,<3.6" +charset-normalizer = ">=2.1.0,<4" +colorama = ">=0.4.1,<0.5.0" +decli = ">=0.6.0,<0.7.0" +jinja2 = ">=2.10.3" +packaging = ">=19" +pyyaml = ">=3.08" +questionary = ">=2.0,<3.0" +termcolor = ">=1.1,<3" +tomlkit = ">=0.5.3,<1.0.0" + [[package]] name = "constantly" version = "23.10.4" @@ -801,6 +838,17 @@ files = [ {file = "debugpy-1.8.6.zip", hash = "sha256:c931a9371a86784cee25dec8d65bc2dc7a21f3f1552e3833d9ef8f919d22280a"}, ] +[[package]] +name = "decli" +version = "0.6.2" +description = "Minimal, easy-to-use, declarative cli tool" +optional = false +python-versions = ">=3.7" +files = [ + {file = "decli-0.6.2-py3-none-any.whl", hash = "sha256:2fc84106ce9a8f523ed501ca543bdb7e416c064917c12a59ebdc7f311a97b7ed"}, + {file = "decli-0.6.2.tar.gz", hash = "sha256:36f71eb55fd0093895efb4f416ec32b7f6e00147dda448e3365cf73ceab42d6f"}, +] + [[package]] name = "decorator" version = "5.1.1" @@ -3428,6 +3476,20 @@ files = [ [package.dependencies] cffi = {version = "*", markers = "implementation_name == \"pypy\""} +[[package]] +name = "questionary" +version = "2.1.0" +description = "Python library to build pretty command line user prompts ⭐️" +optional = false +python-versions = ">=3.8" +files = [ + {file = "questionary-2.1.0-py3-none-any.whl", hash = "sha256:44174d237b68bc828e4878c763a9ad6790ee61990e0ae72927694ead57bab8ec"}, + {file = "questionary-2.1.0.tar.gz", hash = "sha256:6302cdd645b19667d8f6e6634774e9538bfcd1aad9be287e743d96cacaf95587"}, +] + +[package.dependencies] +prompt_toolkit = ">=2.0,<4.0" + [[package]] name = "queuelib" version = "1.7.0" @@ -3816,6 +3878,20 @@ files = [ [package.extras] widechars = ["wcwidth"] +[[package]] +name = "termcolor" +version = "2.5.0" +description = "ANSI color formatting for output in terminal" +optional = false +python-versions = ">=3.9" +files = [ + {file = "termcolor-2.5.0-py3-none-any.whl", hash = "sha256:37b17b5fc1e604945c2642c872a3764b5d547a48009871aea3edd3afa180afb8"}, + {file = "termcolor-2.5.0.tar.gz", hash = "sha256:998d8d27da6d48442e8e1f016119076b690d962507531df4890fcd2db2ef8a6f"}, +] + +[package.extras] +tests = ["pytest", "pytest-cov"] + [[package]] name = "terminado" version = "0.18.1" @@ -3876,6 +3952,17 @@ requests-file = ">=1.4" release = ["build", "twine"] testing = ["black", "mypy", "pytest", "pytest-gitignore", "pytest-mock", "responses", "ruff", "syrupy", "tox", "types-filelock", "types-requests"] +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, + {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, +] + [[package]] name = "tornado" version = "6.4.1" @@ -4281,4 +4368,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.13" -content-hash = "496fb95c9015dfc06841d385da918702758bb0061941ecae500adfb4321b8503" +content-hash = "56542af8c7482c68cd3e40fe2098d1ac241f2f569b7d07a54c9de8a1284eaa2e" diff --git a/pyproject.toml b/pyproject.toml index be53b0c..084bff0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "scraper" version = "0.1.0" -description = "Scraper is designed to automate the process of gathering information from a variety of key Bitcoin-related sources. It leverages GitHub Actions to schedule nightly cron jobs, ensuring that the most up-to-date content is captured from each source according to a defined frequency. The scraped data are then stored in an Elasticsearch index." +description = "A flexible multi-source scraper application designed to gather information from GitHub repositories and web pages. Leverages both Git-based and Scrapy-based approaches to handle different source types effectively." authors = ["kouloumos ", "urvish patel "] readme = "README.md" packages = [{include = "scraper"}] @@ -18,6 +18,7 @@ python-dotenv = "^1.0.1" aiohttp = "^3.10.5" scrapy = "^2.11.2" openai = "^1.52.2" +beautifulsoup4 = "^4.12.3" [tool.poetry.group.dev.dependencies] @@ -26,11 +27,21 @@ pandas = "^2.2.3" matplotlib = "^3.9.2" tabulate = "^0.9.0" seaborn = "^0.13.2" +commitizen = "^4.1.0" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" +[tool.commitizen] +name = "cz_conventional_commits" +version = "0.1.0" +tag_format = "v$version" +version_files = [ + "pyproject.toml:version", +] +update_changelog_on_bump = true + [tool.poetry.scripts] scraper = "scraper.cli:cli" playground = "scraper.run_jupyter:main"