mirror of
https://github.com/Slava-Shchipunov/awg-openwrt.git
synced 2026-03-14 01:13:09 +00:00
feat: add awg 2.0 (#51)
* feat: update awg tools * feat: update kmod-awg * feat: update luci awg * feat: update build-module.yml * feat: update amneziawg-install.sh * feat: update README.md * fix: fix paths * fix: fix adding packages * fix: fix regexp * fix: fix feeds install * chore: disable run-release.yml * feat: add rus lang package * fix: install python3-pyelftools in build job * feat: add manual start for build * chore: remove build to all snapshots
This commit is contained in:
187
.github/workflows/build-module.yml
vendored
187
.github/workflows/build-module.yml
vendored
@@ -9,6 +9,20 @@ on:
|
||||
tag_name:
|
||||
required: true
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'OpenWRT version (e.g., 24.10.3)'
|
||||
required: true
|
||||
type: string
|
||||
targets:
|
||||
description: 'Targets (comma-separated, e.g., "stm32,ramips")'
|
||||
required: true
|
||||
type: string
|
||||
subtargets:
|
||||
description: 'Subtargets (comma-separated, e.g., "stm32mp1,mt7621")'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
generate-config:
|
||||
@@ -27,8 +41,12 @@ jobs:
|
||||
- name: Get OpenWRT version from tag
|
||||
id: get_version
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_call" ]; then
|
||||
echo "VERSION=${{ inputs.tag_name }}" >> $GITHUB_ENV
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
echo "TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
|
||||
echo "SUBTARGETS=${{ inputs.subtargets }}" >> $GITHUB_ENV
|
||||
elif [ "${{ github.event_name }}" == "workflow_call" ]; then
|
||||
VERSION="${{ inputs.tag_name }}"
|
||||
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
@@ -39,7 +57,7 @@ jobs:
|
||||
|
||||
- name: Generate Job Config
|
||||
id: generate-config
|
||||
run: node index.js ${{ env.VERSION }}
|
||||
run: node index.js ${{ env.VERSION }} "${{ env.TARGETS }}" "${{ env.SUBTARGETS }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -53,94 +71,127 @@ jobs:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: openwrt/openwrt
|
||||
ref: v${{ matrix.build_env.tag }}
|
||||
fetch-depth: 0
|
||||
- name: Checkout AWG source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Cache Tools and Kernel
|
||||
id: cache-tools-kernel
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3-pyelftools
|
||||
|
||||
- name: Cache OpenWrt SDK
|
||||
id: cache-sdk
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: "cache-tools-kernel-${{ matrix.build_env.tag }}-${{ matrix.build_env.pkgarch}}-${{ matrix.build_env.target}}-${{ matrix.build_env.subtarget}}"
|
||||
cache-name: "cache-sdk-${{ matrix.build_env.tag }}-${{ matrix.build_env.target}}-${{ matrix.build_env.subtarget}}"
|
||||
with:
|
||||
path: "**"
|
||||
key: ${{ runner.os }}-build-vm4-${{ env.cache-name }}
|
||||
path: openwrt-sdk-*/
|
||||
key: ${{ runner.os }}-sdk-${{ env.cache-name }}
|
||||
|
||||
- name: Building kernel and tools
|
||||
#if: ${{ steps.cache-tools-kernel.outputs.cache-hit != 'true' }}
|
||||
- name: Download and extract OpenWrt SDK
|
||||
if: steps.cache-sdk.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
echo "pkgarch: ${{ matrix.build_env.pkgarch}}, target:${{ matrix.build_env.target}}, subtarget: ${{ matrix.build_env.subtarget}}"
|
||||
|
||||
# Setup & install feeds
|
||||
wget https://downloads.openwrt.org/releases/${{ matrix.build_env.tag }}/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
|
||||
# Get the actual SDK filename from the directory listing
|
||||
SDK_FILE=$(curl -s "https://downloads.openwrt.org/releases/${{ matrix.build_env.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/" | grep -o "openwrt-sdk-${{ matrix.build_env.tag }}-${{ matrix.build_env.target}}-${{ matrix.build_env.subtarget}}_gcc-[^\"]*_musl[^\"]*\.Linux-x86_64\.tar\.[xz|zst]*" | head -n1)
|
||||
|
||||
if [ -z "$SDK_FILE" ]; then
|
||||
echo "SDK file not found for ${{ matrix.build_env.tag }} ${{ matrix.build_env.target}} ${{ matrix.build_env.subtarget}}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SDK_DOWNLOAD_URL="https://downloads.openwrt.org/releases/${{ matrix.build_env.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/${SDK_FILE}"
|
||||
echo "Downloading SDK: $SDK_DOWNLOAD_URL"
|
||||
|
||||
wget "$SDK_DOWNLOAD_URL"
|
||||
|
||||
# Extract based on file extension
|
||||
if [[ "$SDK_FILE" == *.tar.zst ]]; then
|
||||
tar --zstd -xf "$SDK_FILE"
|
||||
elif [[ "$SDK_FILE" == *.tar.xz ]]; then
|
||||
tar -xf "$SDK_FILE"
|
||||
else
|
||||
echo "Unknown archive format: $SDK_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm "$SDK_FILE"
|
||||
|
||||
# Setup config with AWG and dependencies
|
||||
wget https://downloads.openwrt.org/releases/${{ matrix.build_env.tag }}/targets/${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}}/config.buildinfo -O .config
|
||||
echo "CONFIG_PACKAGE_kmod-amneziawg=m" >> .config
|
||||
- name: Setup SDK and feeds
|
||||
run: |
|
||||
# Find SDK directory
|
||||
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
|
||||
|
||||
if [ -z "$SDK_DIR" ]; then
|
||||
echo "SDK directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get absolute paths
|
||||
WORKSPACE_DIR=$(pwd)
|
||||
|
||||
cd "$SDK_DIR"
|
||||
|
||||
# Update feeds to include LuCI
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
# Copy current repository packages directly to package directory
|
||||
cp -r "$WORKSPACE_DIR/kmod-amneziawg" package/
|
||||
cp -r "$WORKSPACE_DIR/amneziawg-tools" package/
|
||||
cp -r "$WORKSPACE_DIR/luci-proto-amneziawg" package/
|
||||
|
||||
# Configure packages to build
|
||||
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
|
||||
|
||||
echo "CONFIG_PACKAGE_luci-proto-amneziawg=y" >> .config
|
||||
echo "CONFIG_PACKAGE_luci-i18n-amneziawg-ru=y" >> .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
|
||||
- name: Build AmneziaWG packages
|
||||
run: |
|
||||
VERMAGIC=`cat ./build_dir/target-*/linux-*/linux-*/.vermagic`
|
||||
echo "Vermagic: $VERMAGIC"
|
||||
# Find SDK directory
|
||||
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
|
||||
cd "$SDK_DIR"
|
||||
|
||||
VERMAGIC_EXPECTED=${{ matrix.build_env.vermagic }}
|
||||
echo "Building AmneziaWG packages..."
|
||||
|
||||
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
|
||||
# Build kmod-amneziawg (kernel module)
|
||||
echo "Building kmod-amneziawg..."
|
||||
make package/kmod-amneziawg/{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
|
||||
# Build luci-proto-amneziawg (web interface)
|
||||
echo "Building luci-proto-amneziawg..."
|
||||
make package/luci-proto-amneziawg/{download,prepare} V=s
|
||||
make package/luci-proto-amneziawg/compile V=s
|
||||
|
||||
make V=s package/amneziawg-tools/{clean,download,prepare}
|
||||
make V=s package/amneziawg-tools/compile
|
||||
# Build amneziawg-tools (userspace tools)
|
||||
echo "Building amneziawg-tools..."
|
||||
make package/amneziawg-tools/{download,prepare} V=s
|
||||
make package/amneziawg-tools/compile V=s
|
||||
|
||||
echo "Build completed. Checking for built packages..."
|
||||
find bin/ -name "*.ipk" | grep -E "(amneziawg|luci-proto-amneziawg|luci-i18n-amneziawg)" | head -10
|
||||
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
tag_name=${{ github.ref_name }}
|
||||
# Find SDK directory
|
||||
SDK_DIR=$(find . -maxdepth 1 -name "openwrt-sdk-*" -type d | head -n1)
|
||||
|
||||
mkdir -p awgrelease
|
||||
postfix="v${{ matrix.build_env.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
|
||||
|
||||
# Copy built packages
|
||||
find "$SDK_DIR/bin/packages" -name "amneziawg-tools_*.ipk" -exec cp {} awgrelease/amneziawg-tools_${postfix}.ipk \; || echo "amneziawg-tools package not found"
|
||||
find "$SDK_DIR/bin/packages" -name "luci-proto-amneziawg_*.ipk" -exec cp {} awgrelease/luci-proto-amneziawg_${postfix}.ipk \; || echo "luci-proto-amneziawg package not found"
|
||||
find "$SDK_DIR/bin/packages" -name "luci-i18n-amneziawg-ru_*.ipk" -exec cp {} awgrelease/luci-i18n-amneziawg-ru_${postfix}.ipk \; || echo "luci-i18n-amneziawg-ru package not found"
|
||||
find "$SDK_DIR/bin/targets" -name "kmod-amneziawg_*.ipk" -exec cp {} awgrelease/kmod-amneziawg_${postfix}.ipk \; || echo "kmod-amneziawg package not found"
|
||||
|
||||
echo "Built packages:"
|
||||
ls -la awgrelease/
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
|
||||
187
.github/workflows/build-to-all-latest-snapshots.yml
vendored
187
.github/workflows/build-to-all-latest-snapshots.yml
vendored
@@ -1,187 +0,0 @@
|
||||
name: Build AmneziaWG for snapshot OpenWRT
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "SNAPSHOT"
|
||||
# schedule:
|
||||
# - cron: '0 */4 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
generate-config:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
job-config: ${{ steps.generate-config.outputs.job-config }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.16.0'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Generate Job Config
|
||||
id: generate-config
|
||||
run: node index.js SNAPSHOT
|
||||
|
||||
build:
|
||||
name: "${{ matrix.build_env.tag }} - ${{ matrix.build_env.pkgarch}} :: ${{ matrix.build_env.target}}/${{ matrix.build_env.subtarget}} build"
|
||||
runs-on: ubuntu-latest
|
||||
needs: generate-config
|
||||
strategy:
|
||||
matrix:
|
||||
build_env: ${{ fromJson(needs.generate-config.outputs.job-config) }}
|
||||
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.openwrt.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: openwrt/openwrt
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Checkout snapshot commit in openwrt 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.openwrt.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.openwrt.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 }}
|
||||
2
.github/workflows/run-release.yml
vendored
2
.github/workflows/run-release.yml
vendored
@@ -3,7 +3,7 @@ name: Sync OpenWRT Releases
|
||||
on:
|
||||
# schedule:
|
||||
# - cron: '0 0 */3 * *' # Проверка новых релизов раз в три дня
|
||||
workflow_dispatch: # Возможность вручную запустить Action
|
||||
# workflow_dispatch: # Возможность вручную запустить Action
|
||||
|
||||
jobs:
|
||||
sync-releases:
|
||||
|
||||
Reference in New Issue
Block a user