forked from WireGuard/wireguard-tools
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from amnezia-vpn/new_fields_to_config
New fields to config
- Loading branch information
Showing
16 changed files
with
813 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: windows-wg | ||
|
||
on: [push] | ||
|
||
|
||
jobs: | ||
|
||
Build-Libs-WireGuard-Windows: | ||
name: 'Build-Libs-WireGuard-Windows' | ||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: 'Setup ccache' | ||
uses: hendrikmuhs/[email protected] | ||
|
||
- name: 'Get sources' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Get Wireguard-Tools' | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: amnezia-vpn/amnezia-wg-tools | ||
ref: master | ||
path: windows/wireguard-tools-windows | ||
|
||
- name: 'Build WireGuard Tools binary' | ||
working-directory: windows/wireguard-tools-windows | ||
run: | | ||
cmd /c build.cmd | ||
mkdir build | ||
move x64 build\x64 | ||
move x86 build\x86 | ||
move arm64 build\arm64 | ||
- name: Archive WG Windows | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
retention-days: 1 | ||
name: windows-wireguard-tools | ||
path: windows/wireguard-tools-windows/build | ||
|
||
github-release: | ||
name: GitHub Release | ||
needs: Build-Libs-WireGuard-Windows | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup | Artifacts | ||
uses: actions/download-artifact@v2 | ||
|
||
- name: Setup | Checksums | ||
run: for file in $(find ./ -name '*.exe' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | ||
|
||
- name: Zip ALL | ||
run: for file in *; do zip -r ${file%.*}.zip $file; done | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: windows-wireguard-tools.zip | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,8 @@ src/wg.exe | |
*.til | ||
*.pro.user | ||
maint/ | ||
.deps/ | ||
*.syso | ||
x64/ | ||
x86/ | ||
arm64/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@echo off | ||
rem SPDX-License-Identifier: MIT | ||
rem Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved. | ||
|
||
setlocal enabledelayedexpansion | ||
set BUILDDIR=%~dp0 | ||
set PATH=%BUILDDIR%.deps\llvm-mingw\bin;%BUILDDIR%src;%PATH% | ||
set PATHEXT=.exe | ||
cd /d %BUILDDIR% || exit /b 1 | ||
|
||
if exist .deps/prepared goto :build | ||
:installdeps | ||
rmdir /s /q .deps 2> NUL | ||
mkdir .deps || goto :error | ||
cd .deps || goto :error | ||
call :download llvm-mingw-msvcrt.zip https://download.wireguard.com/windows-toolchain/distfiles/llvm-mingw-20201020-msvcrt-x86_64.zip 2e46593245090df96d15e360e092f0b62b97e93866e0162dca7f93b16722b844 || goto :error | ||
call :download wireguard-nt.zip https://download.wireguard.com/wireguard-nt/wireguard-nt-0.10.1.zip 772c0b1463d8d2212716f43f06f4594d880dea4f735165bd68e388fc41b81605 || goto :error | ||
copy /y NUL prepared > NUL || goto :error | ||
cd .. || goto :error | ||
|
||
:build | ||
call :build_plat x64 x86_64 amd64 || goto :error | ||
call :build_plat x86 i686 386 || goto :error | ||
call :build_plat arm64 aarch64 arm64 || goto :error | ||
|
||
:success | ||
echo [+] Success | ||
exit /b 0 | ||
|
||
:download | ||
echo [+] Downloading %1 | ||
curl -#fLo %1 %2 || exit /b 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 | ||
echo [+] Extracting %1 | ||
tar -xf %1 %~4 || exit /b 1 | ||
echo [+] Cleaning up %1 | ||
del %1 || exit /b 1 | ||
goto :eof | ||
|
||
:build_plat | ||
mkdir %1 >NUL 2>&1 | ||
echo [+] Assembling resources %1 | ||
%~2-w64-mingw32-windres -I ".deps\wireguard-nt\bin\%~1" -DWIREGUARD_VERSION_ARRAY=0.5.3 -DWIREGUARD_VERSION_STR=0.5.3 -i src/wincompat/resources.rc -o "src/wincompat/resources_%~3.syso" -O coff -c 65001 || exit /b %errorlevel% | ||
echo [+] Building command line tools %1 | ||
del src\*.exe src\*.o src\wincompat\*.o src\wincompat\*.lib 2> NUL | ||
set LDFLAGS=-s | ||
make --no-print-directory -C src PLATFORM=windows CC=%~2-w64-mingw32-gcc WINDRES=%~2-w64-mingw32-windres V=1 RUNSTATEDIR= SYSTEMDUNITDIR= -j%NUMBER_OF_PROCESSORS% || exit /b 1 | ||
move /Y src\wg.exe "%~1\wg.exe" > NUL || exit /b 1 | ||
goto :eof | ||
|
||
:error | ||
echo [-] Failed with error #%errorlevel%. | ||
cmd /c exit %errorlevel% | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.