-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (103 loc) · 3.03 KB
/
build.yml
File metadata and controls
117 lines (103 loc) · 3.03 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Build
on:
push:
branches: ["*"]
pull_request:
jobs:
build-linux:
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu (latest)
image: ubuntu:latest
- name: Ubuntu (24.04 LTS)
image: ubuntu:24.04
- name: Debian (stable)
image: debian:stable
- name: Debian (oldstable)
image: debian:oldstable
- name: Fedora (latest)
image: fedora:latest
- name: Rocky Linux 9
image: rockylinux:9
- name: Alpine (latest)
image: alpine:latest
- name: openSUSE Leap
image: opensuse/leap:latest
- name: Arch Linux
image: archlinux:latest
name: ${{ matrix.name }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
timeout-minutes: 10
steps:
- name: Install build tools (apt)
if: contains(matrix.image, 'ubuntu') || contains(matrix.image, 'debian')
run: |
apt-get update
apt-get install -y build-essential git
- name: Install build tools (dnf)
if: contains(matrix.image, 'fedora') || contains(matrix.image, 'rockylinux')
run: |
dnf install -y gcc make git
- name: Install build tools (apk)
if: contains(matrix.image, 'alpine')
run: |
apk add build-base git
- name: Install build tools (zypper)
if: contains(matrix.image, 'opensuse')
run: |
zypper install -y gcc make git
- name: Install build tools (pacman)
if: contains(matrix.image, 'archlinux')
run: |
pacman -Sy --noconfirm gcc make git
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: make -j$(nproc)
- name: Verify binary
run: ./thinproxy -V
tag-release:
name: Tag on version change
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [build-linux, build-macos]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Create tag if version changed
run: |
ver=$(sed -n 's/^#define THINPROXY_VERSION.*"\(.*\)"/\1/p' thinproxy.c)
if [ -z "$ver" ]; then
echo "Could not extract version"
exit 1
fi
if git rev-parse "v${ver}" >/dev/null 2>&1; then
echo "Tag v${ver} already exists, skipping"
else
echo "Creating tag v${ver}"
git tag "v${ver}"
git push origin "v${ver}"
fi
build-macos:
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-26]
name: macOS (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: make -j$(sysctl -n hw.ncpu)
- name: Verify binary
run: ./thinproxy -V