Skip to content

Commit dc5f91f

Browse files
committed
Add release workflow to build and attach binary assets
Triggered on release publish. Builds statically linked binaries for linux-amd64, linux-arm64, and linux-amd64-musl (Alpine), plus macOS arm64. Each asset is a tarball with the binary, man page, example config, service unit, license, and readme.
1 parent 3e3de59 commit dc5f91f

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-linux:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- arch: amd64
17+
image: debian:stable
18+
cc: cc
19+
suffix: linux-amd64
20+
- arch: arm64
21+
image: debian:stable
22+
cc: cc
23+
suffix: linux-arm64
24+
- arch: amd64
25+
image: alpine:latest
26+
cc: cc
27+
suffix: linux-amd64-musl
28+
name: ${{ matrix.suffix }}
29+
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
30+
container:
31+
image: ${{ matrix.image }}
32+
steps:
33+
- name: Install tools (apt)
34+
if: contains(matrix.image, 'debian')
35+
run: apt-get update && apt-get install -y build-essential git file
36+
37+
- name: Install tools (apk)
38+
if: contains(matrix.image, 'alpine')
39+
run: apk add build-base git file
40+
41+
- name: Checkout
42+
uses: actions/checkout@v6
43+
44+
- name: Build
45+
run: |
46+
make CC="${{ matrix.cc }}" CFLAGS="-O2 -pipe -Wall -Wextra -Werror -pedantic -std=c99 -static" LDFLAGS="-static"
47+
file thinproxy
48+
./thinproxy -V
49+
50+
- name: Package
51+
run: |
52+
tar czf thinproxy-${{ github.ref_name }}-${{ matrix.suffix }}.tar.gz \
53+
thinproxy thinproxy.8 thinproxy.conf.example thinproxy.service \
54+
LICENSE README.md
55+
56+
- name: Upload asset
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
run: |
60+
gh release upload "${{ github.ref_name }}" \
61+
thinproxy-${{ github.ref_name }}-${{ matrix.suffix }}.tar.gz \
62+
--repo "${{ github.repository }}" \
63+
--clobber
64+
65+
build-macos:
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
include:
70+
- os: macos-latest
71+
suffix: macos-arm64
72+
- os: macos-26
73+
suffix: macos-arm64-26
74+
name: ${{ matrix.suffix }}
75+
runs-on: ${{ matrix.os }}
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v6
79+
80+
- name: Build
81+
run: |
82+
make
83+
file thinproxy
84+
./thinproxy -V
85+
86+
- name: Package
87+
run: |
88+
tar czf thinproxy-${{ github.ref_name }}-${{ matrix.suffix }}.tar.gz \
89+
thinproxy thinproxy.8 thinproxy.conf.example \
90+
LICENSE README.md
91+
92+
- name: Upload asset
93+
env:
94+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
run: |
96+
gh release upload "${{ github.ref_name }}" \
97+
thinproxy-${{ github.ref_name }}-${{ matrix.suffix }}.tar.gz \
98+
--repo "${{ github.repository }}" \
99+
--clobber

0 commit comments

Comments
 (0)