Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Python Package to PyPI

on:
release:
types: [published]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install PDM
run: pip install pdm

- name: Install dependencies
run: pdm install -G dev

- name: Run formatting and linting
run: pdm run format lint

- name: Run tests
run: pdm run test

- name: Build package
run: pdm build

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/

publish:
needs: build-and-test
runs-on: ubuntu-latest
environment:
name: pypi-publishing
url: https://pypi.org/p/transimage

permissions:
id-token: write # Isolated to publish job only

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: python-package

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ To set up the development environment:
1. Clone the repository
2. Install PDM if you haven't already: `pip install pdm`
3. Install dependencies: `pdm install`
4. Convert images: `python src/____main____.py ./input_image.jpg ./output_image.png png`
4. Convert images: `python src/__main__.py ./input_image.jpg ./output_image.png png`

### Using `____main____.py` directly as a CLI tool (Recommended)
### Using `__main__.py` directly as a CLI tool (Recommended)

Once you've cloned the repository or downloaded the source code, you can use the `__main__.py` file directly by using the following: `python __main__.py <input_path> <output_path> <output_format>`

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "transimage"
version = "1.0.0"
description = "Converts images from one format to another using Pillow. Supports JPG, PNG, BMP, and WebP."
description = "CLI tool for converting images from one format to another using Pillow. Supports JPG, PNG, BMP, and WebP."
authors = [
{name = "Daethyra", email = "109057945+Daethyra@users.noreply.github.com"},
]
Expand Down