|
7 | 7 | </div> |
8 | 8 |
|
9 | 9 | > [!WARNING] |
10 | | -> DO NOT use suap as a tool for building and installing cloudy-org applications, that is not the intent of the tool. For application setup / installation check the application's own instructions via it's `README.md` file. |
| 10 | +> **USER NOTICE:** DO NOT use suap as a tool for building or installing cloudy-org applications, that is not the intent of the tool. |
| 11 | +> For application setup / installation check the application's own instructions in it's `README.md` file. |
11 | 12 |
|
12 | | -> [!NOTE] |
13 | | -> As the main usage of suap is in CI, we only target supporting Python **3.13**. |
14 | | -> Also currently the tool is Linux only, that may or may not change. |
| 13 | +### Prerequisites: |
| 14 | +- **[NSIS](https://nsis.sourceforge.io/Main_Page)** (for packaging windows installers) |
| 15 | +- **[Rust](https://www.rust-lang.org/tools/install)** and **Cargo** (for packaging cargo projects). |
| 16 | + - **[x86_64-pc-windows-gnu](https://doc.rust-lang.org/nightly/rustc/platform-support/windows-gnu.html)** (for building windows binaries) |
15 | 17 |
|
16 | | -*Readme Work In Progress...* |
| 18 | +## Packaging Usage |
| 19 | + |
| 20 | +### GitHub Workflow (CI) |
| 21 | +```yml |
| 22 | +# .github/workflows/suap.yml |
| 23 | + |
| 24 | +name: Suap Package & Publish Binaries on Release Tag |
| 25 | + |
| 26 | +# ... WIP, help wanted! |
| 27 | +``` |
| 28 | + |
| 29 | +> [!WARNING] |
| 30 | +> Suap is not really designed for usage in a development environment but |
| 31 | +> rather in CI. You would only really want to use it during development for testing. |
| 32 | +> |
| 33 | +> Suap targets Python **3.13** support and currently only supports **Linux** (this may or may not change). |
| 34 | +
|
| 35 | +### Pip Install |
| 36 | +```sh |
| 37 | +python -m venv .venv |
| 38 | +source .venv/bin/activate |
| 39 | + |
| 40 | +pip install git+https://github.com/cloudy-org/suap@v0.1.0-alpha.1 |
| 41 | + |
| 42 | +suap --help |
| 43 | +``` |
| 44 | + |
| 45 | +### UV Install |
| 46 | +```sh |
| 47 | +uv tool install --from git+https://github.com/cloudy-org/suap@v0.1.0-alpha.1 suap |
| 48 | + |
| 49 | +uvx suap --help |
| 50 | +``` |
| 51 | + |
| 52 | +Now that the tool is installed in your environment, make sure you're inside your cloudy-org applications's directory with `suap.toml` at it's root. |
| 53 | + |
| 54 | +If you don't have a `suap.toml` file, create one from the example **[here](./examples/suap.toml)**. |
| 55 | + |
| 56 | +From here on you can query the help command for various actions you can perform other than packaging. |
| 57 | + |
| 58 | +```sh |
| 59 | +suap --help |
| 60 | +``` |
| 61 | + |
| 62 | +### Packaging |
| 63 | +```sh |
| 64 | +suap package --project cargo --platform-format windows |
| 65 | +``` |
| 66 | + |
| 67 | +#### Project |
| 68 | +In the future a suap project may have multiple types of projects under it so you must specify which type you're packaging via `--project` <sub>(at least for now)</sub>. |
| 69 | + |
| 70 | +#### Platform format |
| 71 | +At this moment there are 3 platform formats you can package to: |
| 72 | + |
| 73 | +- `linux-bin` ([standalone binary][uploading-bins-covention]) |
| 74 | +- `windows-bin` ([standalone binary][uploading-bins-covention]) |
| 75 | +- `windows-setup` ([windows installer][uploading-bins-covention]) |
| 76 | + |
| 77 | +```sh |
| 78 | +--platform-format {platform}-{format} |
| 79 | +``` |
| 80 | + |
| 81 | +The `windows` platform format key is an umbrella key to build and package both formats `windows-bin` and `windows-setup`, the same way the `linux` key contains `linux-bin`. |
| 82 | + |
| 83 | +Use the specific key (e.g: `linux-bin`) if you would like to target packaging just that format and not any other format under that platform. |
| 84 | + |
| 85 | +#### Icons |
| 86 | +In the `suap.toml` config we set the icons folder (`icons = "./assets/icons"`). We must populate that with icons for the application (be it placeholders or real official icons for prod): |
| 87 | + |
| 88 | +```toml |
| 89 | +# The icons folder is where you'll place your icons. |
| 90 | +# |
| 91 | +# The name of the image files must be specific like so: |
| 92 | +# "windows.ico" - windows specific app icon |
| 93 | +# "original.png" - when there's no platform specific icon suap falls back to this |
| 94 | +icons = "./assets/icons" |
| 95 | +``` |
| 96 | + |
| 97 | +Here's an example: |
| 98 | + |
| 99 | +<img width="400px" src="./assets/icons_example.png"> |
| 100 | + |
| 101 | +#### Output |
| 102 | +And here's me using suap to package windows binaries for roseate with the command from earlier: |
| 103 | + |
| 104 | +<img width="600px" src="./assets/showcase_cli.png"> |
| 105 | + |
| 106 | +The `./dist` folder: |
| 107 | + |
| 108 | +<img width="400px" src="./assets/showcase_output.png"> |
| 109 | + |
| 110 | +<br> |
| 111 | + |
| 112 | +*Readme Work In Progress...* |
| 113 | + |
| 114 | + |
| 115 | +[uploading-bins-covention]: https://github.com/cloudy-org/.github/blob/main/convention/releases.md#the-convention-of-uploading-binaries |
0 commit comments