forked from WireGuard/wireguard-tools
-
Notifications
You must be signed in to change notification settings - Fork 29
85 lines (74 loc) · 2.26 KB
/
linux-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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/awg &&
cp wg-quick/linux.bash ./build/awg-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/awg &&
cp wg-quick/linux.bash ./build/awg-quick
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: alpine-3.19-amneziawg-tools
path: ./src/build
GitHub-Release:
name: GitHub Release
needs: [Build-for-Ubuntu, Build-for-Alpine]
strategy:
matrix:
include:
- os: "ubuntu"
release: "22.04"
- os: "alpine"
release: "3.19"
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Calculate checksums
run: for file in $(find ./${{ matrix.os }}-${{ matrix.release }}-amneziawg-tools/ -type f); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
- name: Zip files
run: zip -r ${{ matrix.os }}-${{ matrix.release }}-amneziawg-tools.zip ${{ matrix.os }}-${{ matrix.release }}-amneziawg-tools
- name: Upload binaries to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ matrix.os }}-${{ matrix.release }}-amneziawg-tools.zip
tag: ${{ github.ref }}
release_name: ${{ github.ref_name }}
overwrite: true
file_glob: true