openwrt / gh-action-sdk

GitHub CI action to build packages via SDK
29 stars 47 forks source link

OpenWrt GitHub Action SDK

GitHub CI action to build packages via SDK using official OpenWrt SDK Docker containers. This is primary used to test build OpenWrt repositories but can also be used for downstream projects maintaining their own package repositories.

Example usage

The following YAML code can be used to build all packages of a repository and store created ipk files as artifacts.

name: Test Build

on:
  pull_request:
    branches:
      - main

jobs:
  build:
    name: ${{ matrix.arch }} build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        arch:
          - x86_64
          - mips_24kc

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Build
        uses: openwrt/gh-action-sdk@main
        env:
          ARCH: ${{ matrix.arch }}

      - name: Store packages
        uses: actions/upload-artifact@v2
        with:
          name: ${{ matrix.arch}}-packages
          path: bin/packages/${{ matrix.arch }}/packages/*.ipk

Environmental variables

The action reads a few env variables: