-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/support-markdown
- Loading branch information
Showing
33 changed files
with
1,165 additions
and
474 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.git | ||
.gitignore | ||
.github | ||
__pycache__ | ||
*.pyc | ||
*.pyo | ||
*.pyd | ||
.Python | ||
env/ | ||
venv/ | ||
.env | ||
*.log | ||
.pytest_cache/ | ||
.coverage | ||
htmlcov/ | ||
dist/ | ||
build/ | ||
*.egg-info/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
tags: [ 'v*.*.*' ] | ||
paths: | ||
- 'podcastfy/**' | ||
- 'setup.py' | ||
- 'requirements.txt' | ||
- 'Dockerfile' | ||
- 'Dockerfile.dev' | ||
- '.github/workflows/docker-publish.yml' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'podcastfy/**' | ||
- 'setup.py' | ||
- 'requirements.txt' | ||
- 'Dockerfile' | ||
- 'Dockerfile.dev' | ||
- '.github/workflows/docker-publish.yml' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
# Build and push PyPI version with caching | ||
- name: Build and push PyPI Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha,scope=prod | ||
cache-to: type=gha,scope=prod,mode=max | ||
|
||
# Build and push development version with caching | ||
- name: Build and push development Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile.dev | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha,scope=dev | ||
cache-to: type=gha,scope=dev,mode=max | ||
|
||
- name: Test Docker images | ||
env: | ||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
run: | | ||
# Test PyPI version | ||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest python3 -c "import podcastfy" | ||
# Test development version | ||
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev | ||
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev python3 -c "import podcastfy" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Use Ubuntu 24.04 as base image | ||
FROM ubuntu:24.04 | ||
|
||
# Prevent interactive prompts during package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
python3-full \ | ||
python3-pip \ | ||
ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create and activate virtual environment | ||
RUN python3 -m venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# Upgrade pip | ||
RUN python3 -m pip install --upgrade pip | ||
|
||
# Install podcastfy from PyPI | ||
RUN pip install --no-cache-dir podcastfy | ||
|
||
# Set environment variables | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Verify installations | ||
RUN echo "Verifying installations:" && \ | ||
echo "Ubuntu version:" && cat /etc/os-release && \ | ||
echo "FFmpeg version:" && ffmpeg -version && \ | ||
echo "Python version:" && python3 --version && \ | ||
echo "Pip version:" && pip --version && \ | ||
echo "Installed packages:" && pip list | ||
|
||
# Command to run when container starts | ||
CMD ["python3"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Use Ubuntu 24.04 as base image to match CI environment | ||
FROM ubuntu:24.04 | ||
|
||
# Prevent interactive prompts during package installation | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Install system dependencies matching CI configuration | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
python3-full \ | ||
python3-pip \ | ||
python3-venv \ | ||
ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create and activate virtual environment | ||
RUN python3 -m venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# Upgrade pip | ||
RUN python3 -m pip install --upgrade pip | ||
|
||
# Install testing and linting dependencies | ||
RUN pip install --no-cache-dir \ | ||
flake8 \ | ||
pytest \ | ||
pytest-xdist | ||
|
||
# Copy requirements first to leverage Docker cache | ||
COPY requirements.txt . | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the package files | ||
COPY . . | ||
|
||
# Install the package in editable mode | ||
RUN pip install -e . | ||
|
||
# Set environment variables | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Verify installations | ||
RUN echo "Verifying installations:" && \ | ||
echo "Ubuntu version:" && cat /etc/os-release && \ | ||
echo "FFmpeg version:" && ffmpeg -version && \ | ||
echo "Python version:" && python3 --version && \ | ||
echo "Pip version:" && pip --version && \ | ||
echo "Installed packages:" && pip list | ||
|
||
# Run flake8 checks during build | ||
RUN flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics && \ | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
|
||
# Command to run when container starts | ||
CMD ["python3"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Podcastfy | ||
Copyright 2024 Tharsis T. P. Souza | ||
------------------------ | ||
This product includes software developed by: | ||
Tharsis T. P. Souza (www.souzatharsis.com) and all of the great contributors listed at https://github.com/souzatharsis/podcastfy/graphs/contributors. | ||
------------------------ | ||
The text of the Apache License, Version 2.0 can be found in the LICENSE file. |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.