Skip to content

Commit

Permalink
Merge pull request #6 from amnezia-vpn/linux-build
Browse files Browse the repository at this point in the history
Improve builds
  • Loading branch information
tiaga authored Feb 2, 2024
2 parents c9ff85e + 422b69f commit 3ff2272
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 38 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 24 additions & 37 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -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/[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: 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
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ff2272

Please sign in to comment.