Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit 6c03392

Browse files
committed
initial fork
1 parent 9f25772 commit 6c03392

6 files changed

Lines changed: 351 additions & 325 deletions

File tree

.github/workflows/package.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Build RNS Packages for OpenWrt
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- "[0-9]+.[0-9]+.[0-9]+*"
9+
pull_request:
10+
branches:
11+
- '*'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
packages: write # needed for cache operations
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: false
21+
22+
env:
23+
V: ''
24+
PRIVATE_KEY: ${{ secrets.SIGNING_KEY }}
25+
EXTRA_FEEDS: >-
26+
src-git|reticulum|https://github.com/gretel/feed-reticulum.git
27+
PACKAGES: rns lxmf
28+
29+
jobs:
30+
build:
31+
name: ${{ matrix.arch }}-${{ matrix.release }}
32+
runs-on: ubuntu-latest
33+
environment: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || 'development' }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
release:
38+
- master
39+
arch:
40+
- aarch64_cortex-a53 # Modern 64-bit ARM (MT7981, newer RPis)
41+
- arm_arm1176jzf-s_vfp # RPi Zero 1
42+
- mips_24kc # Common in budget routers
43+
- x86_64 # Generic "PC"
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Setup QEMU
49+
uses: docker/setup-qemu-action@v3
50+
51+
- name: Setup Buildx
52+
uses: docker/setup-buildx-action@v3
53+
# with:
54+
# buildkitd-flags: --debug
55+
56+
- name: Build SDK container
57+
uses: docker/build-push-action@v6
58+
env:
59+
DOCKER_BUILD_SUMMARY: false
60+
with:
61+
tags: sdk
62+
context: .
63+
push: false
64+
load: true
65+
build-args: |
66+
CONTAINER=ghcr.io/openwrt/sdk
67+
ARCH=${{ matrix.arch }}-${{ matrix.release }}
68+
cache-from: |
69+
type=gha,scope=${{ matrix.arch }}-${{ matrix.release }}
70+
cache-to: |
71+
type=gha,mode=max,scope=${{ matrix.arch }}-${{ matrix.release }}
72+
73+
- name: Prepare artifacts directory
74+
run: |
75+
mkdir -p artifacts
76+
sudo chown -R 1000:1000 artifacts
77+
shell: bash
78+
79+
- name: Build packages
80+
run: |
81+
docker run --rm \
82+
--env EXTRA_FEEDS \
83+
--env IGNORE_ERRORS \
84+
--env INDEX \
85+
--env KEY_BUILD \
86+
--env NO_DEFAULT_FEEDS \
87+
--env PACKAGES \
88+
--env PRIVATE_KEY \
89+
--env V \
90+
-v ${{ github.workspace }}/artifacts:/artifacts \
91+
sdk
92+
93+
- name: Debug output locations
94+
if: always()
95+
run: |
96+
find ${{ github.workspace }}/artifacts/bin | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
97+
98+
- name: Upload artifacts
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: ${{ matrix.arch }}-${{ matrix.release }}-packages
102+
path: artifacts/bin/**/*.*pk
103+
retention-days: 7
104+
compression-level: 0
105+
106+
- name: Release
107+
uses: softprops/action-gh-release@v2
108+
with:
109+
files: |
110+
artifacts/bin/**/*.*pk
111+
draft: true
112+
generate_release_notes: true
113+
prerelease: ${{ contains(github.ref, '-') }}
114+
fail_on_unmatched_files: true

.github/workflows/test.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
ARG CONTAINER=ghcr.io/openwrt/sdk
2-
ARG ARCH=mips_24kc
3-
FROM $CONTAINER:$ARCH
2+
ARG ARCH=x86_64
43

5-
LABEL "com.github.actions.name"="OpenWrt SDK"
4+
FROM ${CONTAINER}:${ARCH}
65

7-
ADD entrypoint.sh /
6+
LABEL "com.github.actions.name"="OpenWrt Packager"
7+
LABEL "repository"="https://github.com/gretel/openwrt-packager"
8+
LABEL "maintainer"="gretel"
89

9-
ENTRYPOINT ["/entrypoint.sh"]
10+
COPY entrypoint.sh /entrypoint.sh
11+
12+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 82 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,95 @@
1-
# OpenWrt GitHub Action SDK
1+
# OpenWrt Reticulum Package Builder 📡
22

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).
74

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!
96
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`):
1229

1330
```yaml
14-
name: Test Build
31+
name: Build OpenWrt Packages
1532

1633
on:
34+
push:
35+
branches: [ main ]
36+
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
1737
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
2044
2145
jobs:
2246
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
4648
```
4749

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

action.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)