From b3b3dbc7b704307ee05851e06f5fc391675db9c4 Mon Sep 17 00:00:00 2001 From: infeeeee Date: Fri, 24 Mar 2023 18:16:26 +0100 Subject: [PATCH] Before first release --- .../workflows/{winbuild.yml => release.yml} | 24 +++++++++++++++---- TODO.md | 3 +-- dyn2py/__init__.py | 7 +++--- pyproject.toml | 4 ++-- 4 files changed, 26 insertions(+), 12 deletions(-) rename .github/workflows/{winbuild.yml => release.yml} (58%) diff --git a/.github/workflows/winbuild.yml b/.github/workflows/release.yml similarity index 58% rename from .github/workflows/winbuild.yml rename to .github/workflows/release.yml index 6d14a09..f385fb7 100644 --- a/.github/workflows/winbuild.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,15 @@ -name: Build Windows exe +name: Release on: push: - # Only build for tags. tags: - "*" - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +permissions: + contents: write jobs: - tests: + build-windows-portable: runs-on: windows-latest steps: @@ -31,3 +30,18 @@ jobs: with: name: dyn2py.exe path: dist/dyn2py.exe + + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: dyn2py.exe + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: dyn2py.exe diff --git a/TODO.md b/TODO.md index 23b268d..e3fe7b8 100644 --- a/TODO.md +++ b/TODO.md @@ -14,10 +14,8 @@ - [x] Tests on Linux - [x] Tests on Windows - [x] Windows Build -- [ ] Windows Installer - [ ] Pip - ## Documentation - [x] API docs @@ -27,5 +25,6 @@ ## Extra features maybe later +- [ ] Windows Installer - [ ] Autocomplete - [ ] Winget \ No newline at end of file diff --git a/dyn2py/__init__.py b/dyn2py/__init__.py index 8430abe..6211491 100644 --- a/dyn2py/__init__.py +++ b/dyn2py/__init__.py @@ -9,6 +9,7 @@ from importlib_metadata import metadata import textwrap import logging import inspect +import sys from dyn2py.files import * from dyn2py.options import * @@ -91,7 +92,7 @@ def __command_line() -> None: parser.add_argument("source", type=pathlib.Path, help="path to a Dynamo graph, a python script or a folder containing them", - nargs="*" + nargs="+" ) options = parser.parse_args(namespace=Options()) @@ -128,7 +129,7 @@ def run(options: Options) -> None: if from_command_line: # log only if it was called from command line: logging.error(f"File does not exist: {source}") - exit(1) + sys.exit(1) else: raise FileNotFoundError(f"Source file does not exist!") @@ -181,7 +182,7 @@ def run(options: Options) -> None: if not files and from_command_line: logging.error("No files to process! See previous warnings!") - exit(1) + sys.exit(1) # Cycle through files: for f in files: diff --git a/pyproject.toml b/pyproject.toml index febf173..9068931 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,8 @@ build = ["pyinstaller"] doc = ["pdoc"] [project.urls] -homepage = "https://infeeeee.github.io/dyn2py" -documentation = "https://github.com/infeeeee/dyn2py" +homepage = "https://github.com/infeeeee/dyn2py" +documentation = "https://infeeeee.github.io/dyn2py" repository = "https://github.com/infeeeee/dyn2py" changelog = "https://github.com/infeeeee/dyn2py/releases"