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 #6 from amnezia-vpn/linux-build
Improve builds
- Loading branch information
Showing
3 changed files
with
78 additions
and
38 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,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 |
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 |
---|---|---|
@@ -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 |
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