|
1 | | -# OpenWrt GitHub Action SDK |
| 1 | +# OpenWrt Reticulum Package Builder 📡 |
2 | 2 |
|
3 | | -GitHub CI action to build packages via SDK using official OpenWrt SDK Docker |
4 | | -containers. This is primary used to test build OpenWrt repositories but can |
5 | | -also be used for downstream projects maintaining their own package |
6 | | -repositories. |
| 3 | +GitHub workflow for cross-compiling Reticulum Network Stack (RNS) packages for OpenWrt. Based on [openwrt/gh-action-sdk](https://github.com/openwrt/gh-action-sdk). |
7 | 4 |
|
8 | | -## Example usage |
| 5 | +> **Note**: This is an experimental project currently under active development. The build process and package structure are still being refined and may change significantly. Not recommended for production use yet! |
9 | 6 |
|
10 | | -The following YAML code can be used to build all packages of a repository and |
11 | | -store created `ipk` files as artifacts. |
| 7 | +## Features ✨ |
| 8 | + |
| 9 | +- Cross-compiles RNS packages for OpenWrt targets |
| 10 | +- Uses official OpenWrt SDK containers |
| 11 | +- Build artifact collection and release management |
| 12 | +- Package signing support |
| 13 | +- GitHub Actions cache integration |
| 14 | + |
| 15 | +## Supported Platforms 🎯 |
| 16 | + |
| 17 | +This workflow builds `rns` and `lxmf` packages for: |
| 18 | + |
| 19 | +| Architecture | Example Devices | |
| 20 | +|--------------|----------------| |
| 21 | +| `aarch64_cortex-a53` | GL.iNet MT3000 (Beryl AX), Raspberry Pi 4/Zero 2, MediaTek MT7981/MT7622 | |
| 22 | +| `arm_arm1176jzf-s_vfp` | Raspberry Pi Zero (1st gen) | |
| 23 | +| `mips_24kc` | GL.iNet AR750S (Slate), GL.iNet AR300M, Most Atheros AR71xx/AR72xx/AR93xx | |
| 24 | +| `x86_64` | Generic x86_64 devices, Virtual Machines | |
| 25 | + |
| 26 | +## Usage 🚀 |
| 27 | + |
| 28 | +Create a workflow file (e.g. `.github/workflows/build.yml`): |
12 | 29 |
|
13 | 30 | ```yaml |
14 | | -name: Test Build |
| 31 | +name: Build OpenWrt Packages |
15 | 32 |
|
16 | 33 | on: |
| 34 | + push: |
| 35 | + branches: [ main ] |
| 36 | + tags: ["[0-9]+.[0-9]+.[0-9]+*"] |
17 | 37 | pull_request: |
18 | | - branches: |
19 | | - - main |
| 38 | + workflow_dispatch: |
| 39 | + |
| 40 | +env: |
| 41 | + PACKAGES: rns lxmf |
| 42 | + EXTRA_FEEDS: >- |
| 43 | + src-git|reticulum|https://github.com/gretel/feed-reticulum.git |
20 | 44 |
|
21 | 45 | jobs: |
22 | 46 | build: |
23 | | - name: ${{ matrix.arch }} build |
24 | | - runs-on: ubuntu-latest |
25 | | - strategy: |
26 | | - matrix: |
27 | | - arch: |
28 | | - - x86_64 |
29 | | - - mips_24kc |
30 | | - |
31 | | - steps: |
32 | | - - uses: actions/checkout@v2 |
33 | | - with: |
34 | | - fetch-depth: 0 |
35 | | - |
36 | | - - name: Build |
37 | | - uses: openwrt/gh-action-sdk@main |
38 | | - env: |
39 | | - ARCH: ${{ matrix.arch }} |
40 | | - |
41 | | - - name: Store packages |
42 | | - uses: actions/upload-artifact@v2 |
43 | | - with: |
44 | | - name: ${{ matrix.arch}}-packages |
45 | | - path: bin/packages/${{ matrix.arch }}/packages/*.ipk |
| 47 | + # ... rest of workflow configuration |
46 | 48 | ``` |
47 | 49 |
|
48 | | -## Environmental variables |
49 | | -
|
50 | | -The action reads a few env variables: |
51 | | -
|
52 | | -* `ARCH` determines the used OpenWrt SDK Docker container. |
53 | | - E.g. `x86_64` or `x86_64-22.03.2`. |
54 | | -* `ARTIFACTS_DIR` determines where built packages and build logs are saved. |
55 | | - Defaults to the default working directory (`GITHUB_WORKSPACE`). |
56 | | -* `BUILD_LOG` stores build logs in `./logs`. |
57 | | -* `CONTAINER` can set other SDK containers than `openwrt/sdk`. |
58 | | -* `EXTRA_FEEDS` are added to the `feeds.conf`, where `|` are replaced by white |
59 | | - spaces. |
60 | | -* `FEED_DIR` used in the created `feeds.conf` for the current repo. Defaults to |
61 | | - the default working directory (`GITHUB_WORKSPACE`). |
62 | | -* `FEEDNAME` used in the created `feeds.conf` for the current repo. Defaults to |
63 | | - `action`. |
64 | | -* `IGNORE_ERRORS` can ignore failing packages builds. |
65 | | -* `INDEX` makes the action build the package index. Default is 0. Set to 1 to enable. |
66 | | -* `KEY_BUILD` can be a private Signify/`usign` key to sign the packages (ipk) feed. |
67 | | -* `PRIVATE_KEY` can be a private key to sign the packages (apk) feed. |
68 | | -* `NO_DEFAULT_FEEDS` disable adding the default SDK feeds |
69 | | -* `NO_REFRESH_CHECK` disable check if patches need a refresh. |
70 | | -* `NO_SHFMT_CHECK` disable check if init files are formated |
71 | | -* `PACKAGES` (Optional) specify the list of packages (space separated) to be built |
72 | | -* `V` changes the build verbosity level. |
| 50 | +## Configuration ⚙️ |
| 51 | + |
| 52 | +### Environment Variables |
| 53 | + |
| 54 | +| Variable | Description | Default | |
| 55 | +|----------|-------------|---------| |
| 56 | +| `PACKAGES` | Space-separated list (`rns lxmf`) | Required | |
| 57 | +| `EXTRA_FEEDS` | Feed URL (`src-git\|reticulum\|url`) | Required | |
| 58 | +| `V` | Build verbosity ('', 's', 'sc') | '' | |
| 59 | +| `PRIVATE_KEY` | Package signing key | - | |
| 60 | +| `INDEX` | Generate package index (0/1) | 0 | |
| 61 | + |
| 62 | +### Build Cache |
| 63 | + |
| 64 | +The workflow uses GitHub Actions cache storage to speed up builds: |
| 65 | +- Cache is scoped per architecture/release |
| 66 | +- Uses max mode for better hit rates |
| 67 | +- Persists between workflow runs |
| 68 | + |
| 69 | +## Artifacts 📦 |
| 70 | + |
| 71 | +The workflow produces: |
| 72 | +- Built packages (`.ipk` format) |
| 73 | +- Build logs (if enabled) |
| 74 | +- Package index (if enabled) |
| 75 | + |
| 76 | +All artifacts are: |
| 77 | +- Collected from `/artifacts` directory |
| 78 | +- Uploaded to GitHub Actions artifacts |
| 79 | +- Published to GitHub Releases for tagged commits |
| 80 | + |
| 81 | +## Requirements 📋 |
| 82 | + |
| 83 | +- GitHub Actions runner with Docker support |
| 84 | +- OpenWrt-compatible package source code |
| 85 | +- Valid package Makefiles in feed |
| 86 | +- Package signing key (optional) |
| 87 | + |
| 88 | +## Credits 🙏 |
| 89 | + |
| 90 | +- Mark Qvist - Creator of [Reticulum Network Stack](https://github.com/markqvist/Reticulum) |
| 91 | +- OpenWrt team - [SDK action](https://github.com/openwrt/gh-action-sdk) |
| 92 | + |
| 93 | +## License ⚖️ |
| 94 | + |
| 95 | +MIT |
0 commit comments