Skip to content

Cythinst 64

Actions
Customisable GitHub Action to package your python code with PyInstaller for Windows
v1.2
Latest
Star (1)

Cythinst 64

A GitHub Action for building executables with PyInstaller with ability to compile Cython modules.

Overview

Cythinst 64 helps you automate the process of building executables from Python applications using PyInstaller. To build your application, specify the location of your source code using the path argument (default: src). Your source code directory should include a .spec file that PyInstaller generates. If you don't have a .spec file, run PyInstaller locally to generate one. You can also specify a custom .spec file using spec: <YOUR_SPEC_FILE_NAME> if needed.

If your source folder contains a requirements.txt file, any specified packages will be installed into the environment before running PyInstaller. Alternatively, you can specify a different file via the requirements argument.

To use a custom package mirror, you can set the pypi_url and/or pypi_index_url arguments. The default values are:

  • pypi_url = https://pypi.python.org/
  • pypi_index_url = https://pypi.python.org/simple

Note: If you are using the default Python .gitignore file, remember to remove .spec from it.

This action uses Wine to emulate Windows inside Docker, which is needed to package Windows-compatible executables and to compile Cython modules.

Example Usage

Add the following code to your .github/workflows/main.yaml to create a GitHub Actions workflow that:

  1. Packages an application with PyInstaller.
  2. Uploads the packaged executable as an artifact.
yaml
name: Package Application with PyInstaller

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Package Application
        uses: PlohnenSoftware/Cythinst64@main
        with:
          path: src
      - name: Upload Packaged Executable
        uses: actions/upload-artifact@v4
        with:
          name: packaged-artifact
          path: src/dist/windows

FAQ

Why am I seeing OSError: [WinError 123] Invalid name: '/tmp\*'?

Ensure that your path argument is correctly set. The default value is src.

Is this action stable?

This is experimental software. Use it at your own risk; there is no warranty.

Docker Files

To push new images up to Docker Hub for your container (zamkorus/cythinst64:latest):

  1. Login to Docker Hub:

    docker login
  2. Build the Docker Image:

    docker build -f Dockerfile -t zamkorus/cythinst64:latest .
  3. Push the Docker Image to Docker Hub:

    docker push zamkorus/cythinst64:latest

These steps will ensure that your updated image is properly built and pushed to Docker Hub.

External resources used to build this action

Cythinst 64 is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Customisable GitHub Action to package your python code with PyInstaller for Windows
v1.2
Latest

Cythinst 64 is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.