# Zed Editor Packager Automated packaging system for [Zed Editor](https://zed.dev/) for Debian/Ubuntu. ## Description This project automatically creates `.deb` packages of Zed Editor from official GitHub releases and publishes them to a Gitea repository. ## Features - **Automatic version detection**: Fetches the latest stable version from GitHub - **DEB package building**: Creates a ready-to-install Debian package - **CI/CD with Gitea Actions**: Automated workflow that: - Checks daily for new versions - Builds the package only if a new version is available - Creates a Gitea release with the package - Publishes the package to the Gitea Debian repository ## Local Usage ### Prerequisites ```bash sudo apt-get install wget curl jq dpkg-dev ``` ### Manual Building ```bash # Build the package make # Or step by step make download # Download the archive make extract # Extract the archive make deb # Create the .deb package # Clean up make clean ``` ### Installation ```bash # Install the locally created package sudo dpkg -i build/zed-editor_*.deb ``` ## Gitea Workflow The [`.gitea/workflows/build-and-release.yml`](.gitea/workflows/build-and-release.yml) workflow runs: - **Automatically**: Every day at 2 AM (cron) - **Manually**: Via the Gitea interface (workflow_dispatch) - **On push**: On every push to the `main` branch ### Required Configuration To publish to the Gitea Debian repository, create a `PACKAGE_PUB_TOKEN` secret: 1. Generate a personal access token on Gitea with package permissions 2. Add it as a secret in the repository settings: `PACKAGE_PUB_TOKEN` ### Workflow Behavior 1. **Version check**: Compares the latest GitHub version with the latest Gitea release 2. **Early exit**: If versions match, the workflow stops immediately 3. **Build**: If a new version is detected, builds the .deb package 4. **Publishing**: - Creates a Gitea release with the version tag - Uploads the .deb file to the release assets - Publishes the package to the Gitea Debian repository ## Package Structure The package installs Zed in the following locations: ``` /opt/zed/ # Main application /opt/zed/bin/zed # Main binary /opt/zed/libexec/zed-editor # Editor binary /opt/zed/lib/ # Shared libraries /usr/bin/zed # Symbolic link /usr/share/applications/zed.desktop # Desktop file /usr/share/icons/hicolor/*/apps/zed.png # Icons ``` ## Installation from Gitea Repository Once the repository is configured: ```bash # Add the repository (adapt according to your Gitea instance) echo "deb https://git.rawleenc.dev/api/packages/YOUR_USERNAME/debian stable main" | sudo tee /etc/apt/sources.list.d/zed-editor.list # Install sudo apt update sudo apt install zed-editor ``` ## Makefile The Makefile supports the following targets: | Target | Description | |------------|---------------------------------------------| | `all` | Build the complete package (default target) | | `download` | Download the archive from GitHub | | `extract` | Extract the archive | | `deb` | Create the .deb package | | `clean` | Clean up temporary files | | `help` | Display help | ## License This project is a packaging tool. Zed Editor itself is subject to its own license. ## Notes - The created packages are **unofficial** - Binaries come directly from official Zed releases - The packaging only adds system integration (desktop files, etc.)