mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-04-12 03:56:55 +02:00
Improve builds
- simplify pipeline for Windows and add the `retry` parameter for cURL in case of issues with downloading dependencies - add a pipeline to make Linux builds for Ubuntu and Alpine
This commit is contained in:
parent
c9ff85e9ed
commit
422b69f410
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]
|
||||
|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue