Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Build DEB packages for other architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
RoEdAl committed Jul 25, 2023
2 parents 8aceb11 + 5e1bc97 commit 0be5968
Show file tree
Hide file tree
Showing 12 changed files with 398 additions and 62 deletions.
21 changes: 12 additions & 9 deletions .github/actions/install-openwrt-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
name: Download OpenWRT SDK
description: Download, extract and prepare OpenWRT SDK for specific target (architecture)
description: Download, extract and prepare OpenWRT SDK for specific target
inputs:
openwrt-version:
required: true
description: OpenWRT version
arch:
target:
required: true
description: Target name
description: Target-subtarget pair
arch:
required: false
description: Archtecture name
eabi:
required: false
description: EABI
default: false
runs:
using: composite
steps:
- name: Restore OpenWRT SDK from cache
- name: Restore OpenWRT SDK from cache (${{ inputs.arch }})
id: cache-owrt-sdk-restore
uses: actions/cache/restore@v3
with:
path: owrtsdk
key: openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.arch }}
key: openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.target }}

- name: Prepare OpenWRT SDK directory
id: prepare-owrt-sdk-dir
Expand All @@ -32,25 +35,25 @@ runs:
if: steps.cache-owrt-sdk-restore.outputs.cache-hit != 'true' && inputs.eabi == 'true'
shell: bash
working-directory: owrtsdk
run: ${{ github.action_path }}/download-owrt-sdk.sh ${{ inputs.arch }} ${{ inputs.openwrt-version }} openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.arch }}_gcc-11.2.0_musl_eabi.Linux-x86_64
run: ${{ github.action_path }}/download-owrt-sdk.sh ${{ inputs.target }} ${{ inputs.openwrt-version }} openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.target }}_gcc-11.2.0_musl_eabi.Linux-x86_64

- name: Download OpenWRT SDK
id: download-owrt-sdk
if: steps.cache-owrt-sdk-restore.outputs.cache-hit != 'true' && inputs.eabi != 'true'
shell: bash
working-directory: owrtsdk
run: ${{ github.action_path }}/download-owrt-sdk.sh ${{ inputs.arch }} ${{ inputs.openwrt-version }} openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.arch }}_gcc-11.2.0_musl.Linux-x86_64
run: ${{ github.action_path }}/download-owrt-sdk.sh ${{ inputs.target }} ${{ inputs.openwrt-version }} openwrt-sdk-${{ inputs.openwrt-version }}-${{ inputs.target }}_gcc-11.2.0_musl.Linux-x86_64

- name: Prepare OpenWRT SDK
id: prepare-owrt-sdk
if: steps.cache-owrt-sdk-restore.outputs.cache-hit != 'true'
shell: bash
working-directory: owrtsdk/${{ inputs.arch }}
working-directory: owrtsdk/${{ inputs.target }}
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Cache OpenWRT SDK
- name: Cache OpenWRT SDK (${{ inputs.arch }})
id: cache-owrt-sdk-save
if: steps.cache-owrt-sdk-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
Expand Down
10 changes: 3 additions & 7 deletions .github/actions/install-required-packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ runs:
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: |
git curl wget
bison flex
build-essential pkg-config automake libtool libtool-bin autoconf
libncurses5-dev libssl-dev libxml2-dev libnewt-dev libsqlite3-dev
unixodbc-dev uuid-dev libsystemd-dev
libasound2-dev libogg-dev libvorbis-dev libicu-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp2-dev
libspandsp-dev libedit-dev libjansson-dev libspeexdsp-dev libopus-dev libopusfile-dev
git wget
build-essential
libasound2-dev libsqlite3-dev asterisk-dev
- name: Git configuration
shell: bash
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Cross compile

on:
workflow_dispatch:
push:
branches:
- master
- cross-compile

env:
BUILD_TYPE: Release
UBUNTU_DISTRO: ubuntu22.04

jobs:
build-pkg:
strategy:
matrix:
arch: [armv7, aarch64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: uraimo/run-on-arch-action@v2
name: Build package (${{ matrix.arch }})
with:
arch: ${{ matrix.arch }}
distro: ${{ env.UBUNTU_DISTRO }}
githubToken: ${{ github.token }}
install: |
apt-get update -qq -y
apt-get install -qq -y git cmake \
build-essential \
libsqlite3-dev libasound2-dev asterisk-dev
git config --global --add safe.directory /home/runner/work/asterisk-chan-quectel/asterisk-chan-quectel
env: |
DEBIAN_FRONTEND: noninteractive
run: |
cmake -P make-build-dir.cmake
cmake -P make-package.cmake
- uses: ./.github/actions/install-required-packages
- name: Install lintian
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get install -qq -y lintian
- name: Check package
run: lintian --verbose --info package/asterisk-chan-quectel_*.deb
- name: Archive DEB
uses: actions/upload-artifact@v3
with:
name: pkg-deb-${{ matrix.arch }}
path: |
package/asterisk-chan-quectel_*.deb
package/asterisk-chan-quectel_*.deb.sha256
retention-days: 1
if-no-files-found: error
- name: Archive TAR.GZ
uses: actions/upload-artifact@v3
with:
name: pkg-tar-gz-${{ matrix.arch }}
path: |
package/asterisk-chan-quectel_*.tar.gz
package/asterisk-chan-quectel_*.tar.gz.sha256
retention-days: 1
if-no-files-found: error
- uses: uraimo/run-on-arch-action@v2
name: Try to instal package (${{ matrix.arch }})
with:
arch: ${{ matrix.arch }}
distro: ${{ env.UBUNTU_DISTRO }}
setup: |
mkdir -p "${PWD}/package"
dockerRunArgs: |
--volume "${PWD}/package:/package"
install: |
apt-get update -qq -y
apt-get install -qq -y gdebi-core
env: |
DEBIAN_FRONTEND: noninteractive
run: |
gdebi --non-interactive package/asterisk-chan-quectel_*.deb || echo "::error::Could not install package ${{ matrix.arch }}"
Loading

0 comments on commit 0be5968

Please sign in to comment.