Compare commits
44 Commits
feat/updat
...
feat/build
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08db0f78ed | ||
|
|
1cdb513a00 | ||
|
|
2de5a7406e | ||
|
|
727d873870 | ||
|
|
e538a4cd3b | ||
|
|
2d0ce4148d | ||
|
|
bdcc13cb62 | ||
|
|
f4361730a1 | ||
|
|
bde01b77c4 | ||
|
|
37f4fc71e2 | ||
|
|
12ffd61390 | ||
|
|
4dc8ea2b6a | ||
|
|
4add339eba | ||
|
|
e5696ca1e3 | ||
|
|
90508ad0b1 | ||
|
|
aec74cab7d | ||
|
|
9ae861fe88 | ||
|
|
77e16b164c | ||
|
|
0ac5434a63 | ||
|
|
9c44a73425 | ||
|
|
f8d852d9d7 | ||
|
|
cd0e27204e | ||
|
|
09bbe44557 | ||
|
|
811154ea36 | ||
|
|
b416e511c3 | ||
|
|
66b6a8f7ce | ||
|
|
521f0626d2 | ||
|
|
47c3466084 | ||
|
|
8b611ec73c | ||
|
|
77ee2bf7cc | ||
|
|
3b8de3d5f8 | ||
|
|
fa7bf7cfb0 | ||
|
|
2b1de64324 | ||
|
|
8c467935c4 | ||
|
|
96b8dddbd1 | ||
|
|
c7be95682f | ||
|
|
128a6054c2 | ||
|
|
ef86be910a | ||
|
|
d0727b534e | ||
|
|
e55641a754 | ||
|
|
e7c7d2d8a7 | ||
|
|
1b130609a3 | ||
|
|
78ee14fbf2 | ||
|
|
14397a5914 |
15
.github/workflows/build-module.yml
vendored
15
.github/workflows/build-module.yml
vendored
@@ -1,9 +1,14 @@
|
||||
name: Create Release on Tag
|
||||
# on: [workflow_dispatch]
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag_name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
generate-config:
|
||||
@@ -21,7 +26,13 @@ jobs:
|
||||
|
||||
- name: Get OpenWRT version from tag
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_call" ]; then
|
||||
echo "VERSION=${{ inputs.tag_name }}" >> $GITHUB_ENV
|
||||
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
171
.github/workflows/build-to-immortal-wrt-snapshot.yml
vendored
Normal file
171
.github/workflows/build-to-immortal-wrt-snapshot.yml
vendored
Normal file
@@ -0,0 +1,171 @@
|
||||
name: Build AmneziaWG for snapshot ImmortalWRT
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "SNAPSHOT-ImmortalWRT"
|
||||
# schedule:
|
||||
# - cron: '0 */4 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "${{ matrix.build_env.tag }} - ${{ matrix.build_env.pkgarch}} :: ${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}} build"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build_env:
|
||||
- tag: "SNAPSHOT-ImmortalWRT"
|
||||
pkgarch: "mipsel_24kc"
|
||||
target: "ramips"
|
||||
subtarget: "mt7621"
|
||||
vermagic: "5a653f93e606afe42d18edcd614b1183"
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: Check if release file exists
|
||||
id: check_release
|
||||
run: |
|
||||
postfix="${{ matrix.build_env.tag }}_${{ matrix.build_env.vermagic }}_${{ matrix.build_env.pkgarch}}_${{ matrix.build_env.target}}_${{ matrix.build_env.subtarget}}"
|
||||
RELEASE_FILE="kmod-amneziawg_${postfix}.ipk"
|
||||
TAG=${{ matrix.build_env.tag }}
|
||||
|
||||
echo "Checking for release file: $RELEASE_FILE in release: $TAG"
|
||||
|
||||
# Используем GitHub CLI для проверки наличия файла в релизе
|
||||
if gh release view "$TAG" --repo Slava-Shchipunov/awg-openwrt --json assets --jq ".assets | .[].name" | grep -q "$RELEASE_FILE"; then
|
||||
echo "Release file $RELEASE_FILE already exists. Skipping job."
|
||||
echo "FILE_EXISTS=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "FILE_EXISTS=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# Прерываем job'у, если файл уже существует
|
||||
- name: Skip job if release file exists
|
||||
if: env.FILE_EXISTS == 'true'
|
||||
run: |
|
||||
echo "Skipping job as release file already exists."
|
||||
exit 0
|
||||
|
||||
- name: Get snapshot commit SHA and device ARCH
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: |
|
||||
PROFILE_URL="https://downloads.immortalwrt.org/snapshots/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/profiles.json"
|
||||
SNAPSHOT_COMMIT_SHA=$(wget -q $PROFILE_URL -O- | tr ',' '\n' | grep "version_code"| awk -F: '{print $2}' | tr -d '"' | awk -F- '{print $2}')
|
||||
echo "Snapshot commit sha: $SNAPSHOT_COMMIT_SHA"
|
||||
echo "SNAPSHOT_COMMIT_SHA=$SNAPSHOT_COMMIT_SHA" >> $GITHUB_ENV
|
||||
|
||||
DEVICE_ARCH=$(wget -q $PROFILE_URL -O- | tr ',' '\n' | grep "arch_packages"| awk -F: '{print $2}' | tr -d '"')
|
||||
echo "Device ARCH: $DEVICE_ARCH"
|
||||
echo "DEVICE_ARCH=$DEVICE_ARCH" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
with:
|
||||
repository: immortalwrt/immortalwrt
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout snapshot commit in immortalwrt repo
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: git checkout ${{ env.SNAPSHOT_COMMIT_SHA}}
|
||||
|
||||
- name: Building kernel and tools
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: |
|
||||
echo "pkgarch: ${{ matrix.build_env.pkgarch}}, target:${{ matrix.build_env.target}}, subtarget: ${{ matrix.build_env.subtarget}}"
|
||||
|
||||
# Setup & install feeds
|
||||
wget https://downloads.immortalwrt.org/snapshots/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/feeds.buildinfo -O feeds.conf
|
||||
echo "src-git awgopenwrt https://github.com/Slava-Shchipunov/awg-openwrt.git" >> ./feeds.conf
|
||||
./scripts/feeds update && ./scripts/feeds install -a
|
||||
|
||||
# Setup config with AWG and dependencies
|
||||
wget https://downloads.immortalwrt.org/snapshots/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-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 " > make tools/install"
|
||||
make tools/install -i -j `nproc`
|
||||
|
||||
cat ./build_dir/target-*/linux-*/linux-*/.vermagic || true
|
||||
|
||||
echo " > make toolchain/install"
|
||||
make toolchain/install -i -j `nproc`
|
||||
|
||||
cat ./build_dir/target-*/linux-*/linux-*/.vermagic || true
|
||||
|
||||
# compile kernel module
|
||||
echo " > make target/linux/compile"
|
||||
make target/linux/compile -i -j `nproc` V=s
|
||||
|
||||
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
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: |
|
||||
VERMAGIC=`cat ./build_dir/target-*/linux-*/linux-*/.vermagic`
|
||||
echo "Vermagic: $VERMAGIC"
|
||||
|
||||
VERMAGIC_EXPECTED=${{ matrix.build_env.vermagic }}
|
||||
|
||||
if [ "$VERMAGIC" != "$VERMAGIC_EXPECTED" ]; then
|
||||
echo Vermagic mismatch: $VERMAGIC, expected $VERMAGIC_EXPECTED
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ignore kmod build for some targets, replace with the awg-go
|
||||
make package/kmod-amneziawg/{clean,download,prepare} V=s || true
|
||||
make package/kmod-amneziawg/compile V=s || true
|
||||
|
||||
make package/luci-app-amneziawg/{clean,download,prepare}
|
||||
make package/luci-app-amneziawg/compile V=s
|
||||
|
||||
make V=s package/amneziawg-tools/{clean,download,prepare}
|
||||
make V=s package/amneziawg-tools/compile
|
||||
|
||||
- name: Prepare artifacts
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: |
|
||||
tag_name=${{ github.ref_name }}
|
||||
mkdir -p awgrelease
|
||||
postfix="${{ matrix.build_env.tag }}_${{ matrix.build_env.vermagic }}_${{ 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: Delete old release assets
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
run: |
|
||||
postfix="${{ matrix.build_env.pkgarch }}_${{ matrix.build_env.target }}_${{ matrix.build_env.subtarget }}"
|
||||
echo "Looking for old release files ending with: ${postfix}"
|
||||
|
||||
# Получаем список всех артефактов релиза по имени
|
||||
assets=$(gh release view "${{ matrix.build_env.tag }}" --repo Slava-Shchipunov/awg-openwrt --json assets --jq ".assets | .[] | select(.name | endswith(\"$postfix.ipk\")) | .name")
|
||||
|
||||
# Удаляем найденные артефакты по имени
|
||||
for asset_name in $assets; do
|
||||
echo "Deleting asset with name: $asset_name"
|
||||
gh release delete-asset "${{ matrix.build_env.tag }}" "$asset_name" --repo Slava-Shchipunov/awg-openwrt
|
||||
done
|
||||
|
||||
- name: Release
|
||||
if: env.FILE_EXISTS == 'false'
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: awgrelease/*.ipk
|
||||
tag_name: ${{ matrix.build_env.tag }}
|
||||
40
.github/workflows/run-release.yml
vendored
40
.github/workflows/run-release.yml
vendored
@@ -8,6 +8,9 @@ on:
|
||||
jobs:
|
||||
sync-releases:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_exists: ${{ steps.check_release.outputs.release_exists }}
|
||||
release_tag: ${{ steps.get_release.outputs.release_tag }}
|
||||
steps:
|
||||
- name: Checkout your repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -24,25 +27,40 @@ jobs:
|
||||
- name: Check if release exists in your repo
|
||||
id: check_release
|
||||
run: |
|
||||
curl -s https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases/tags/${{ steps.get_release.outputs.release_tag }} | jq -r .tag_name || echo "Not found"
|
||||
RELEASE_EXISTS=$(curl -s https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases/tags/${{ steps.get_release.outputs.release_tag }} | jq -r .tag_name)
|
||||
if [ "$RELEASE_EXISTS" == "null" ]; then
|
||||
echo "::set-output name=release_exists::false"
|
||||
else
|
||||
echo "::set-output name=release_exists::true"
|
||||
fi
|
||||
|
||||
- name: Create release in your repo
|
||||
if: steps.check_release.outputs.tag_name == 'Not found'
|
||||
if: steps.check_release.outputs.release_exists == 'false'
|
||||
run: |
|
||||
ART="
|
||||
\`\`\`
|
||||
_______ ________ __
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
|__| A M N E Z I A W I R E G U A R D
|
||||
-----------------------------------------------------
|
||||
OpenWrt ${{ steps.get_release.outputs.release_tag }}
|
||||
-----------------------------------------------------"
|
||||
-----------------------------------------------------
|
||||
\`\`\`"
|
||||
|
||||
curl -X POST https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "'${{ steps.get_release.outputs.release_tag }}'",
|
||||
"name": "Build amnezia wg for all devices with openwrt '${{ steps.get_release.outputs.release_tag }}'",
|
||||
"body": "'"${ART}"'\n\nAutomatically created release for OpenWRT '${{ steps.get_release.outputs.release_tag }}'."
|
||||
}'
|
||||
-d "$(jq -n --arg tag "${{ steps.get_release.outputs.release_tag }}" \
|
||||
--arg name "Build amnezia wg for all devices with openwrt ${{ steps.get_release.outputs.release_tag }}" \
|
||||
--arg body "$ART" \
|
||||
'{ tag_name: $tag, name: $name, body: $body }')"
|
||||
|
||||
run-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: sync-releases
|
||||
if: needs.sync-releases.outputs.release_exists == 'false'
|
||||
uses: Slava-Shchipunov/awg-openwrt/.github/workflows/build-module.yml@master
|
||||
with:
|
||||
tag_name: ${{ needs.sync-releases.outputs.release_tag }}
|
||||
Reference in New Issue
Block a user