Skip to content

BuildIpk

BuildIpk #3

Workflow file for this run

name: BuildIpk
on:
workflow_dispatch:
inputs:
sdkurl:
required: true
description: Download url for Openwrt sdk file in tar.xz format
astversion:
type: choice
description: Choose Asterisk version - make sure it corresponds with Openwrt version chosen
options:
- $GITHUB_WORKSPACE/openwrt/urlmakefile/current/Ast20
- $GITHUB_WORKSPACE/openwrt/urlmakefile/current/Ast18
- $GITHUB_WORKSPACE/openwrt/urlmakefile/current/ast16
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- uses: KyoriPowered/action-regex-match@v4
id: regex-match
with:
text: ${{ github.event.inputs.sdkurl }}
regex: '^.+openwrt-sdk-([\d]*).*?-([a-z,0-9]*)-.+$'
- name: set env variable
run: echo "ver=$(basename ${{ github.event.inputs.astversion }})" >> $GITHUB_ENV
- name: Generate ipk
run: |
env
echo ${{ steps.regex-match.outputs.group1 }}
sudo apt install -y libncurses5-dev libncursesw5-dev zlib1g-dev gawk gettext libssl-dev xsltproc rsync unzip python
wget -q ${{ github.event.inputs.sdkurl }}
tar -xf $(basename ${{ github.event.inputs.sdkurl }})
mv $(basename ${{ github.event.inputs.sdkurl }} .tar.xz) wrtsdk
echo "src-link cusrepo ${{ github.event.inputs.astversion }}" > wrtsdk/feeds.conf
export pkgdir=${{ github.event.inputs.astversion }}
cd wrtsdk
sed -E '\`luci|routing|freifunk`d' feeds.conf.default >> feeds.conf
./scripts/feeds update -a
./scripts/feeds install asterisk-chan-quectel
sed -z -i 's/default ALL/default n/' Config.in
sed -z -i 's/default ALL/default n/' Config.in
sed -z -i 's/default y/default n/' Config.in
sed -z -i 's/default y/default n/' Config.in
make defconfig
cat $pkgdir/addpkg >> .config
make -j4 V=s
cd ..
mkdir downloads
cp $(find $(pwd)/wrtsdk/bin/ -wholename *cusrepo/*.ipk) downloads/
- name: Upload Artifact GitHub Action
uses: actions/upload-artifact@v4
with:
name: chan-quectel-openwrt${{ steps.regex-match.outputs.group1 }}-${{ steps.regex-match.outputs.group2 }}
path: downloads