diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000..8143df6 --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -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 diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 4390a04..3ae49f0 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -1,69 +1,56 @@ -name: windows-wg +name: Windows on: [push] - jobs: - - Build-Libs-WireGuard-Windows: - name: 'Build-Libs-WireGuard-Windows' + Build-for-Windows: + name: Build for Windows runs-on: windows-latest - steps: - - - name: 'Setup ccache' + - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2 - - - 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: Checkout + uses: actions/checkout@v4 - - name: 'Build WireGuard Tools binary' - working-directory: windows/wireguard-tools-windows + - name: Build AmneziaWG tools 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 + + - name: Upload artifact + uses: actions/upload-artifact@v4 with: retention-days: 1 - name: windows-wireguard-tools - path: windows/wireguard-tools-windows/build - - github-release: + name: windows-amneziawg-tools + path: build + + GitHub-Release: name: GitHub Release - needs: Build-Libs-WireGuard-Windows + needs: Build-for-Windows runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') - steps: - - name: Setup | Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 - - name: Setup | Artifacts - uses: actions/download-artifact@v2 + - name: Download artifacts + 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 - - name: Zip ALL + - name: Zip files 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 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: windows-wireguard-tools.zip + file: windows-amneziawg-tools.zip tag: ${{ github.ref }} overwrite: true - file_glob: true + file_glob: true diff --git a/build.cmd b/build.cmd index 537c07f..745dd69 100644 --- a/build.cmd +++ b/build.cmd @@ -29,7 +29,7 @@ if exist .deps/prepared goto :build :download echo [+] Downloading %1 - curl -#fLo %1 %2 || exit /b 1 + curl --retry 3 -#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