From 17de2f82ce37a37f6f9985b40c9752eed9d701a4 Mon Sep 17 00:00:00 2001 From: bipinkrish Date: Thu, 23 Feb 2023 13:11:48 +0530 Subject: [PATCH] Workflow for building binaries --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++ main.py => DeGourou.py | 70 +++++++++++++++++++------------------- README.md | 4 +-- 3 files changed, 81 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/main.yml rename main.py => DeGourou.py (95%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b72c293 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +name: Executable Build + +on: + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Check-out repository + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9.13' + architecture: 'x64' + cache: 'pip' + cache-dependency-path: | + **/requirements*.txt + + - name: Install Dependencies + run: | + pip install -r requirements.txt + + - name: Build Executable + uses: Nuitka/Nuitka-Action@v0.4 + with: + script-name: DeGourou.py + onefile: true + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }} Build + path: | + build/*.exe + build/*.bin + build/*.app/**/* \ No newline at end of file diff --git a/main.py b/DeGourou.py similarity index 95% rename from main.py rename to DeGourou.py index 0368608..6f6286e 100644 --- a/main.py +++ b/DeGourou.py @@ -1,36 +1,36 @@ -from setup.login_account import loginAndGetKey -from setup.fulfill import downloadFile - -from decrypt.decodePDF import decryptPDF -from decrypt.decodeEPUB import decryptEPUB - -# setting up the account and keys -loginAndGetKey() - -# acsm file -acsmFile = input("Enter ACSM file (press enter if the file name is URLLink.acsm): ") -if acsmFile == "": - from os.path import exists - if exists("URLLink.acsm"): - acsmFile = "URLLink.acsm" - else: - print("URLLink.acsm file does not exists") - print() - exit(1) - -# downlaod -enrcyptedFile = downloadFile(acsmFile) -print(enrcyptedFile) -print() - -# decrypt -if enrcyptedFile.endswith(".pdf"): - decryptedFile = decryptPDF(enrcyptedFile) -elif enrcyptedFile.endswith(".epub"): - decryptedFile = decryptEPUB(enrcyptedFile) -else: - print("Not in supported file formats") - print() - exit(1) -print(decryptedFile) +from setup.login_account import loginAndGetKey +from setup.fulfill import downloadFile + +from decrypt.decodePDF import decryptPDF +from decrypt.decodeEPUB import decryptEPUB + +# setting up the account and keys +loginAndGetKey() + +# acsm file +acsmFile = input("Enter ACSM file (press enter if the file name is URLLink.acsm): ") +if acsmFile == "": + from os.path import exists + if exists("URLLink.acsm"): + acsmFile = "URLLink.acsm" + else: + print("URLLink.acsm file does not exists") + print() + exit(1) + +# downlaod +enrcyptedFile = downloadFile(acsmFile) +print(enrcyptedFile) +print() + +# decrypt +if enrcyptedFile.endswith(".pdf"): + decryptedFile = decryptPDF(enrcyptedFile) +elif enrcyptedFile.endswith(".epub"): + decryptedFile = decryptEPUB(enrcyptedFile) +else: + print("Not in supported file formats") + print() + exit(1) +print(decryptedFile) print() \ No newline at end of file diff --git a/README.md b/README.md index d067823..61200e6 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,14 @@ 1. Clone the repositary or Downlaod zip file and extract it 2. Install requirements using pip -3. Run "main" file +3. Run "DeGourou" file ``` git clone https://github.com/bipinkrish/DeGourou.git cd DeGourou pip install -r requirements.txt -python main.py +python DeGourou.py ``` ---