Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V3-Linux] Support for deb,rpm,arch linux packager packaging #3909

Merged
merged 12 commits into from
Nov 30, 2024
1 change: 1 addition & 0 deletions mkdocs-website/docs/en/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Support of linux packaging of deb,rpm, and arch linux packager builds by @atterpac in [#3909](https://github.com/wailsapp/wails/3909)
- Added Support for darwin universal builds and packages by [ansxuman](https://github.com/ansxuman) in [#3902](https://github.com/wailsapp/wails/pull/3902)
- Events documentation to the mkdocs webite by [atterpac](https://github.com/atterpac) in [#3867](https://github.com/wailsapp/wails/pull/3867)
- Templates for sveltekit and sveltekit-ts that are set for non-SSR development by [atterpac](https://github.com/atterpac) in [#3829](https://github.com/wailsapp/wails/pull/3829)
Expand Down
38 changes: 37 additions & 1 deletion mkdocs-website/docs/en/getting-started/your-first-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,42 @@ You'll notice that the build time was faster this time. That's because the new b

You should see a new executable in the `build` directory.

## Step 6: Packaging Your Application

Once your application is ready for distribution, you can create platform-specific packages:

=== "Mac"

To create a `.app` bundle:
```bash
wails3 package
```
This will create a production build and package it into a `.app` bundle in the `bin` directory.

=== "Windows"

To create an NSIS installer:
```bash
wails3 package
```
This will create a production build and package it into an NSIS installer in the `bin` directory.

=== "Linux"

Wails supports multiple package formats for Linux distribution:
```bash
# Create all package types (AppImage, deb, rpm, and Arch Linux)
wails3 package

# Or create specific package types
wails3 task linux:create:appimage # AppImage format
wails3 task linux:create:deb # Debian package
wails3 task linux:create:rpm # Red Hat package
wails3 task linux:create:aur # Arch Linux package
```
leaanthony marked this conversation as resolved.
Show resolved Hide resolved

For more detailed information about packaging options and configuration, check out our [Packaging Guide](../learn/guides/packaging.md).

## Conclusion

Congratulations! You've just created and built your first Wails application. This is just the beginning of what you can achieve with Wails v3 Alpha. Explore the documentation, experiment with different features, and start building amazing applications!
Congratulations! You've just created, developed and packaged your first Wails application. This is just the beginning of what you can achieve with Wails v3. Explore the documentation, experiment with different features, and start building amazing applications!
68 changes: 68 additions & 0 deletions mkdocs-website/docs/en/learn/guides/packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Packaging Your Application

This guide explains how to package your Wails application for different platforms.

## Windows

Windows applications are packaged as `.exe` files. Wails automatically handles this during the build process, creating a standalone executable that includes all necessary resources.

## macOS

macOS applications are packaged as `.app` bundles. Wails creates these bundles automatically during the build process, including proper code signing and notarization if configured.

## Linux

Linux applications can be packaged in various formats. Wails v3 uses [nfpm](https://github.com/goreleaser/nfpm), an excellent packaging tool that makes it easy to create `.deb`, `.rpm`, and Arch Linux packages. nfpm is a powerful tool that handles the complexities of Linux packaging, making it easy to create professional-grade packages.

### Package Types

Wails supports creating the following types of Linux packages:
- Debian packages (`.deb`) - for Debian, Ubuntu, and related distributions
- Red Hat packages (`.rpm`) - for Red Hat, Fedora, CentOS, and related distributions
- Arch Linux packages - for Arch Linux and related distributions
- AppImage - a distribution-independent package format

### Building Packages

Wails provides several task commands for building Linux packages. These are defined in `Taskfile.linux.yml` and can be invoked using the `wails3 task` command:

```bash
# Build all package types (AppImage, deb, rpm, and Arch Linux)
wails3 task linux:package

# Build specific package types
wails3 task linux:create:appimage # Create an AppImage
wails3 task linux:create:deb # Create a Debian package
wails3 task linux:create:rpm # Create a Red Hat package
wails3 task linux:create:aur # Create an Arch Linux package
```
leaanthony marked this conversation as resolved.
Show resolved Hide resolved

Each of these tasks will:
1. Build your application in production mode
2. Generate necessary desktop integration files
3. Create the appropriate package using nfpm

### Configuration

The package configuration file should follow the nfpm configuration format and is typically located at `build/nfpm/nfpm.yaml`. Here's an example:

```yaml
name: "myapp"
arch: "amd64"
version: "v1.0.0"
maintainer: "Your Name <your.email@example.com>"
description: |
A short description of your application
vendor: "Your Company"
homepage: "https://yourcompany.com"
license: "MIT"
contents:
- src: ./build/bin/myapp
dst: /usr/bin/myapp
- src: ./assets/icon.png
dst: /usr/share/icons/myapp.png
- src: ./assets/myapp.desktop
dst: /usr/share/applications/myapp.desktop
```
leaanthony marked this conversation as resolved.
Show resolved Hide resolved

For detailed information about all available configuration options, please refer to the [nfpm configuration documentation](https://nfpm.goreleaser.com/configuration/).
3 changes: 2 additions & 1 deletion mkdocs-website/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ nav:
- Guides:
- Customising Windows: learn/guides/customising-windows.md
- File Associations: learn/guides/file-associations.md
- Packaging: learn/guides/packaging.md
- Feedback: getting-started/feedback.md
- Feedback: getting-started/feedback.md
- What's New in v3?: whats-new.md
Expand All @@ -175,4 +176,4 @@ watch:
- overrides
- shared
copyright:
Copyright © 2024 Lea Anthony
Copyright 2024 Lea Anthony
1 change: 1 addition & 0 deletions v3/cmd/wails3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func main() {
tool.NewSubCommandFunction("watcher", "Watches files and runs a command when they change", commands.Watcher)
tool.NewSubCommandFunction("cp", "Copy files", commands.Cp)
tool.NewSubCommandFunction("buildinfo", "Show Build Info", commands.BuildInfo)
tool.NewSubCommandFunction("package", "Generate Linux packages (deb, rpm, archlinux)", commands.ToolPackage)

app.NewSubCommandFunction("version", "Print the version", commands.Version)
app.NewSubCommand("sponsor", "Sponsor the project").Action(openSponsor)
Expand Down
60 changes: 48 additions & 12 deletions v3/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ require (
github.com/atterpac/refresh v0.8.3
github.com/bep/debounce v1.2.1
github.com/ebitengine/purego v0.4.0-alpha.4
github.com/go-git/go-git/v5 v5.11.0
github.com/go-git/go-git/v5 v5.12.0
github.com/go-ole/go-ole v1.2.6
github.com/go-task/task/v3 v3.31.0
github.com/go-task/task/v3 v3.35.1
github.com/godbus/dbus/v5 v5.1.0
github.com/google/go-cmp v0.6.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.3.0
github.com/google/uuid v1.4.0
github.com/jackmordaunt/icns/v2 v2.2.7
github.com/jaypipes/ghw v0.12.0
github.com/leaanthony/clir v1.6.0
Expand Down Expand Up @@ -42,50 +42,86 @@ require (
require (
atomicgo.dev/cursor v0.1.1 // indirect
atomicgo.dev/keyboard v0.2.8 // indirect
dario.cat/mergo v1.0.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/AlekSi/pointer v1.2.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/caarlos0/go-version v0.1.1 // indirect
github.com/cavaliergopher/cpio v1.0.1 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
github.com/containerd/console v1.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/rpmpack v0.6.1-0.20240329070804-c2247cbb881a // indirect
github.com/gookit/color v1.5.2 // indirect
github.com/goreleaser/chglog v0.6.1 // indirect
github.com/goreleaser/fileglob v1.3.0 // indirect
github.com/goreleaser/nfpm/v2 v2.41.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/jsonschema v0.12.0 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/lithammer/fuzzysearch v1.1.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-zglob v0.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/muesli/mango v0.1.0 // indirect
github.com/muesli/mango-cobra v1.2.0 // indirect
github.com/muesli/mango-pflag v0.1.0 // indirect
github.com/muesli/roff v0.1.0 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/radovskyb/watcher v1.0.7 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rjeczalik/notify v0.9.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sajari/fuzzy v1.0.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
golang.org/x/image v0.21.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
Expand All @@ -103,5 +139,5 @@ require (
modernc.org/opt v0.1.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/token v1.0.1 // indirect
mvdan.cc/sh/v3 v3.7.0 // indirect
mvdan.cc/sh/v3 v3.8.0 // indirect
)
Loading
Loading