-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure SonarCloud, Release workflow, and Docker
- Loading branch information
Showing
5 changed files
with
114 additions
and
1 deletion.
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,53 @@ | ||
name: Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tagInput: | ||
description: 'Tag' | ||
required: true | ||
|
||
workflow_call: | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Determine version tag | ||
id: version-tag | ||
run: | | ||
if [ -n "${{ github.event.inputs.tagInput }}" ]; then | ||
echo "tag=${{ github.event.inputs.tagInput }}" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
ghcr.io/ieasybooks/tahweel:latest | ||
ghcr.io/ieasybooks/tahweel:${{ steps.version-tag.outputs.tag }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,27 @@ | ||
name: Release Package to PyPI.org | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and Publish Package to PyPI.org | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
- run: python -m pip install build twine && python -m build | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
call-docker-publish-workflow: | ||
needs: build-and-publish | ||
permissions: | ||
contents: read | ||
packages: write | ||
uses: ./.github/workflows/docker-publish.yml | ||
with: | ||
tag: ${{ github.ref_name }} |
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,3 @@ | ||
sonar.sources=tahweel/ | ||
|
||
sonar.python.version=3.10,3.11,3.12 |
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,17 @@ | ||
# Use the official Python 3.12 Slim image as the base image | ||
FROM python:3.12-slim | ||
|
||
# Set the working directory to /tahweel | ||
WORKDIR /tahweel | ||
|
||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y poppler-utils bc imagemagick && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Install tahweel | ||
RUN pip install tahweel | ||
|
||
# Set the entrypoint to run the installed binary in /tahweel | ||
# Example: docker run -it --rm -v "$PWD:/tahweel" tahweel ... | ||
ENTRYPOINT ["tahweel"] |
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 |
---|---|---|
@@ -1 +1,14 @@ | ||
# تحويل | ||
<div align="center"> | ||
<a href="https://pypi.org/project/tahweel" target="_blank"><img src="https://img.shields.io/pypi/v/tahweel?label=PyPI%20Version&color=limegreen" /></a> | ||
<a href="https://pypi.org/project/tahweel" target="_blank"><img src="https://img.shields.io/pypi/pyversions/tahweel?color=limegreen" /></a> | ||
<a href="https://github.com/ieasybooks/tahweel/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/pypi/l/tahweel?color=limegreen" /></a> | ||
<a href="https://pepy.tech/project/tahweel" target="_blank"><img src="https://static.pepy.tech/badge/tahweel" /></a> | ||
|
||
<a href="https://github.com/ieasybooks/tahweel/actions/workflows/pre-commit.yml" target="_blank"><img src="https://github.com/ieasybooks/tahweel/actions/workflows/pre-commit.yml/badge.svg" /></a> | ||
<a href="https://sonarcloud.io/summary/new_code?id=ieasybooks_tahweel" target="_blank"><img src="https://sonarcloud.io/api/project_badges/measure?project=ieasybooks_tahweel&metric=code_smells" /></a> | ||
<a href="https://tahweel.ieasybooks.com" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" /></a> | ||
</div> | ||
|
||
<h1 dir="rtl">تحويل</h1> | ||
|
||
<p dir="rtl">تحويل ملفات PDF إلى Word و TXT.</p> |