mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-06-05 04:23:43 +02:00
commit
3ff2272d00
3 changed files with 78 additions and 38 deletions
53
.github/workflows/linux-build.yml
vendored
Normal file
53
.github/workflows/linux-build.yml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
name: Linux
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build-for-Ubuntu:
|
||||||
|
name: Build for Ubuntu
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build AmneziaWG tools
|
||||||
|
run: |
|
||||||
|
apt -y update &&
|
||||||
|
apt -y install build-essential &&
|
||||||
|
cd src &&
|
||||||
|
make &&
|
||||||
|
mkdir build &&
|
||||||
|
cp wg ./build/wg &&
|
||||||
|
cp wg-quick/linux.bash ./build/wg-quick
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ubuntu-22.04-amneziawg-tools
|
||||||
|
path: ./src/build
|
||||||
|
|
||||||
|
Build-for-Alpine:
|
||||||
|
name: Build for Alpine
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: alpine:3.19
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build AmneziaWG tools
|
||||||
|
run: |
|
||||||
|
apk add linux-headers build-base &&
|
||||||
|
cd src &&
|
||||||
|
make &&
|
||||||
|
mkdir build &&
|
||||||
|
cp wg ./build/wg &&
|
||||||
|
cp wg-quick/linux.bash ./build/wg-quick
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: alpine-3.19-amneziawg-tools
|
||||||
|
path: ./src/build
|
61
.github/workflows/windows-build.yml
vendored
61
.github/workflows/windows-build.yml
vendored
|
@ -1,69 +1,56 @@
|
||||||
name: windows-wg
|
name: Windows
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
Build-for-Windows:
|
||||||
Build-Libs-WireGuard-Windows:
|
name: Build for Windows
|
||||||
name: 'Build-Libs-WireGuard-Windows'
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Setup ccache
|
||||||
- name: 'Setup ccache'
|
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
|
||||||
- name: 'Get sources'
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: 'Get Wireguard-Tools'
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
repository: amnezia-vpn/amnezia-wg-tools
|
|
||||||
ref: master
|
|
||||||
path: windows/wireguard-tools-windows
|
|
||||||
|
|
||||||
- name: 'Build WireGuard Tools binary'
|
- name: Build AmneziaWG tools
|
||||||
working-directory: windows/wireguard-tools-windows
|
|
||||||
run: |
|
run: |
|
||||||
cmd /c build.cmd
|
cmd /c build.cmd
|
||||||
mkdir build
|
mkdir build
|
||||||
move x64 build\x64
|
move x64 build\x64
|
||||||
move x86 build\x86
|
move x86 build\x86
|
||||||
move arm64 build\arm64
|
move arm64 build\arm64
|
||||||
|
|
||||||
- name: Archive WG Windows
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
name: windows-wireguard-tools
|
name: windows-amneziawg-tools
|
||||||
path: windows/wireguard-tools-windows/build
|
path: build
|
||||||
|
|
||||||
github-release:
|
GitHub-Release:
|
||||||
name: GitHub Release
|
name: GitHub Release
|
||||||
needs: Build-Libs-WireGuard-Windows
|
needs: Build-for-Windows
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup | Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup | Artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v4
|
||||||
|
|
||||||
- name: Setup | Checksums
|
- name: Calculate checksums
|
||||||
run: for file in $(find ./ -name '*.exe' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
|
run: for file in $(find ./ -name '*.exe' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
|
||||||
|
|
||||||
- name: Zip ALL
|
- name: Zip files
|
||||||
run: for file in *; do zip -r ${file%.*}.zip $file; done
|
run: for file in *; do zip -r ${file%.*}.zip $file; done
|
||||||
|
|
||||||
- name: Upload binaries to release
|
- name: Upload binaries to Release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: windows-wireguard-tools.zip
|
file: windows-amneziawg-tools.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
file_glob: true
|
file_glob: true
|
||||||
|
|
|
@ -29,7 +29,7 @@ if exist .deps/prepared goto :build
|
||||||
|
|
||||||
:download
|
:download
|
||||||
echo [+] Downloading %1
|
echo [+] Downloading %1
|
||||||
curl -#fLo %1 %2 || exit /b 1
|
curl --retry 3 -#fLo %1 %2 || exit /b 1
|
||||||
echo [+] Verifying %1
|
echo [+] Verifying %1
|
||||||
for /f %%a in ('CertUtil -hashfile %1 SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="%~3" exit /b 1
|
for /f %%a in ('CertUtil -hashfile %1 SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="%~3" exit /b 1
|
||||||
echo [+] Extracting %1
|
echo [+] Extracting %1
|
||||||
|
|
Loading…
Add table
Reference in a new issue