-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (167 loc) Β· 7.9 KB
/
make_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# 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_x86:
runs-on: ubuntu-22.04
outputs:
luci_version: ${{ steps.get_info.outputs.luci_version }}
core_version: ${{ steps.get_info.outputs.core_version }}
pkg_name: ${{ steps.get_info.outputs.PKG_NAME }}
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Dapatkan Versi dan Nama Paket
id: get_info
run: |
echo "luci_version=$(grep 'PKG_VERSION:=' 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
echo "CORE_NAME=ngrok-x86" >> $GITHUB_OUTPUT
- name: Siapkan OpenWrt SDK
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
- name: Perbarui dan pasang feeds
run: |
cd openwrt-sdk
./scripts/feeds update -a
./scripts/feeds install -a
- name: Siapkan Paket
run: |
cd openwrt-sdk
cp -r ${{ github.workspace }}/luci-app-ngrok package/
cp -r ${{ github.workspace }}/ngrok-x86 package/
- name: Build Paket
id: build
run: |
cd openwrt-sdk && 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/${{ steps.get_info.outputs.PKG_NAME }}/compile V=s -j$(nproc) || echo "BUILD_FAILED=true" >> $GITHUB_ENV
make package/${{ steps.get_info.outputs.CORE_NAME }}/compile V=s -j$(nproc) || echo "BUILD_FAILED=true" >> $GITHUB_ENV
if [ "${{ env.BUILD_FAILED }}" != "true" ]; then
mv bin/packages/x86_64/base/${{ steps.get_info.outputs.PKG_NAME }}*.ipk ../${{ steps.get_info.outputs.PKG_NAME }}_${{ steps.get_info.outputs.luci_version }}_beta_all.ipk
mv bin/packages/x86_64/base/ngrok_v3-1_x86_64.ipk bin/packages/x86_64/base/ngrok_${{ steps.get_info.outputs.core_version }}-1_x86_64.ipk
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages
path: |
openwrt-sdk/bin/packages/x86_64/base/ngrok_${{ steps.get_info.outputs.core_version }}-1_x86_64.ipk
luci-app-ngrok_${{ steps.get_info.outputs.luci_version }}_beta_all.ipk
build_arm_core:
runs-on: ubuntu-22.04
needs: build_x86
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Dapatkan Versi Core
id: get_info
run: |
echo "core_version=${{ needs.build_x86.outputs.core_version }}" >> $GITHUB_OUTPUT
echo "CORE_NAME=ngrok-arm" >> $GITHUB_OUTPUT
- name: Siapkan OpenWrt SDK
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/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
- name: Perbarui dan pasang feeds
run: |
cd openwrt-sdk
./scripts/feeds update -a
./scripts/feeds install -a
- name: Siapkan Paket
run: |
cd openwrt-sdk
cp -r ${{ github.workspace }}/ngrok-arm package/
- name: Build Paket
id: build
run: |
cd openwrt-sdk && 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/${{ steps.get_info.outputs.CORE_NAME }}/compile V=s -j$(nproc) || echo "BUILD_FAILED=true" >> $GITHUB_ENV
if [ "${{ env.BUILD_FAILED }}" != "true" ]; then
mv bin/packages/aarch64_generic/base/ngrok_*.ipk bin/packages/aarch64_generic/base/ngrok_${{ steps.get_info.outputs.core_version }}-1_aarch64.ipk
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages-arm
path: openwrt-sdk/bin/packages/aarch64_generic/base/ngrok_${{ steps.get_info.outputs.core_version }}-1_aarch64.ipk
upload_release:
runs-on: ubuntu-22.04
needs: [build_x86, build_arm_core]
steps:
- uses: actions/checkout@v4
- name: Buat Rilis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release_date=$(date +'%y%m%d')
release_name="ngrok-${release_date}"
release_tag="${{ needs.build_x86.outputs.luci_version }}"
release_body="# π Ngrok for OpenWrt
## π¦ Release Version:
- LuCI App: \`${{ needs.build_x86.outputs.luci_version }}\`
- Ngrok Core: \`${{ needs.build_x86.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: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Upload All Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.build_x86.outputs.luci_version }} \
artifacts/packages/luci-app-ngrok_${{ needs.build_x86.outputs.luci_version }}_beta_all.ipk \
artifacts/packages/ngrok_${{ needs.build_x86.outputs.core_version }}-1_x86_64.ipk \
artifacts/packages-arm/ngrok_${{ needs.build_x86.outputs.core_version }}-1_aarch64.ipk