Build IPK #32
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
# This is open source software, licensed under the MIT License. | |
# https://opensource.org/license/mit | |
# | |
# Copyright (C) 2024 BobbyUnknown | |
# | |
# Description: | |
# This software provides a secure tunneling application for OpenWrt. | |
# The application allows users to configure and manage ngrok tunnels | |
# on their OpenWrt router, enabling secure remote access to local | |
# network services through public endpoints. It features a user-friendly | |
# web interface for easy tunnel management and configuration. | |
name: Build IPK | |
on: | |
push: | |
paths: | |
- 'Makefile' | |
workflow_dispatch: | |
jobs: | |
build_all: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Package Info | |
id: get_info | |
run: | | |
echo "luci_version=$(grep 'PKG_VERSION:=' ${{ github.workspace }}/luci-app-ngrok/Makefile | awk -F '=' '{print $2}' | tr -d ' ')" >> $GITHUB_OUTPUT | |
echo "core_version=3.19.1" >> $GITHUB_OUTPUT | |
echo "PKG_NAME=luci-app-ngrok" >> $GITHUB_OUTPUT | |
mkdir -p release_files | |
# Build x86_64 | |
- name: Setup OpenWrt SDK x86 | |
run: | | |
sudo apt update | |
sudo apt install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget tar -y | |
wget https://downloads.openwrt.org/releases/23.05.5/targets/x86/64/openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64.tar.xz | |
tar xJf openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64.tar.xz | |
mv openwrt-sdk-23.05.5-x86-64_gcc-12.3.0_musl.Linux-x86_64 openwrt-sdk-x86 | |
- name: Build x86 Packages | |
run: | | |
cd openwrt-sdk-x86 | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
mkdir -p package/luci-app-ngrok | |
mkdir -p package/ngrok-core | |
cp -r ${{ github.workspace }}/luci-app-ngrok/* package/luci-app-ngrok/ | |
cp -r ${{ github.workspace }}/ngrok-x86/* package/ngrok-core/ | |
make defconfig | |
sed -i 's/CONFIG_LUCI_SRCDIET=y/# CONFIG_LUCI_SRCDIET is not set/' .config | |
sed -i 's/CONFIG_LUCI_JSMIN=y/# CONFIG_LUCI_JSMIN is not set/' .config | |
sed -i 's/CONFIG_LUCI_CSSTIDY=y/# CONFIG_LUCI_CSSTIDY is not set/' .config | |
sed -i 's/# CONFIG_NO_STRIP is not set/CONFIG_NO_STRIP=y/' .config | |
sed -i 's/CONFIG_USE_STRIP=y/# CONFIG_USE_STRIP is not set/' .config | |
sed -i 's/CONFIG_USE_SSTRIP=y/# CONFIG_USE_SSTRIP is not set/' .config | |
make package/luci-app-ngrok/compile V=s -j$(nproc) | |
make package/ngrok-core/compile V=s -j$(nproc) | |
cd bin/packages/x86_64/base/ | |
mv luci-app-ngrok*.ipk ${{ github.workspace }}/release_files/luci-app-ngrok_${{ steps.get_info.outputs.luci_version }}_beta_all.ipk | |
mv ngrok_v3-1_x86_64.ipk ${{ github.workspace }}/release_files/ngrok_${{ steps.get_info.outputs.core_version }}-1_x86_64.ipk | |
# Build ARM64 | |
- name: Setup OpenWrt SDK ARM | |
run: | | |
wget https://downloads.openwrt.org/releases/23.05.5/targets/armsr/armv8/openwrt-sdk-23.05.5-armsr-armv8_gcc-12.3.0_musl.Linux-x86_64.tar.xz | |
tar xJf openwrt-sdk-23.05.5-armsr-armv8_gcc-12.3.0_musl.Linux-x86_64.tar.xz | |
mv openwrt-sdk-23.05.5-armsr-armv8_gcc-12.3.0_musl.Linux-x86_64 openwrt-sdk-arm | |
- name: Build ARM Package | |
run: | | |
cd openwrt-sdk-arm | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
mkdir -p package/ngrok-core | |
cp -r ${{ github.workspace }}/ngrok-arm/* package/ngrok-core/ | |
make defconfig | |
sed -i 's/# CONFIG_NO_STRIP is not set/CONFIG_NO_STRIP=y/' .config | |
sed -i 's/CONFIG_USE_STRIP=y/# CONFIG_USE_STRIP is not set/' .config | |
sed -i 's/CONFIG_USE_SSTRIP=y/# CONFIG_USE_SSTRIP is not set/' .config | |
make package/ngrok-core/compile V=s -j$(nproc) | |
cd bin/packages/aarch64_generic/base/ | |
mv ngrok_v3-1_aarch64.ipk ${{ github.workspace }}/release_files/ngrok_${{ steps.get_info.outputs.core_version }}-1_aarch64.ipk | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
release_date=$(date +'%y%m%d') | |
release_name="ngrok-${release_date}" | |
release_tag="${{ steps.get_info.outputs.luci_version }}" | |
release_body="# π Ngrok for OpenWrt | |
## π¦ Release Version: | |
- LuCI App: \`${{ steps.get_info.outputs.luci_version }}\` | |
- Ngrok Core: \`${{ steps.get_info.outputs.core_version }}\` | |
### π Description | |
This software provides a secure remote access and reverse proxy application for OpenWrt. | |
### π¦ Packages: | |
- ngrok-core: Tunnel service binary (x86_64 & aarch64) | |
- luci-app-ngrok: Web interface for configuration | |
### π Features: | |
- Secure tunnel creation | |
- Multiple tunnel support | |
- TCP/HTTP/HTTPS protocols | |
- Web interface for easy management | |
- Service control (start/stop/restart) | |
### π Requirements: | |
- OpenWrt 23+ | |
- Architecture: x86_64 or aarch64 | |
> π Always ensure you're using the latest version for the best experience! | |
*Thank you for using Ngrok for OpenWrt!* π" | |
gh release create "$release_tag" \ | |
--title "$release_name" \ | |
--notes "$release_body" \ | |
--generate-notes=false | |
- name: Upload Release Files | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ls -la release_files/ | |
gh release upload ${{ steps.get_info.outputs.luci_version }} release_files/* |