Skip to content

Commit

Permalink
enable build
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-sannikov committed Feb 20, 2024
1 parent 0fa4243 commit a1e5d4e
Showing 1 changed file with 63 additions and 58 deletions.
121 changes: 63 additions & 58 deletions .github/workflows/build-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
echo "pkgarch: ${{ matrix.build_env.pkgarch}}, target:${{ matrix.build_env.target}}, subtarget: ${{ matrix.build_env.subtarget}}"
wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/feeds.buildinfo -O .feeds
wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/feeds.buildinfo -O feeds.conf
./scripts/feeds update
./scripts/feeds install -a
wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/config.buildinfo -O .config
Expand All @@ -68,7 +68,6 @@ jobs:
make defconfig
# will fail, but we need to get vermagic
make target/linux/compile V=s || true
VERMAGIC=`cat ./build_dir/target-*/linux-*/linux-*/.vermagic`
Expand All @@ -90,62 +89,68 @@ jobs:
echo "Final Kernel vermagic:"
cat ./build_dir/target-*/linux-*/linux-*/.vermagic
# - name: Update feeds
# run: |
# # clean if cache restored from different cache key
# rm -rf bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/ || true
# rm -rf bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/ || true

# cp feeds.conf.default feeds.conf
# echo "src-git awgopenwrt https://github.com/yury-sannikov/awg-openwrt.git" >> ./feeds.conf

# ./scripts/feeds update luci
# ./scripts/feeds install -a -p luci
# ./scripts/feeds update awgopenwrt
# ./scripts/feeds install -a -p awgopenwrt

# wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/config.buildinfo -O .config
# echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
# echo "CONFIG_PACKAGE_amneziawg-tools=y" >> .config
# echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
# echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
# echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20=m" >> .config
# echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=m" >> .config
# echo "CONFIG_PACKAGE_kmod-crypto-chacha20poly1305=m" >> .config

# make defconfig

# echo "Final Kernel vermagic:"
# cat ./build_dir/target-*/linux-*/linux-*/.vermagic

# - name: Build amneziawg-tools
# run: |
# make V=s package/amneziawg-tools/{clean,download,prepare}
# make V=s package/amneziawg-tools/compile

# - name: Build kmod-amneziawg
# run: |
# make package/kmod-amneziawg/{clean,download,prepare}
# make package/kmod-amneziawg/compile

# - name: Build luci
# run: |
# make package/luci-app-amneziawg/{clean,download,prepare}
# make package/luci-app-amneziawg/compile V=s

# - name: Prepare artifacts
# run: |
# tag_name=${{ github.ref_name }}
# mkdir -p awgrelease
# postfix="${tag_name}_v${{ matrix.tag }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
# cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/amneziawg-tools_*.ipk awgrelease/amneziawg-tools_${postfix}.ipk
# cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/luci-app-amneziawg_*.ipk awgrelease/luci-app-amneziawg_${postfix}.ipk
# cp bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/kmod-amneziawg_*.ipk awgrelease/kmod-amneziawg_${postfix}.ipk

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# files: awgrelease/*.ipk
- name: Update feeds
run: |
# clean if cache restored from different cache key
rm -rf bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/ || true
rm -rf bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/ || true
wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/feeds.buildinfo -O feeds.conf
echo "src-git awgopenwrt https://github.com/yury-sannikov/awg-openwrt.git" >> ./feeds.conf
./scripts/feeds update luci
./scripts/feeds install -a -p luci
./scripts/feeds update awgopenwrt
./scripts/feeds install -a -p awgopenwrt
wget https://downloads.openwrt.org/releases/${{ matrix.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/config.buildinfo -O .config
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_amneziawg-tools=y" >> .config
echo "CONFIG_PACKAGE_luci-app-amneziawg=y" >> .config
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=m" >> .config
echo "CONFIG_PACKAGE_kmod-crypto-chacha20poly1305=m" >> .config
make defconfig
# validate cached vermagic
VERMAGIC=`cat ./build_dir/target-*/linux-*/linux-*/.vermagic`
VERMAGIC_EXPECTED=${{ matrix.build_env.vermagic }}
if [ "$VERMAGIC" != "$VERMAGIC_EXPECTED" ]; then
echo Vermagic mismatch: $VERMAGIC, expected $VERMAGIC_EXPECTED
exit 1
fi
- name: Build amneziawg-tools
run: |
make V=s package/amneziawg-tools/{clean,download,prepare}
make V=s package/amneziawg-tools/compile
- name: Build kmod-amneziawg
run: |
make package/kmod-amneziawg/{clean,download,prepare}
make package/kmod-amneziawg/compile
- name: Build luci
run: |
make package/luci-app-amneziawg/{clean,download,prepare}
make package/luci-app-amneziawg/compile V=s
- name: Prepare artifacts
run: |
tag_name=${{ github.ref_name }}
mkdir -p awgrelease
postfix="${tag_name}_v${{ matrix.tag }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/amneziawg-tools_*.ipk awgrelease/amneziawg-tools_${postfix}.ipk
cp bin/packages/${{ matrix.build_env.pkgarch }}/awgopenwrt/luci-app-amneziawg_*.ipk awgrelease/luci-app-amneziawg_${postfix}.ipk
cp bin/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/packages/kmod-amneziawg_*.ipk awgrelease/kmod-amneziawg_${postfix}.ipk
- name: Release
uses: softprops/action-gh-release@v1
with:
files: awgrelease/*.ipk

- name: Cleanup
run: |
Expand Down

0 comments on commit a1e5d4e

Please sign in to comment.