├── .gitignore ├── requirements-dev.in ├── requirements.in ├── .vscode └── settings.json ├── requirements.txt ├── requirements-dev.txt ├── LICENSE ├── update-from-nuitka-options.py ├── action.yml.j2 ├── README.rst └── action.yml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | venv 3 | /.idea/ 4 | -------------------------------------------------------------------------------- /requirements-dev.in: -------------------------------------------------------------------------------- 1 | -c requirements.txt 2 | pip-tools 3 | -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | ordered-set # nuitka compile performance helper 2 | zstandard # for nuitka's onefile compression 3 | wheel 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "pyside", 4 | "tkinter", 5 | "zstandard" 6 | ] 7 | } -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with python 3.10 3 | # To update, run: 4 | # 5 | # pip-compile 6 | # 7 | ordered-set==4.1.0 8 | # via -r requirements.in 9 | wheel==0.38.4 10 | # via -r requirements.in 11 | zstandard==0.20.0 12 | # via -r requirements.in 13 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with python 3.10 3 | # To update, run: 4 | # 5 | # pip-compile requirements-dev.in 6 | # 7 | build==0.10.0 8 | # via pip-tools 9 | click==8.1.3 10 | # via pip-tools 11 | colorama==0.4.6 12 | # via 13 | # build 14 | # click 15 | packaging==23.0 16 | # via build 17 | pep517==0.13.0 18 | # via build 19 | pip-tools==6.12.3 20 | # via -r requirements-dev.in 21 | pyparsing==3.0.9 22 | # via packaging 23 | tomli==2.0.1 24 | # via 25 | # build 26 | # pep517 27 | wheel==0.38.4 28 | # via pip-tools 29 | 30 | # The following packages are considered to be unsafe in a requirements file: 31 | # pip 32 | # setuptools 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Jim Kring, Kay Hayen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /update-from-nuitka-options.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import textwrap 6 | 7 | from nuitka.containers.OrderedSets import OrderedSet 8 | from nuitka.utils.CommandLineOptions import OurOptionParser 9 | from nuitka.utils.FileOperations import changeTextFileContents 10 | from nuitka.utils.Jinja2 import getTemplate 11 | 12 | template = getTemplate( 13 | package_name=None, 14 | template_subdir=os.path.dirname(__file__) or ".", 15 | template_name="action.yml.j2", 16 | extensions=("jinja2.ext.do",), 17 | ) 18 | 19 | 20 | parser = None 21 | 22 | 23 | def _getParser(): 24 | global parser 25 | 26 | if parser is None: 27 | sys.argv.append("--help-all") 28 | from nuitka.OptionParsing import parser 29 | from nuitka.plugins.Plugins import addStandardPluginCommandLineOptions 30 | 31 | addStandardPluginCommandLineOptions(parser=parser, plugin_help_mode=True) 32 | del sys.argv[-1] 33 | 34 | return parser 35 | 36 | 37 | def getOptions(): 38 | for option in _getParser().iterateOptions(): 39 | # Help option 40 | if "--help" in option._long_opts: 41 | continue 42 | 43 | # Main option is currently not done like this 44 | if "--main" in option._long_opts: 45 | continue 46 | 47 | if not hasattr(option, "require_compiling"): 48 | continue 49 | 50 | # Non-compiling options do not belong into Nuitka-Action 51 | if not option.require_compiling or not option.github_action: 52 | continue 53 | 54 | from nuitka.OptionParsing import SUPPRESS_HELP 55 | 56 | if option.help is SUPPRESS_HELP: 57 | continue 58 | 59 | yield option 60 | 61 | 62 | def getTopOptions(): 63 | for option in getOptions(): 64 | container = getattr(option, "container", None) 65 | 66 | if isinstance(container, OurOptionParser): 67 | yield option 68 | 69 | 70 | def getGroupOptions(group_name): 71 | for option in getOptions(): 72 | container = getattr(option, "container", None) 73 | 74 | if isinstance(container, OurOptionParser): 75 | continue 76 | 77 | if container.title == group_name: 78 | yield option 79 | 80 | 81 | def formatOption(option): 82 | help_str = option.help 83 | if help_str.startswith("[REQUIRED]"): 84 | help_str = help_str[11:] 85 | 86 | assert not help_str[-1].isspace(), option 87 | 88 | result = ( 89 | option._long_opts[0].lstrip("-") 90 | + ":\n description: |\n" 91 | + textwrap.indent(help_str, prefix=" ") 92 | ) 93 | 94 | if option.github_action_default is not None: 95 | if type(option.github_action_default) is bool: 96 | option.github_action_default = ( 97 | "true" if option.github_action_default else "false" 98 | ) 99 | 100 | assert type(option.github_action_default) is str, option 101 | result += "\n default: " + option.github_action_default 102 | 103 | return result 104 | 105 | 106 | def get_top_options(): 107 | result = [] 108 | 109 | for option in getTopOptions(): 110 | result.append(formatOption(option)) 111 | 112 | return textwrap.indent("\n".join(result), " ") 113 | 114 | 115 | def get_group_options(group_caption): 116 | result = [] 117 | 118 | for option in getGroupOptions(group_caption): 119 | result.append(formatOption(option)) 120 | 121 | return textwrap.indent("\n".join(result), " ") 122 | 123 | 124 | def get_plugin_options(): 125 | plugin_groups = OrderedSet() 126 | 127 | for option in getOptions(): 128 | container = getattr(option, "container", None) 129 | if isinstance(container, OurOptionParser): 130 | continue 131 | 132 | # TODO: No support for Nuitka VM yet. 133 | if "pelock" in container.title or "themida" in container.title: 134 | continue 135 | 136 | if container.title.startswith("Plugin options of "): 137 | plugin_groups.add(container) 138 | 139 | result = [] 140 | 141 | for option_group in plugin_groups: 142 | result.append("### %s ###" % option_group.title) 143 | 144 | for option in option_group.option_list: 145 | if not option.github_action: 146 | continue 147 | 148 | result.append(formatOption(option)) 149 | 150 | result.append("") 151 | 152 | return textwrap.indent("\n".join(result), " ") 153 | 154 | 155 | action_yaml = template.render( 156 | get_top_options=get_top_options, 157 | get_group_options=get_group_options, 158 | get_plugin_options=get_plugin_options, 159 | ) 160 | 161 | if changeTextFileContents("action.yml", action_yaml): 162 | print("Updated.") 163 | else: 164 | print("Already up to date.") 165 | -------------------------------------------------------------------------------- /action.yml.j2: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:line-length 2 | # yamllint disable rule:comments 3 | # too many spelling things, spell-checker: disable 4 | --- 5 | name: Build executables or extension modules from Python projects 6 | 7 | branding: 8 | icon: "package" 9 | color: "blue" 10 | 11 | description: "Build a modules or standalone executable from python code using Nuitka on Mac/Linux/Windows. Very wide range of compatibility." 12 | 13 | inputs: 14 | working-directory: 15 | default: "." 16 | description: "Directory to run nuitka in if not top level" 17 | 18 | nuitka-version: 19 | default: "main" 20 | description: "Version of nuitka to use, branches, tags work" 21 | 22 | ### Only Required Input ### 23 | script-name: 24 | required: true 25 | description: "Path to python script that is to be built." 26 | 27 | # Enable Nuitka Commercial features of Nuitka using a PAT (personal access token) 28 | access-token: 29 | description: "Github personal access token of an account authorized to access the Nuitka-commercial repo" 30 | 31 | ### Nuitka Modes ### 32 | {{ get_top_options() }} 33 | 34 | ### Nuitka Plugins to enable. ### 35 | {{ get_group_options("Plugin control") }} 36 | 37 | ### Nuitka Tracing/Reporting features 38 | {{ get_group_options("Tracing features") }} 39 | 40 | ### Control the inclusion of data files in result. ### 41 | {{ get_group_options("Data files") }} 42 | 43 | ### Control the inclusion of modules and packages in result. ### 44 | include-package: 45 | description: 'Include a whole package. Give as a Python namespace, e.g. "some_package.sub_package" and Nuitka will then find it and include it and all the modules found below that disk location in the binary or extension module it creates, and make it available for import by the code. To avoid unwanted sub packages, e.g. tests you can e.g. do this "--nofollow-import-to=*.tests". Default empty.' 46 | include-module: 47 | description: 'Include a single module. Give as a Python namespace, e.g. "some_package.some_module" and Nuitka will then find it and include it in the binary or extension module it creates, and make it available for import by the code. Default empty.' 48 | include-plugin-directory: 49 | description: "Include the content of that directory, no matter if it is used by the given main program in a visible form. Overrides all other inclusion options. Can be given multiple times. Default empty." 50 | include-plugin-files: 51 | description: "Include into files matching the PATTERN. Overrides all other follow options. Can be given multiple times. Default empty." 52 | prefer-source-code: 53 | description: "For already compiled extension modules, where there is both a source file and an extension module, normally the extension module is used, but it should be better to compile the module from available source code for best performance. If not desired, there is --no- prefer-source-code to disable warnings about it. Default off." 54 | nofollow-import-to: 55 | description: "Do not follow to that module name even if used, or if a package name, to the whole package in any case, overrides all other options. Can be given multiple times. Default empty." 56 | user-package-configuration-file: 57 | description: "User provided YAML file with package configuration. You can include DLLs, remove bloat, add hidden dependencies. Check User Manual for a complete description of the format to use. Can be given multiple times. Defaults to empty." 58 | 59 | ### Onefile behavior details ### 60 | onefile-tempdir-spec: 61 | description: "Use this as a folder to unpack onefile. Defaults to '%TEMP%\\onefile_%PID%_%TIME%', but e.g. '%CACHE_DIR%/%COMPANY%/%PRODUCT%/%VERSION%' would be cached and good too." 62 | onefile-child-grace-time: 63 | description: "When stopping the child, e.g. due to CTRL-C or shutdown, how much time to allow before killing it the hard way. Unit is ms. Default 5000." 64 | onefile-no-compression: 65 | description: "When creating the onefile, disable compression of the payload. Default is false." 66 | 67 | {{ get_group_options("Control the warnings to be given by Nuitka") }} 68 | 69 | ### Deployment modes ### 70 | {{ get_group_options("Deployment control") }} 71 | 72 | ### Output choices ## 73 | output-dir: 74 | description: "Directory for output builds" 75 | default: build 76 | output-file: 77 | description: "Specify how the executable should be named. For extension modules there is no choice, also not for standalone mode and using it will be an error. This may include path information that needs to exist though. Defaults to '' on this platform. .exe)" 78 | 79 | ### Console handling ### 80 | disable-console: 81 | description: "Obsolete as of Nuitka 2.3: When compiling for Windows or macOS, disable the console window and create a GUI application. Defaults to false." 82 | enable-console: 83 | description: "Obsolete as of Nuitka 2.3: When compiling for Windows or macOS, enable the console window and create a GUI application. Defaults to false and tells Nuitka your choice is intentional." 84 | 85 | ### Version information ### 86 | {{ get_group_options("Binary Version Information") }} 87 | 88 | ### General OS controls ### 89 | {{ get_group_options("General OS controls") }} 90 | 91 | ### Windows specific controls ### 92 | {{ get_group_options("Windows specific controls") }} 93 | 94 | ### macOS specific controls: ### 95 | {{ get_group_options("macOS specific controls") }} 96 | 97 | ### Linux specific controls: ### 98 | {{ get_group_options("Linux specific controls") }} 99 | 100 | 101 | ### Backend C compiler choices. ### 102 | {{ get_group_options("Backend C compiler choice") }} 103 | 104 | ### Debug features. ### 105 | {{ get_group_options("Debug features") }} 106 | 107 | {{ get_plugin_options() }} 108 | 109 | ### Action controls ### 110 | disable-cache: 111 | description: "Disables caching of compiled binaries. Defaults to false." 112 | 113 | caching-key: 114 | description: "An optional string to make the Nuitka build cache key more specific. This can be used for manual cache invalidation or to segment caches based on custom criteria. This key itself is not passed to Nuitka." 115 | required: false 116 | default: "caching" 117 | 118 | {% raw %} 119 | runs: 120 | using: "composite" 121 | steps: 122 | - name: Setup Environment Variables 123 | if: ${{ !inputs.disable-cache }} 124 | shell: bash 125 | run: | 126 | echo "NUITKA_CACHE_DIR=${{ github.action_path }}/nuitka/cache" >> $GITHUB_ENV 127 | echo "PYTHON_VERSION=$(python --version | awk '{print $2}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV 128 | - name: Install Dependencies 129 | shell: bash 130 | run: | 131 | pip install -r "${{ github.action_path }}/requirements.txt" 132 | 133 | # With commercial access token, use that repository. 134 | if [ "${{ inputs.access-token }}" != "" ]; then 135 | repo_url="git+https://${{ inputs.access-token }}@github.com/Nuitka/Nuitka-commercial.git" 136 | else 137 | repo_url="git+https://$@github.com/Nuitka/Nuitka.git" 138 | fi 139 | 140 | pip install "${repo_url}/@${{ inputs.nuitka-version }}#egg=nuitka" 141 | - name: Install ccache 142 | # TODO: Proper "in" test could make sense here. 143 | if: ${{ inputs.disable-cache != 'ccache' && runner.os == 'Linux' }} 144 | shell: bash 145 | run: | 146 | sudo apt-get install -y ccache 147 | - name: Cache Nuitka cache directory 148 | if: ${{ !inputs.disable-cache }} 149 | uses: actions/cache@v4 150 | with: 151 | path: ${{ env.NUITKA_CACHE_DIR }} 152 | key: nuitka-${{ inputs.caching-key }}-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}-nuitka-${{ github.sha }} 153 | restore-keys: | 154 | nuitka-${{ inputs.caching-key }}-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}- 155 | nuitka-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}- 156 | nuitka-${{ runner.os }}-${{ runner.arch }}- 157 | 158 | - name: Build with Nuitka 159 | shell: bash 160 | env: 161 | PYTHONUTF8: 1 162 | run: | 163 | set -e 164 | 165 | # Prepare the JSON string for Nuitka, filtering out action-specific keys using Python 166 | NUITKA_WORKFLOW_INPUTS=$(echo '${{ toJson(inputs) }}' | python -c "import sys, json; data = json.load(sys.stdin); [data.pop(k, None) for k in ['nuitka-version', 'working-directory', 'access-token', 'disable-cache', 'caching-key']]; json.dump(data, sys.stdout, ensure_ascii=False)") 167 | 168 | # Pass the filtered JSON to Nuitka via an environment variable 169 | export NUITKA_WORKFLOW_INPUTS 170 | python -m nuitka --github-workflow-options 171 | working-directory: ${{ inputs.working-directory }} 172 | {% endraw %} -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ############### 2 | Nuitka-Action 3 | ############### 4 | 5 | This GitHub Action builds **Windows**, **macOS**, and **Linux** programs 6 | and extension modules from **Python** using the highly compatible 7 | `Nuitka `_ Python compiler. 8 | 9 | ************** 10 | Key Features 11 | ************** 12 | 13 | - **Standalone Executables**: Compile your **Python** code into 14 | standalone executables (``*.exe`` or ``*.bin`` files, and ``.app`` 15 | bundles for Mac). 16 | 17 | - **Binary Python Modules**: Create binary ``*.pyd`` modules that can 18 | be imported by other **Python** scripts. This is useful for 19 | distributing parts of your **Python** project as compiled libraries. 20 | 21 | - **Cross-Platform Compatibility**: Build for Windows, macOS (including 22 | ``.app`` bundles), and Linux from a single workflow. 23 | 24 | - **GUI Framework Support**: Seamlessly compile applications using 25 | popular GUI frameworks such as TkInter, `PySide6 26 | `_, and `PyQt6 27 | `_. 28 | 29 | - **Comprehensive Nuitka Features**: Leverage the full power of the 30 | `Nuitka Python Compiler `_, including support for 31 | `Nuitka Commercial Features 32 | `_ like obfuscation, 33 | embedding data files, and more support for `Nuitka Commercial 34 | Features `_ like obfuscation, 35 | embedding data files, and more (for those with a license). 36 | 37 | *************** 38 | Simple to Use 39 | *************** 40 | 41 | See :ref:`Usage Details ` below for more info. 42 | 43 | 1) Create a **Python** script 44 | ============================= 45 | 46 | .. code:: python 47 | 48 | ## hello_world.py 49 | print("hello world!") 50 | 51 | Run it in python 52 | 53 | .. code:: console 54 | 55 | C:\> python hello_world.py 56 | hello world! 57 | 58 | 2) Build an executable 59 | ====================== 60 | 61 | Use this action as a step in one of your project's CI workflow jobs 62 | (:ref:`details below `): 63 | 64 | .. code:: yaml 65 | 66 | # Build python script into a stand-alone exe 67 | - uses: Nuitka/Nuitka-Action@main 68 | with: 69 | nuitka-version: main 70 | script-name: hello_world.py 71 | 72 | 3) Run the executable 73 | ===================== 74 | 75 | .. code:: console 76 | 77 | C:\> hello_world.exe 78 | hello world! 79 | 80 | ********************* 81 | Current Limitations 82 | ********************* 83 | 84 | - There are not enough examples yet that demonstrate how to use this 85 | action in practice. Please help proving them. But everything that's 86 | possible with **Nuitka** should work just fine doing it in a workflow 87 | with this Action. 88 | 89 | ************** 90 | Common traps 91 | ************** 92 | 93 | - Uploading artifacts should make sure ``include-hidden-files`` is 94 | present or else incomplete folders will be copied in case of 95 | ``.libs`` folders. 96 | 97 | - For ``mode`` the value ``app`` is the default and needs to be 98 | switched. For packages you need to use ``module``. 99 | 100 | *********************** 101 | Some Example Projects 102 | *********************** 103 | 104 | We need to add a repository demonstrating how to use the different modes 105 | and typical applications. Help is welcome. 106 | 107 | .. _usage-details: 108 | 109 | *************** 110 | Usage Details 111 | *************** 112 | 113 | See action.yml for details on how this action works under the hood. It 114 | is actually extremely simple. 115 | 116 | Build a python script into an exe 117 | ================================= 118 | 119 | .. code:: yaml 120 | 121 | jobs: 122 | 123 | build: 124 | runs-on: windows-latest 125 | 126 | steps: 127 | 128 | # Check-out repository 129 | - uses: actions/checkout@v4 130 | 131 | # Setup Python 132 | - uses: actions/setup-python@v5 133 | with: 134 | python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax 135 | architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified 136 | 137 | # Build python script into a single execute or app folder (macOS) 138 | - uses: Nuitka/Nuitka-Action@main 139 | with: 140 | nuitka-version: main 141 | script-name: hello_world.py 142 | mode: app 143 | 144 | # Uploads artifact 145 | - name: Upload Artifact 146 | uses: actions/upload-artifact@v4 147 | with: 148 | name: exe 149 | path: build/hello_world.exe 150 | include-hidden-files: true 151 | 152 | GUI Builds 153 | ========== 154 | 155 | Similar to the others, but with ``enable-plugins: pyside6`` or 156 | ``enable-plugins:tk-inter`` to ensure that those libraries are included 157 | correctly. 158 | 159 | .. code:: yaml 160 | 161 | - name: Qt GUI with PySide6 162 | uses: Nuitka/Nuitka-Action@main 163 | with: 164 | nuitka-version: main 165 | script-name: my_qt_gui_app.py 166 | mode: standalone 167 | enable-plugins: pyside6 168 | 169 | .. code:: yaml 170 | 171 | - name: Python GUI With TkInter 172 | uses: Nuitka/Nuitka-Action@main 173 | with: 174 | nuitka-version: main 175 | script-name: my_tkinter_gui_app.py 176 | mode: standalone 177 | enable-plugins: tk-inter 178 | 179 | Multi-Platform Builds 180 | ===================== 181 | 182 | Configure a runner of the appropriate operating system to build for a 183 | given platform. You can even do multiple platforms in a single workflow 184 | using a matrix strategy, as shown below: 185 | 186 | .. code:: yaml 187 | 188 | jobs: 189 | build: 190 | strategy: 191 | matrix: 192 | os: [macos-latest, ubuntu-latest, windows-latest] 193 | 194 | runs-on: ${{ matrix.os }} 195 | 196 | steps: 197 | - name: Check-out repository 198 | uses: actions/checkout@v4 199 | 200 | - name: Setup Python 201 | uses: actions/setup-python@v5 202 | with: 203 | python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax 204 | architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified 205 | cache: 'pip' 206 | cache-dependency-path: | 207 | **/requirements*.txt 208 | 209 | - name: Install Dependencies 210 | run: | 211 | pip install -r requirements.txt -r requirements-dev.txt 212 | 213 | - name: Build Executable 214 | uses: Nuitka/Nuitka-Action@main 215 | with: 216 | nuitka-version: main 217 | script-name: your_script.py 218 | mode: app 219 | 220 | - name: Upload Artifacts 221 | uses: actions/upload-artifact@v4 222 | with: 223 | name: ${{ runner.os }} Build 224 | path: | 225 | build/*.exe 226 | build/*.bin 227 | build/*.app/**/* 228 | build/*.dist/**/* 229 | include-hidden-files: true 230 | 231 | You will see that it creates executable binaries for Mac, Linux, and 232 | Windows. 233 | 234 | Python and Package Dependencies 235 | =============================== 236 | 237 | This action installs the following **Python** packages specified by the 238 | requirements.txt of this action repo. 239 | 240 | .. code:: text 241 | 242 | ordered-set==4.1.0 243 | # via -r requirements.in 244 | wheel==0.38.4 245 | # via -r requirements.in 246 | zstandard==0.20.0 247 | 248 | Value syntax 249 | ============ 250 | 251 | Since Action workflows accept no list values, for options that in 252 | **Nuitka** can be given multiple times, there is support for splitting 253 | those arguments by newline, which allows you to specify multiple values 254 | like this. 255 | 256 | .. code:: yaml 257 | 258 | include-data-dir: | 259 | source_path_dir1=dest_path_dir1 260 | source_path_dir2=dest_path_dir2 261 | source_path_dir3=dest_path_dir3 262 | 263 | ************************** 264 | Additional Documentation 265 | ************************** 266 | 267 | See `Nuitka `_ for full documentation 268 | on Nuitka. It's a really fantastic tool! 269 | 270 | ********* 271 | License 272 | ********* 273 | 274 | **Nuitka Action** scripts and documentation in this project are under 275 | the `MIT License `_. 276 | 277 | **Nuitka** has the `Apache 2.0 License 278 | `_ 279 | 280 | **Python** has the `Python Software Foundation (PSF) License 281 | `_. 282 | 283 | You are Responsible for Complying with your Project's Dependencies' Licenses 284 | ============================================================================ 285 | 286 | This tool compiles and copies your project's package dependencies (and 287 | their dependencies) into the output executable, which will be considered 288 | a combined or derivative work of those packages. 289 | 290 | .. important:: 291 | 292 | You are responsible for compliance with the licenses of your 293 | project's package dependencies. Please consult with an attorney about 294 | your individual/project's compliance needs and strategy. 295 | 296 | How to Comply With Dependency Package Licenses 297 | ============================================== 298 | 299 | There are some license checker tools that you might consider integrating 300 | with your project. Generally speaking, they enable you to specify which 301 | licenses (or types) are approved or disapproved and alert you whenever 302 | your project has a package dependency that is not approved. 303 | 304 | Here is a list of license checker tools: 305 | 306 | - `python-license-check 307 | `_ - can be run as a 308 | GitHub pre-commit hook. 309 | 310 | - `dependencies-license-compliance-checker 311 | `_ 312 | - a github action that you can run before your executable build. 313 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | # yamllint disable rule:line-length 2 | # yamllint disable rule:comments 3 | # too many spelling things, spell-checker: disable 4 | --- 5 | name: Build executables or extension modules from Python projects 6 | 7 | branding: 8 | icon: "package" 9 | color: "blue" 10 | 11 | description: "Build a modules or standalone executable from python code using Nuitka on Mac/Linux/Windows. Very wide range of compatibility." 12 | 13 | inputs: 14 | working-directory: 15 | default: "." 16 | description: "Directory to run nuitka in if not top level" 17 | 18 | nuitka-version: 19 | default: "main" 20 | description: "Version of nuitka to use, branches, tags work" 21 | 22 | ### Only Required Input ### 23 | script-name: 24 | required: true 25 | description: "Path to python script that is to be built." 26 | 27 | # Enable Nuitka Commercial features of Nuitka using a PAT (personal access token) 28 | access-token: 29 | description: "Github personal access token of an account authorized to access the Nuitka-commercial repo" 30 | 31 | ### Nuitka Modes ### 32 | mode: 33 | description: | 34 | Mode in which to compile. "accelerated" runs in your Python 35 | installation and depends on it. "standalone" creates a folder 36 | with an executable contained to run it. "onefile" creates a 37 | single self extracting executable to deploy. "app" is "onefile" 38 | except on macOS where it creates an app bundle. "app-dist" is 39 | "standalone" except on macOS where it creates an app bundle. 40 | "module" makes an extension module from a single module and 41 | "package" compiles a whole package into an extension module. 42 | "dll" is currently under development and not for users yet. 43 | Default is 'accelerated'. 44 | default: app 45 | python-flag: 46 | description: | 47 | Python flags to use. Default is what you are using to run Nuitka, this 48 | enforces a specific mode. These are options that also exist to standard 49 | Python executable. Currently supported: "-S" (alias "no_site"), 50 | "static_hashes" (do not use hash randomization), "no_warnings" (do not 51 | give Python run time warnings), "-O" (alias "no_asserts"), "no_docstrings" 52 | (do not use doc strings), "-u" (alias "unbuffered"), "isolated" (do not 53 | load outside code), "-P" (alias "safe_path", do not used current directory 54 | in module search) and "-m" (package mode, compile as "package.__main__"). 55 | Default empty. 56 | python-debug: 57 | description: | 58 | Use debug version or not. Default uses what you are using to run Nuitka, most 59 | likely a non-debug version. Only for debugging and testing purposes. 60 | 61 | ### Nuitka Plugins to enable. ### 62 | enable-plugins: 63 | description: | 64 | Enabled plugins. Must be plug-in names. Use '--plugin-list' to query the 65 | full list and exit. Default empty. 66 | disable-plugins: 67 | description: | 68 | Disabled plugins. Must be plug-in names. Use '--plugin-list' to query the 69 | full list and exit. Most standard plugins are not a good idea to disable. 70 | Default empty. 71 | user-plugin: 72 | description: | 73 | The file name of user plugin. Can be given multiple times. Default empty. 74 | plugin-no-detection: 75 | description: | 76 | Plugins can detect if they might be used, and the you can disable the warning 77 | via "--disable-plugin=plugin-that-warned", or you can use this option to disable 78 | the mechanism entirely, which also speeds up compilation slightly of course as 79 | this detection code is run in vain once you are certain of which plugins to 80 | use. Defaults to off. 81 | module-parameter: 82 | description: | 83 | Provide a module parameter. You are asked by some packages 84 | to provide extra decisions. Format is currently 85 | --module-parameter=module.name-option-name=value 86 | Default empty. 87 | 88 | ### Nuitka Tracing/Reporting features 89 | report: 90 | description: | 91 | Report module, data files, compilation, plugin, etc. details in an XML output file. This 92 | is also super useful for issue reporting. These reports can e.g. be used to re-create 93 | the environment easily using it with '--create-environment-from-report', but contain a 94 | lot of information. Default is off. 95 | report-diffable: 96 | description: | 97 | Report data in diffable form, i.e. no timing or memory usage values that vary from run 98 | to run. Default is off. 99 | report-user-provided: 100 | description: | 101 | Report data from you. This can be given multiple times and be 102 | anything in 'key=value' form, where key should be an identifier, e.g. use 103 | '--report-user-provided=pipenv-lock-hash=64a5e4' to track some input values. 104 | Default is empty. 105 | report-template: 106 | description: | 107 | Report via template. Provide template and output filename 'template.rst.j2:output.rst'. For 108 | built-in templates, check the User Manual for what these are. Can be given multiple times. 109 | Default is empty. 110 | quiet: 111 | description: | 112 | Disable all information outputs, but show warnings. 113 | Defaults to off. 114 | show-scons: 115 | description: | 116 | Run the C building backend Scons with verbose information, showing the executed commands, 117 | detected compilers. Defaults to off. 118 | show-memory: 119 | description: | 120 | Provide memory information and statistics. 121 | Defaults to off. 122 | 123 | ### Control the inclusion of data files in result. ### 124 | include-package-data: 125 | description: | 126 | Include data files for the given package name. DLLs and extension modules 127 | are not data files and never included like this. Can use patterns the 128 | filenames as indicated below. Data files of packages are not included 129 | by default, but package configuration can do it. 130 | This will only include non-DLL, non-extension modules, i.e. actual data 131 | files. After a ":" optionally a filename pattern can be given as 132 | well, selecting only matching files. Examples: 133 | "--include-package-data=package_name" (all files) 134 | "--include-package-data=package_name:*.txt" (only certain type) 135 | "--include-package-data=package_name:some_filename.dat (concrete file) 136 | Default empty. 137 | include-data-files: 138 | description: | 139 | Include data files by filenames in the distribution. There are many 140 | allowed forms. With '--include-data-files=/path/to/file/*.txt=folder_name/some.txt' it 141 | will copy a single file and complain if it's multiple. With 142 | '--include-data-files=/path/to/files/*.txt=folder_name/' it will put 143 | all matching files into that folder. For recursive copy there is a 144 | form with 3 values that '--include-data-files=/path/to/scan=folder_name/=**/*.txt' 145 | that will preserve directory structure. Default empty. 146 | include-data-dir: 147 | description: | 148 | Include data files from complete directory in the distribution. This is 149 | recursive. Check '--include-data-files' with patterns if you want non-recursive 150 | inclusion. An example would be '--include-data-dir=/path/some_dir=data/some_dir' 151 | for plain copy, of the whole directory. All non-code files are copied, if you 152 | want to use '--noinclude-data-files' option to remove them. Default empty. 153 | noinclude-data-files: 154 | description: | 155 | Do not include data files matching the filename pattern given. This is against 156 | the target filename, not source paths. So to ignore a file pattern from package 157 | data for 'package_name' should be matched as 'package_name/*.txt'. Or for the 158 | whole directory simply use 'package_name'. Default empty. 159 | include-data-files-external: 160 | description: | 161 | Include the specified data file patterns outside of the onefile binary, 162 | rather than on the inside. First files have to be specified as included 163 | with other `--include-*data*` options, and then this refers to target 164 | paths inside the distribution that are then put external to it. 165 | Default empty. 166 | include-raw-dir: 167 | description: | 168 | Include raw directories completely in the distribution. This is 169 | recursive. Check '--include-data-dir' to use the sane option. 170 | Default empty. 171 | 172 | ### Control the inclusion of modules and packages in result. ### 173 | include-package: 174 | description: 'Include a whole package. Give as a Python namespace, e.g. "some_package.sub_package" and Nuitka will then find it and include it and all the modules found below that disk location in the binary or extension module it creates, and make it available for import by the code. To avoid unwanted sub packages, e.g. tests you can e.g. do this "--nofollow-import-to=*.tests". Default empty.' 175 | include-module: 176 | description: 'Include a single module. Give as a Python namespace, e.g. "some_package.some_module" and Nuitka will then find it and include it in the binary or extension module it creates, and make it available for import by the code. Default empty.' 177 | include-plugin-directory: 178 | description: "Include the content of that directory, no matter if it is used by the given main program in a visible form. Overrides all other inclusion options. Can be given multiple times. Default empty." 179 | include-plugin-files: 180 | description: "Include into files matching the PATTERN. Overrides all other follow options. Can be given multiple times. Default empty." 181 | prefer-source-code: 182 | description: "For already compiled extension modules, where there is both a source file and an extension module, normally the extension module is used, but it should be better to compile the module from available source code for best performance. If not desired, there is --no- prefer-source-code to disable warnings about it. Default off." 183 | nofollow-import-to: 184 | description: "Do not follow to that module name even if used, or if a package name, to the whole package in any case, overrides all other options. Can be given multiple times. Default empty." 185 | user-package-configuration-file: 186 | description: "User provided YAML file with package configuration. You can include DLLs, remove bloat, add hidden dependencies. Check User Manual for a complete description of the format to use. Can be given multiple times. Defaults to empty." 187 | 188 | ### Onefile behavior details ### 189 | onefile-tempdir-spec: 190 | description: "Use this as a folder to unpack onefile. Defaults to '%TEMP%\\onefile_%PID%_%TIME%', but e.g. '%CACHE_DIR%/%COMPANY%/%PRODUCT%/%VERSION%' would be cached and good too." 191 | onefile-child-grace-time: 192 | description: "When stopping the child, e.g. due to CTRL-C or shutdown, how much time to allow before killing it the hard way. Unit is ms. Default 5000." 193 | onefile-no-compression: 194 | description: "When creating the onefile, disable compression of the payload. Default is false." 195 | 196 | warn-implicit-exceptions: 197 | description: | 198 | Enable warnings for implicit exceptions detected at compile time. 199 | warn-unusual-code: 200 | description: | 201 | Enable warnings for unusual code detected at compile time. 202 | assume-yes-for-downloads: 203 | description: | 204 | Allow Nuitka to download external code if necessary, e.g. dependency 205 | walker, ccache, and even gcc on Windows. To disable, redirect input 206 | from nul device, e.g. "' on this platform. .exe)" 235 | 236 | ### Console handling ### 237 | disable-console: 238 | description: "Obsolete as of Nuitka 2.3: When compiling for Windows or macOS, disable the console window and create a GUI application. Defaults to false." 239 | enable-console: 240 | description: "Obsolete as of Nuitka 2.3: When compiling for Windows or macOS, enable the console window and create a GUI application. Defaults to false and tells Nuitka your choice is intentional." 241 | 242 | ### Version information ### 243 | company-name: 244 | description: | 245 | Name of the company to use in version information. Defaults to unused. 246 | product-name: 247 | description: | 248 | Name of the product to use in version information. Defaults to base filename of the binary. 249 | file-version: 250 | description: | 251 | File version to use in version information. Must be a sequence of up to 4 252 | numbers, e.g. 1.0 or 1.0.0.0, no more digits are allowed, no strings are 253 | allowed. Defaults to unused. 254 | product-version: 255 | description: | 256 | Product version to use in version information. Same rules as for file version. 257 | Defaults to unused. 258 | file-description: 259 | description: | 260 | Description of the file used in version information. Windows only at this time. Defaults to binary filename. 261 | copyright: 262 | description: | 263 | Copyright used in version information. Windows/macOS only at this time. Defaults to not present. 264 | trademarks: 265 | description: | 266 | Trademark used in version information. Windows/macOS only at this time. Defaults to not present. 267 | 268 | ### General OS controls ### 269 | force-stdout-spec: 270 | description: | 271 | Force standard output of the program to go to this location. Useful for programs with 272 | disabled console and programs using the Windows Services Plugin of Nuitka commercial. 273 | Defaults to not active, use e.g. '{PROGRAM_BASE}.out.txt', i.e. file near your program, 274 | check User Manual for full list of available values. 275 | force-stderr-spec: 276 | description: | 277 | Force standard error of the program to go to this location. Useful for programs with 278 | disabled console and programs using the Windows Services Plugin of Nuitka commercial. 279 | Defaults to not active, use e.g. '{PROGRAM_BASE}.err.txt', i.e. file near your program, 280 | check User Manual for full list of available values. 281 | 282 | ### Windows specific controls ### 283 | windows-console-mode: 284 | description: | 285 | Select console mode to use. Default mode is 'force' and creates a 286 | console window unless the program was started from one. With 'disable' 287 | it doesn't create or use a console at all. With 'attach' an existing 288 | console will be used for outputs. With 'hide' a newly spawned console 289 | will be hidden and an already existing console will behave like 290 | 'force'. Default is 'force'. 291 | windows-icon-from-ico: 292 | description: | 293 | Add executable icon. Can be given multiple times for different resolutions 294 | or files with multiple icons inside. In the later case, you may also suffix 295 | with # where n is an integer index starting from 1, specifying a specific 296 | icon to be included, and all others to be ignored. 297 | windows-icon-from-exe: 298 | description: | 299 | Copy executable icons from this existing executable (Windows only). 300 | onefile-windows-splash-screen-image: 301 | description: | 302 | When compiling for Windows and onefile, show this while loading the application. Defaults to off. 303 | windows-uac-admin: 304 | description: | 305 | Request Windows User Control, to grant admin rights on execution. (Windows only). Defaults to off. 306 | windows-uac-uiaccess: 307 | description: | 308 | Request Windows User Control, to enforce running from a few folders only, remote 309 | desktop access. (Windows only). Defaults to off. 310 | 311 | ### macOS specific controls: ### 312 | macos-target-arch: 313 | description: | 314 | What architectures is this to supposed to run on. Default and limit 315 | is what the running Python allows for. Default is "native" which is 316 | the architecture the Python is run with. 317 | macos-app-icon: 318 | description: | 319 | Add icon for the application bundle to use. Can be given only one time. Defaults to Python icon if available. 320 | macos-signed-app-name: 321 | description: | 322 | Name of the application to use for macOS signing. Follow "com.YourCompany.AppName" 323 | naming results for best results, as these have to be globally unique, and will 324 | potentially grant protected API accesses. 325 | macos-app-name: 326 | description: | 327 | Name of the product to use in macOS bundle information. Defaults to base 328 | filename of the binary. 329 | macos-app-mode: 330 | description: | 331 | Mode of application for the application bundle. When launching a Window, and appearing 332 | in the dock is desired, default value "gui" is a good fit. Without a Window ever, the 333 | application is a "background" application. For UI elements that get to display later, 334 | "ui-element" is in-between. The application will not appear in the dock, but get full 335 | access to desktop when it does open a Window later. 336 | macos-prohibit-multiple-instances: 337 | description: | 338 | For application bundles, set the flag "LSMultipleInstancesProhibited" to prevent 339 | launching multiple instances of the application. Default is off. 340 | macos-sign-identity: 341 | description: | 342 | When signing on macOS, by default an ad-hoc identify will be used, but with this 343 | option your get to specify another identity to use. The signing of code is now 344 | mandatory on macOS and cannot be disabled. Use "auto" to detect your only identity 345 | installed. Default "ad-hoc" if not given. 346 | macos-sign-notarization: 347 | description: | 348 | When signing for notarization, using a proper TeamID identity from Apple, use 349 | the required runtime signing option, such that it can be accepted. 350 | macos-app-version: 351 | description: | 352 | Product version to use in macOS bundle information. Defaults to "1.0" if 353 | not given. 354 | macos-app-protected-resource: 355 | description: | 356 | Request an entitlement for access to a macOS protected resources, e.g. 357 | "NSMicrophoneUsageDescription:Microphone access for recording audio." 358 | requests access to the microphone and provides an informative text for 359 | the user, why that is needed. Before the colon, is an OS identifier for 360 | an access right, then the informative text. Legal values can be found on 361 | https://developer.apple.com/documentation/bundleresources/information_property_list/protected_resources 362 | and the option can be specified multiple times. Default empty. 363 | macos-sign-keyring-filename: 364 | description: | 365 | Path to the certificate file to be used for macOS code signing. 366 | This is used in conjunction with '--macos-sign-identity'. Default empty. 367 | macos-sign-keyring-password: 368 | description: | 369 | Password for the certificate file provided via 370 | '--macos-sign-keyring-filename'. Default empty. 371 | 372 | ### Linux specific controls: ### 373 | linux-icon: 374 | description: | 375 | Add executable icon for onefile binary to use. Can be given only one time. Defaults to Python icon if available. 376 | 377 | 378 | ### Backend C compiler choices. ### 379 | clang: 380 | description: | 381 | Enforce the use of clang. On Windows this requires a working Visual 382 | Studio version to piggy back on. Defaults to off. 383 | mingw64: 384 | description: | 385 | Enforce the use of MinGW64 on Windows. Defaults to off unless MSYS2 with MinGW Python is used. 386 | msvc: 387 | description: | 388 | Enforce the use of specific MSVC version on Windows. Allowed values 389 | are e.g. "14.3" (MSVC 2022) and other MSVC version numbers, specify 390 | "list" for a list of installed compilers, or use "latest". 391 | 392 | Defaults to latest MSVC being used if installed, otherwise MinGW64 393 | is used. 394 | jobs: 395 | description: | 396 | Specify the allowed number of parallel C compiler jobs. Negative values 397 | are system CPU minus the given value. Defaults to the full system CPU 398 | count unless low memory mode is activated, then it defaults to 1. 399 | lto: 400 | description: | 401 | Use link time optimizations (MSVC, gcc, clang). Allowed values are 402 | "yes", "no", and "auto" (when it's known to work). Defaults to 403 | "auto". 404 | static-libpython: 405 | description: | 406 | Use static link library of Python. Allowed values are "yes", "no", 407 | and "auto" (when it's known to work). Defaults to "auto". 408 | cf-protection: 409 | description: | 410 | This option is gcc specific. For the gcc compiler, select the 411 | "cf-protection" mode. Default "auto" is to use the gcc default 412 | value, but you can override it, e.g. to disable it with "none" 413 | value. Refer to gcc documentation for "-fcf-protection" for the 414 | details. 415 | 416 | ### Debug features. ### 417 | debug: 418 | description: | 419 | Executing all self checks possible to find errors in Nuitka, do not use for 420 | production. Defaults to off. 421 | no-debug-immortal-assumptions: 422 | description: | 423 | Disable check normally done with "--debug". With Python3.12+ do not check known 424 | immortal object assumptions. Some C libraries corrupt them. Defaults to check 425 | being made if "--debug" is on. 426 | no-debug-c-warnings: 427 | description: | 428 | Disable check normally done with "--debug". The C compilation may produce 429 | warnings, which it often does for some packages without these being issues, 430 | esp. for unused values. 431 | unstripped: 432 | description: | 433 | Keep debug info in the resulting object file for better debugger interaction. 434 | Defaults to off. 435 | trace-execution: 436 | description: | 437 | Traced execution output, output the line of code before executing it. 438 | Defaults to off. 439 | xml: 440 | description: | 441 | Write the internal program structure, result of optimization in XML form to given filename. 442 | experimental: 443 | description: | 444 | Use features declared as 'experimental'. May have no effect if no experimental 445 | features are present in the code. Uses secret tags (check source) per 446 | experimented feature. 447 | low-memory: 448 | description: | 449 | Attempt to use less memory, by forking less C compilation jobs and using 450 | options that use less memory. For use on embedded machines. Use this in 451 | case of out of memory problems. Defaults to off. 452 | 453 | ### Plugin options of 'anti-bloat' (categories: core) ### 454 | noinclude-setuptools-mode: 455 | description: | 456 | What to do if a 'setuptools' or import is encountered. This package can be big with 457 | dependencies, and should definitely be avoided. Also handles 'setuptools_scm'. 458 | noinclude-pytest-mode: 459 | description: | 460 | What to do if a 'pytest' import is encountered. This package can be big with 461 | dependencies, and should definitely be avoided. Also handles 'nose' imports. 462 | noinclude-unittest-mode: 463 | description: | 464 | What to do if a unittest import is encountered. This package can be big with 465 | dependencies, and should definitely be avoided. 466 | noinclude-pydoc-mode: 467 | description: | 468 | What to do if a pydoc import is encountered. This package use is mark of useless 469 | code for deployments and should be avoided. 470 | noinclude-IPython-mode: 471 | description: | 472 | What to do if a IPython import is encountered. This package can be big with 473 | dependencies, and should definitely be avoided. 474 | noinclude-dask-mode: 475 | description: | 476 | What to do if a 'dask' import is encountered. This package can be big with 477 | dependencies, and should definitely be avoided. 478 | noinclude-numba-mode: 479 | description: | 480 | What to do if a 'numba' import is encountered. This package can be big with 481 | dependencies, and is currently not working for standalone. This package is 482 | big with dependencies, and should definitely be avoided. 483 | noinclude-default-mode: 484 | description: | 485 | This actually provides the default "warning" value for above options, and 486 | can be used to turn all of these on. 487 | noinclude-custom-mode: 488 | description: | 489 | What to do if a specific import is encountered. Format is module name, 490 | which can and should be a top level package and then one choice, "error", 491 | "warning", "nofollow", e.g. PyQt5:error. 492 | 493 | ### Plugin options of 'dill-compat' (categories: package-support) ### 494 | include-pickle-support-module: 495 | description: | 496 | Include support for these modules to pickle nested compiled functions. You 497 | can use "all" which is the default, but esp. in module mode, just might 498 | want to limit yourself to not create unnecessary run-time usages. For 499 | standalone mode, you can leave it at the default, at it will detect 500 | the usage. 501 | 502 | ### Plugin options of 'pmw-freezer' (categories: package-support) ### 503 | include-pmw-blt: 504 | description: | 505 | Should 'Pmw.Blt' not be included, Default is to include it. 506 | include-pmw-color: 507 | description: | 508 | Should 'Pmw.Color' not be included, Default is to include it. 509 | 510 | ### Plugin options of 'tk-inter' (categories: package-support) ### 511 | tk-library-dir: 512 | description: | 513 | The Tk library dir. Nuitka is supposed to automatically detect it, but you can 514 | override it here. Default is automatic detection. 515 | tcl-library-dir: 516 | description: | 517 | The Tcl library dir. See comments for Tk library dir. 518 | 519 | ### Plugin options of 'pyside6' (same for 'pyside2', 'pyqt6', 'pyqt5' plugins) (categories: package-support, qt-binding) ### 520 | include-qt-plugins: 521 | description: | 522 | Which Qt plugins to include. These can be big with dependencies, so 523 | by default only the "sensible" ones are included, but you can also put 524 | "all" or list them individually. If you specify something that does 525 | not exist, a list of all available will be given. 526 | noinclude-qt-plugins: 527 | description: | 528 | Which Qt plugins to not include. This removes things, so you can 529 | ask to include "all" and selectively remove from there, or even 530 | from the default sensible list. 531 | noinclude-qt-translations: 532 | description: | 533 | Include Qt translations with QtWebEngine if used. These can be a lot 534 | of files that you may not want to be included. 535 | 536 | ### Plugin options of 'upx' (categories: integration) ### 537 | upx-binary: 538 | description: | 539 | The UPX binary to use or the directory it lives in, by default `upx` from PATH is used. 540 | upx-disable-cache: 541 | description: | 542 | Do not cache UPX compression result, by default DLLs are cached, exe files are not. 543 | 544 | ### Plugin options of 'anti-debugger' (categories: commercial, protection) ### 545 | anti-debugger-debugging: 546 | description: | 547 | Enables debug outputs for the debugger plugin, so that it e.g. says 548 | why it rejects something. 549 | 550 | ### Plugin options of 'automatic-updates' (categories: commercial, feature) ### 551 | auto-update-url-spec: 552 | description: | 553 | URL to check for automatic updates. Default empty, i.e. not updates. 554 | auto-update-debug: 555 | description: | 556 | Debug automatic updates at runtime printing messages. Default False. 557 | 558 | ### Plugin options of 'data-hiding' (categories: commercial, protection) ### 559 | data-hiding-salt-value: 560 | description: | 561 | Salt value to make encryption result unique. 562 | 563 | ### Plugin options of 'datafile-inclusion-ng' (categories: commercial, protection) ### 564 | embed-data-files-compile-time-pattern: 565 | description: | 566 | Pattern of data files to embed for use during compile time. These should 567 | match target filenames. 568 | embed-data-files-run-time-pattern: 569 | description: | 570 | Pattern of data files to embed for use during run time. These should 571 | match target filenames. 572 | embed-data-files-qt-resource-pattern: 573 | description: | 574 | Pattern of data files to embed for use with Qt at run time. These should 575 | match target filenames. 576 | embed-debug-qt-resources: 577 | description: | 578 | For debugging purposes, print out information for Qt resources not found. 579 | 580 | ### Plugin options of 'signing' (categories: commercial, integration) ### 581 | windows-signing-tool: 582 | description: | 583 | The 'signtool' executable. You may make this a wrapper script should you want very 584 | specific options, by default `signtool` from PATH or used MSVC used is used. 585 | windows-certificate-name: 586 | description: | 587 | Name of the certificate to use. This will be used to sign the binary. 588 | windows-certificate-sha1: 589 | description: | 590 | Checksum of the certificate to use. This will be used to sign the binary. 591 | windows-certificate-filename: 592 | description: | 593 | Filename of the certificate, typically a ".pfx" file. This will be used to sign 594 | the binary. 595 | windows-certificate-password: 596 | description: | 597 | Password of the certificate filename used. Defaults to empty, must be 598 | provided to successfully sign if certificate the file has one. 599 | windows-signed-content-comment: 600 | description: | 601 | Comment to be used for the signed comments. Optional, defaults to not given. 602 | 603 | ### Plugin options of 'traceback-encryption' (categories: commercial, protection) ### 604 | encryption-key: 605 | description: | 606 | The encryption key to use. 607 | encrypt-stdout: 608 | description: | 609 | Apply encryption to standard output. 610 | encrypt-stderr: 611 | description: | 612 | Apply encryption to standard error. 613 | encrypt-debug-init: 614 | description: | 615 | In case the encryption fails to install, do not abort, but run normally and trace error unencrypted. 616 | encrypt-crypto-package: 617 | description: | 618 | These are two very similar packages that can both do the encryption, and 619 | to avoid duplication in case one of your packages requires the other, 620 | you get to select which one to use by the plugin code. By default 621 | "pycryptodomex" is used and only legacy code uses that. However it 622 | will fallback to "pycryptodome" if that's the only one installed, 623 | and you can enforce Nuitka choice if both are for some reason. 624 | 625 | ### Plugin options of 'windows-service' (categories: commercial, feature) ### 626 | windows-service-name: 627 | description: | 628 | The Windows service name. 629 | windows-service-grace-time: 630 | description: | 631 | For shutdown, wait this extra time before killing. Unit is ms, and default is 2000, 632 | i.e. it waits 2 seconds to allow cleanup. Increase if you need more time, decrease 633 | if you want faster service shutdown. 634 | windows-service-start-mode: 635 | description: | 636 | Pick the service start mode, value "auto" starts automatically at 637 | reboot without login, "demand" (default) must be started manually, 638 | and "disabled" cannot be started, requires further action to 639 | change it. 640 | windows-service-cli: 641 | description: | 642 | Should the program allow to be ran from the command line. By default 643 | it does not and only outputs a message it is disallowed. 644 | 645 | 646 | ### Action controls ### 647 | disable-cache: 648 | description: "Disables caching of compiled binaries. Defaults to false." 649 | 650 | caching-key: 651 | description: "An optional string to make the Nuitka build cache key more specific. This can be used for manual cache invalidation or to segment caches based on custom criteria. This key itself is not passed to Nuitka." 652 | required: false 653 | default: "caching" 654 | 655 | 656 | runs: 657 | using: "composite" 658 | steps: 659 | - name: Setup Environment Variables 660 | if: ${{ !inputs.disable-cache }} 661 | shell: bash 662 | run: | 663 | echo "NUITKA_CACHE_DIR=${{ github.action_path }}/nuitka/cache" >> $GITHUB_ENV 664 | echo "PYTHON_VERSION=$(python --version | awk '{print $2}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV 665 | - name: Install Dependencies 666 | shell: bash 667 | run: | 668 | pip install -r "${{ github.action_path }}/requirements.txt" 669 | 670 | # With commercial access token, use that repository. 671 | if [ "${{ inputs.access-token }}" != "" ]; then 672 | repo_url="git+https://${{ inputs.access-token }}@github.com/Nuitka/Nuitka-commercial.git" 673 | else 674 | repo_url="git+https://$@github.com/Nuitka/Nuitka.git" 675 | fi 676 | 677 | pip install "${repo_url}/@${{ inputs.nuitka-version }}#egg=nuitka" 678 | - name: Install ccache 679 | # TODO: Proper "in" test could make sense here. 680 | if: ${{ inputs.disable-cache != 'ccache' && runner.os == 'Linux' }} 681 | shell: bash 682 | run: | 683 | sudo apt-get install -y ccache 684 | - name: Cache Nuitka cache directory 685 | if: ${{ !inputs.disable-cache }} 686 | uses: actions/cache@v4 687 | with: 688 | path: ${{ env.NUITKA_CACHE_DIR }} 689 | key: nuitka-${{ inputs.caching-key }}-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}-nuitka-${{ github.sha }} 690 | restore-keys: | 691 | nuitka-${{ inputs.caching-key }}-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}- 692 | nuitka-${{ runner.os }}-${{ runner.arch }}-python-${{ env.PYTHON_VERSION }}- 693 | nuitka-${{ runner.os }}-${{ runner.arch }}- 694 | 695 | - name: Build with Nuitka 696 | shell: bash 697 | env: 698 | PYTHONUTF8: 1 699 | run: | 700 | set -e 701 | 702 | # Prepare the JSON string for Nuitka, filtering out action-specific keys using Python 703 | NUITKA_WORKFLOW_INPUTS=$(echo '${{ toJson(inputs) }}' | python -c "import sys, json; data = json.load(sys.stdin); [data.pop(k, None) for k in ['nuitka-version', 'working-directory', 'access-token', 'disable-cache', 'caching-key']]; json.dump(data, sys.stdout, ensure_ascii=False)") 704 | 705 | # Pass the filtered JSON to Nuitka via an environment variable 706 | export NUITKA_WORKFLOW_INPUTS 707 | python -m nuitka --github-workflow-options 708 | working-directory: ${{ inputs.working-directory }} 709 | --------------------------------------------------------------------------------