diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c279cca..2c3c26c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,9 +28,9 @@ python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies - run: poetry install --no-interaction + run: poetry install - name: Build Package - run: poetry build --no-interaction + run: poetry build - name: Upload Build Artifact uses: actions/upload-artifact@v3 with: @@ -58,10 +58,9 @@ python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies - run: poetry install --no-interaction + run: poetry install - name: Build Executable - run: |- - poetry run make dist RUNNER_OS=${{ runner.os }} RUNNER_ARCH=${{ runner.arch }} + run: poetry run make dist - name: Upload Build Artifact uses: actions/upload-artifact@v3 with: @@ -124,6 +123,6 @@ python-version: ${{ env.PYTHON_VERSION }} cache: poetry - name: Install Dependencies - run: poetry install --no-interaction + run: poetry install - name: Publish to PyPI - run: poetry publish --username "${{ secrets.PYPI_USERNAME }}" --password "${{ secrets.PYPI_PASSWORD }}" --build --no-interaction + run: poetry publish --username="${{ secrets.PYPI_USERNAME }}" --password="${{ secrets.PYPI_PASSWORD }}" --build diff --git a/Makefile b/Makefile index eda9b3f..203c2a5 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,15 @@ -BIN := $(HOME)/.local/bin -DIST := $(CURDIR)/dist -NAME := tld +BUILD := $(CURDIR)/build +DIST := $(CURDIR)/dist +NAME := tld -OS != echo $(RUNNER_OS) | tr '[:upper:]' '[:lower:]' -ARCH != echo $(RUNNER_ARCH) | tr '[:upper:]' '[:lower:]' - -ifneq ($(and $(OS), $(ARCH)),) - NAME := $(NAME)-$(OS)-$(ARCH) -endif - -ifeq ($(OS), windows) - EXE := .exe +SYSTEM != python -c 'import platform; print(platform.system().lower())' +MACHINE != python -c 'import platform; print(platform.machine().lower())' +ifeq ($(SYSTEM), windows) + EXE := .exe else - EXE := + EXE := endif - -TARGET := $(DIST)/$(NAME)$(EXE) -TARGET_INSTALL := $(BIN)/$(NAME)$(EXE) +DIST_TARGET := $(DIST)/$(NAME)-$(SYSTEM)-$(MACHINE)$(EXE) all: @@ -25,42 +18,34 @@ clean: demo-clean @ find $(CURDIR) -type d -name '__pycache__' -exec $(RM) --recursive --verbose '{}' + @ find $(CURDIR) -type f -name '*.spec' -exec $(RM) --verbose '{}' + - $(RM) --recursive $(CURDIR)/build + $(RM) --recursive $(BUILD) $(RM) --recursive $(DIST) docs: $(CURDIR)/main.py typer $< utils docs --name=$(NAME) -dist: $(TARGET) - -install: $(TARGET_INSTALL) +dist: $(DIST_TARGET) pretty: black prettier +setup: + poetry install + conda install --yes libpython-static + ##################### # Auxiliary Targets # ##################### +$(DIST_TARGET): $(CURDIR)/main.py +ifeq ($(OS), windows) + pyinstaller --distpath=$(DIST) --workpath=$(BUILD) --onefile --name=$(NAME)-$(SYSTEM)-$(MACHINE) $< +else + python -m nuitka --standalone --onefile --output-filename=$(@F) --output-dir=$(@D) --remove-output $< +endif + black: isort --profile black $(CURDIR) black $(CURDIR) prettier: $(CURDIR)/.gitignore prettier --write --ignore-path=$< $(CURDIR) - -$(TARGET_INSTALL): $(TARGET) - @ install -D --mode="u=rwx,go=rx" --no-target-directory --verbose $< $@ - -$(CURDIR)/demo.gif: $(CURDIR)/demo.tape -ifeq ($(BW_SESSION),) - $(error Bitwarden Locked) -else - vhs --output=$@ $< -endif - -$(TARGET): $(CURDIR)/main.py -ifeq ($(OS), windows) - pyinstaller --distpath=$(DIST) --workpath=$(CURDIR)/build --onefile --name=$(NAME) $< -else - python -m nuitka --standalone --onefile --output-filename=$(NAME) --output-dir=$(DIST) --remove-output $< -endif diff --git a/poetry.lock b/poetry.lock index 989f79c..ad4ebda 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "altgraph" @@ -362,12 +362,12 @@ [[package]] name = "nuitka" -version = "1.6.6" +version = "1.7" description = "Python compiler with full language support and CPython compatibility" optional = false python-versions = "*" files = [ - {file = "Nuitka-1.6.6.tar.gz", hash = "sha256:e2c7ddd5d09cfd867dfba913c3601de4ab448e946eb1aa1df85cc90d8296b3e6"}, + {file = "Nuitka-1.7.tar.gz", hash = "sha256:7c740e1762f4bd7edd7f956be5116b453c7124202a21f3ea9f06113c73a1528d"}, ] [package.dependencies]