forked from morytyann/gh-action-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:gretel/reticulum-openwrt
- Loading branch information
Showing
5 changed files
with
424 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Build RNS Packages for OpenWrt | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+*" | ||
pull_request: | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
packages: write # needed for cache operations | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
env: | ||
V: '' | ||
PRIVATE_KEY: ${{ secrets.SIGNING_KEY }} | ||
EXTRA_FEEDS: >- | ||
src-git|reticulum|https://github.com/gretel/feed-reticulum.git | ||
PACKAGES: | | ||
rns lxmf | ||
jobs: | ||
build: | ||
name: ${{ matrix.arch }}-${{ matrix.release }} | ||
runs-on: ubuntu-latest | ||
environment: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || 'development' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
release: | ||
- master | ||
arch: | ||
- aarch64_cortex-a53 # Modern 64-bit ARM (MT7981, newer RPis) | ||
- arm_arm1176jzf-s_vfp # RPi Zero 1 | ||
- mips_24kc # Common in budget routers | ||
- x86_64 # Generic "PC" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Setup Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
# with: | ||
# buildkitd-flags: --debug | ||
|
||
- name: Build SDK container | ||
uses: docker/build-push-action@v6 | ||
env: | ||
DOCKER_BUILD_SUMMARY: false | ||
with: | ||
tags: sdk | ||
context: . | ||
push: false | ||
load: true | ||
build-args: | | ||
CONTAINER=ghcr.io/openwrt/sdk | ||
ARCH=${{ matrix.arch }}-${{ matrix.release }} | ||
cache-from: | | ||
type=gha,scope=${{ matrix.arch }}-${{ matrix.release }} | ||
cache-to: | | ||
type=gha,mode=max,scope=${{ matrix.arch }}-${{ matrix.release }} | ||
- name: Prepare artifacts directory | ||
run: | | ||
mkdir -p artifacts feed | ||
sudo chown -R 1000:1000 artifacts feed | ||
shell: bash | ||
|
||
- name: Build packages | ||
run: | | ||
docker run --rm \ | ||
--env EXTRA_FEEDS \ | ||
--env IGNORE_ERRORS \ | ||
--env INDEX \ | ||
--env KEY_BUILD \ | ||
--env NO_DEFAULT_FEEDS \ | ||
--env PACKAGES \ | ||
--env PRIVATE_KEY \ | ||
--env V \ | ||
-v ${{ github.workspace }}/feed:/feed \ | ||
-v ${{ github.workspace }}/artifacts:/artifacts \ | ||
sdk | ||
- name: Debug output locations | ||
if: always() | ||
run: | | ||
find ${{ github.workspace }}/artifacts/bin | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.arch }}-${{ matrix.release }}-packages | ||
path: artifacts/bin/**/*.*pk | ||
retention-days: 7 | ||
compression-level: 0 | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
artifacts/bin/**/rns*.*pk | ||
artifacts/bin/**/lxmf*.*pk | ||
draft: true | ||
generate_release_notes: true | ||
prerelease: ${{ contains(github.ref, '-') }} | ||
fail_on_unmatched_files: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ARG CONTAINER=ghcr.io/openwrt/sdk | ||
ARG ARCH=x86_64 | ||
|
||
FROM ${CONTAINER}:${ARCH} | ||
|
||
LABEL "com.github.actions.name"="OpenWrt Packager" | ||
LABEL "repository"="https://github.com/gretel/openwrt-packager" | ||
LABEL "maintainer"="gretel" | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
# OpenWrt Reticulum Package Builder 📡 | ||
|
||
GitHub workflow for cross-compiling [Reticulum Network Stack (RNS)](https://github.com/markqvist/Reticulum) packages for OpenWrt. Based on [openwrt/gh-action-sdk](https://github.com/openwrt/gh-action-sdk). | ||
|
||
> **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! | ||
## Overview 📖 | ||
|
||
This repository provides GitHub Actions workflows for building OpenWrt packages defined in the [feed-reticulum](https://github.com/gretel/feed-reticulum) repository. While the feed contains the package definitions (Makefiles, patches, and configurations), this workflow handles the automated cross-compilation process. | ||
|
||
### Repository Relationship | ||
- **feed-reticulum**: Contains OpenWrt package definitions for RNS | ||
- **This repository**: Provides automation to build those packages for different architectures | ||
|
||
## Features ✨ | ||
|
||
- Cross-compiles RNS packages for OpenWrt targets | ||
- Uses official OpenWrt SDK containers | ||
- Build artifact collection and release management | ||
- Package signing support | ||
|
||
## How it Works 🔄 | ||
|
||
1. The workflow fetches the official OpenWrt SDK container for each target architecture | ||
2. It adds our custom feed (`feed-reticulum`) to the SDK | ||
3. The packages (`rns` and `lxmf`) are then built using the SDK | ||
4. Built packages are collected and published as artifacts | ||
|
||
## Supported Platforms 🎯 | ||
|
||
This workflow builds `rns` and `lxmf` packages for: | ||
|
||
| Architecture | Example Devices | | ||
|--------------|----------------| | ||
| `aarch64_cortex-a53` | GL.iNet MT3000 (Beryl AX), Raspberry Pi 4/Zero 2, MediaTek MT7981/MT7622 | | ||
| `arm_arm1176jzf-s_vfp` | Raspberry Pi Zero (1st gen) | | ||
| `mips_24kc` | GL.iNet AR750S (Slate), GL.iNet AR300M, Most Atheros AR71xx/AR72xx/AR93xx | | ||
| `x86_64` | Generic x86_64 devices, Virtual Machines | | ||
|
||
## Usage 🚀 | ||
|
||
Create a workflow file (e.g. `.github/workflows/build.yml`): | ||
|
||
```yaml | ||
name: Build OpenWrt Packages | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: ["[0-9]+.[0-9]+.[0-9]+*"] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
PACKAGES: rns lxmf | ||
EXTRA_FEEDS: >- | ||
src-git|reticulum|https://github.com/gretel/feed-reticulum.git | ||
jobs: | ||
build: | ||
# ... rest of workflow configuration | ||
``` | ||
|
||
## Configuration ⚙️ | ||
|
||
### Environment Variables | ||
|
||
| Variable | Description | Default | | ||
|----------|-------------|---------| | ||
| `PACKAGES` | Space-separated list (`rns lxmf`) | Required | | ||
| `EXTRA_FEEDS` | Feed URL (`src-git\|reticulum\|url`) | Required | | ||
| `V` | Build verbosity ('', 's', 'sc') | '' | | ||
| `PRIVATE_KEY` | Package signing key | Repository Secret | | ||
| `INDEX` | Generate package index (0/1) | 0 | | ||
|
||
## Artifacts 📦 | ||
|
||
The workflow produces: | ||
- Built packages (`.ipk` format) | ||
- Build logs (if enabled) | ||
- Package index (if enabled) | ||
|
||
All artifacts are: | ||
- Collected from `/artifacts` directory | ||
- Uploaded to GitHub Actions artifacts | ||
- Published to GitHub Releases for tagged commits | ||
|
||
## Requirements 📋 | ||
|
||
- GitHub Actions runner with Docker support | ||
- OpenWrt-compatible package source code | ||
- Valid package Makefiles in feed | ||
- Package signing key (optional) | ||
|
||
## Development Setup 🛠️ | ||
|
||
For local development and testing, refer to the [feed-reticulum](https://github.com/gretel/feed-reticulum) repository, which contains detailed instructions for: | ||
- Setting up the OpenWrt build environment | ||
- Installing required dependencies | ||
- Building packages locally | ||
- Configuration and usage guides | ||
|
||
## Credits 🙏 | ||
|
||
- Mark Qvist - Creator of [Reticulum Network Stack](https://github.com/markqvist/Reticulum) | ||
- OpenWrt team - [SDK action](https://github.com/openwrt/gh-action-sdk) | ||
|
||
## License ⚖️ | ||
|
||
MIT |
Oops, something went wrong.