Browse Source

[gha] pyinstall binaries build

Signed-off-by: R4SAS <r4sas@i2pmail.org>
pull/45/head
R4SAS 2 years ago
parent
commit
c860fec339
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 @@
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 @@
import signal import signal, sys
from urllib.parse import parse_qsl from urllib.parse import parse_qsl
from pbincli.api import Shortener from pbincli.api import Shortener
@ -8,7 +8,7 @@ from pbincli.utils import PBinCLIError, check_writable, json_encode, uri_validat
def signal_handler(sig, frame): def signal_handler(sig, frame):
print('Keyboard interrupt received, terminating…') print('Keyboard interrupt received, terminating…')
exit(0) sys.exit(0)
signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGINT, signal_handler)
@ -68,7 +68,7 @@ def send(args, api_client, settings=None):
if args.debug: print("Passphrase:\t{}\nRequest:\t{}".format(paste.getHash(), request)) if args.debug: print("Passphrase:\t{}\nRequest:\t{}".format(paste.getHash(), request))
# If we use dry option, exit now # If we use dry option, exit now
if args.dry: exit(0) if args.dry: sys.exit(0)
print("Uploading paste…") print("Uploading paste…")
result = api_client.post(request) result = api_client.post(request)

2
pbincli/utils.py

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

Loading…
Cancel
Save