Browse Source

[gha] pyinstall binaries build

Signed-off-by: R4SAS <r4sas@i2pmail.org>
gha
R4SAS 2 years ago
parent
commit
8cbc87b97d
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 24
      .github/workflows/binary.yml
  2. 6
      pbincli/actions.py
  3. 2
      pbincli/utils.py

24
.github/workflows/binary.yml

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
name: Package Application with Pyinstaller
on: [push, pull_request]
jobs:
build:
name: Binary for windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build executable with pyinstaller
run: |
python -m pip install --upgrade pip
pip install .
pip install pyinstaller pywin32-ctypes
pyinstaller pbincli.spec
- uses: actions/upload-artifact@v2
with:
name: pbincli-windows
path: dist/*

6
pbincli/actions.py

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import signal
import signal, sys
from urllib.parse import parse_qsl
from pbincli.api import Shortener
@ -8,7 +8,7 @@ from pbincli.utils import PBinCLIError, check_writable, json_encode, uri_validat @@ -8,7 +8,7 @@ from pbincli.utils import PBinCLIError, check_writable, json_encode, uri_validat
def signal_handler(sig, frame):
print('Keyboard interrupt received, terminating…')
exit(0)
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
@ -68,7 +68,7 @@ def send(args, api_client, settings=None): @@ -68,7 +68,7 @@ def send(args, api_client, settings=None):
if args.debug: print("Passphrase:\t{}\nRequest:\t{}".format(paste.getHash(), request))
# If we use dry option, exit now
if args.dry: exit(0)
if args.dry: sys.exit(0)
print("Uploading paste…")
result = api_client.post(request)

2
pbincli/utils.py

@ -6,7 +6,7 @@ class PBinCLIException(Exception): @@ -6,7 +6,7 @@ class PBinCLIException(Exception):
def PBinCLIError(message):
print("PBinCLI Error: {}".format(message), file=sys.stderr)
exit(1)
sys.exit(1)
def path_leaf(path):

Loading…
Cancel
Save