Skip to content

Commit

Permalink
Merge pull request #13 from ivansaul/develop
Browse files Browse the repository at this point in the history
Setup semantic versioning
  • Loading branch information
ivansaul authored Oct 6, 2024
2 parents 42554d3 + 8e74db8 commit 47b03f9
Show file tree
Hide file tree
Showing 13 changed files with 636 additions and 8 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Continuous Delivery

on:
push:
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
concurrency: release

permissions:
id-token: write
contents: write

steps:
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.VIDPACK_GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "[email protected]"

- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@v1
if: steps.release.outputs.released == 'true'
with:
password: ${{ secrets.PYPI_TOKEN }}
repository-url: https://pypi.org/legacy/

- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.VIDPACK_GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
"cSpell.words": [
"acodec",
"ffprobe",
"github",
"ivansaul",
"pacman",
"pypa",
"pypi",
"typer",
"vcodec"
"vcodec",
"vidpack"
],
"python.testing.pytestArgs": [
"tests"
"src/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
Expand Down
554 changes: 553 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
[tool.poetry]
name = "pack"
name = "vidpack"
version = "0.1.0"
description = "A Python script for efficiently compressing videos without sacrificing quality"
authors = ["ivansaul"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/ivansaul/CLI-Video-Compressor"
repository = "https://github.com/ivansaul/CLI-Video-Compressor"
keywords = ["video", "compression", "ffmpeg", "python"]
include = ["LICENSE"]
classifiers = [
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Topic :: Multimedia :: Video",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Utilities",
]

[tool.poetry.scripts]
pack = "pack.cli:app"
pack = "src.vidpack.cli:app"

[tool.poetry.dependencies]
python = "^3.10"
Expand All @@ -20,6 +31,19 @@ python-ffmpeg = "^2.0.12"
pytest = "^8.3.3"
ruff = "^0.6.8"
pytest-mock = "^3.14.0"
python-semantic-release = "^9.9.0"

[tool.semantic_release]
version_source = "tag"
version_variable = ["src/vidpack/__init__.py:__version__"]
version_toml = ["pyproject.toml:tool.poetry.version"]
branch = "master"
build_command = "pip install poetry && poetry build"
major_on_zero = true
allow_zero_version = true
upload_to_pypi = true
upload_to_release = true
commit_version_number = true

[build-system]
requires = ["poetry-core"]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_helpers.py → src/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from pack.helpers import add_affixes, file_exists, is_ffmpeg_installed
from vidpack.helpers import add_affixes, file_exists, is_ffmpeg_installed


@pytest.mark.parametrize(
Expand Down Expand Up @@ -51,7 +51,7 @@ def mock_run(*args, **kwargs):
assert is_ffmpeg_installed() is False


@patch("pack.helpers.Path.exists")
@patch("vidpack.helpers.Path.exists")
def test_file_exists(mock_exists):
"""
Test file_exists function with different scenarios.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_patterns.py → src/tests/test_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from pack.constants import Constants
from vidpack.constants import Constants


@pytest.mark.parametrize(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 47b03f9

Please sign in to comment.