Skip to content

Commit d7d81f2

Browse files
committed
Add macOS ARM64 binary to release packages
Build sniproxy on macos-latest and package as a tarball containing the binary, man pages. Uses the same Homebrew configure pattern as build-and-fuzz.yml.
1 parent d8a316f commit d7d81f2

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/release-packages.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,60 @@ jobs:
10491049
path: artifacts/apk/alpine-${{ needs.detect-versions.outputs.alpine_latest }}/
10501050
if-no-files-found: error
10511051

1052+
build-macos:
1053+
name: Build macOS binary (ARM64)
1054+
runs-on: macos-latest
1055+
steps:
1056+
- name: Checkout
1057+
uses: actions/checkout@v6
1058+
with:
1059+
fetch-depth: 0
1060+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }}
1061+
1062+
- name: Install dependencies
1063+
run: |
1064+
brew install libev pcre2 c-ares openssl autoconf automake libtool gettext
1065+
brew link --force gettext
1066+
1067+
- name: Build
1068+
run: |
1069+
set -euo pipefail
1070+
BREW_CPPFLAGS=""
1071+
BREW_LDFLAGS=""
1072+
BREW_PKG=""
1073+
for dep in libev pcre2 c-ares openssl; do
1074+
prefix="$(brew --prefix "$dep")"
1075+
BREW_CPPFLAGS="${BREW_CPPFLAGS} -I${prefix}/include"
1076+
BREW_LDFLAGS="${BREW_LDFLAGS} -L${prefix}/lib"
1077+
BREW_PKG="${BREW_PKG:+${BREW_PKG}:}${prefix}/lib/pkgconfig"
1078+
done
1079+
./autogen.sh
1080+
./configure --disable-dependency-tracking \
1081+
CC=cc \
1082+
CPPFLAGS="${BREW_CPPFLAGS}" \
1083+
LDFLAGS="${BREW_LDFLAGS}" \
1084+
PKG_CONFIG_PATH="${BREW_PKG}"
1085+
make -j$(sysctl -n hw.ncpu)
1086+
1087+
# Determine version from configure
1088+
VERSION=$(./src/sniproxy -V 2>&1 | awk '{print $2}')
1089+
ARCH=$(uname -m)
1090+
1091+
# Create tarball with binary, man pages, and config example
1092+
STAGING="sniproxy-${VERSION}-macos-${ARCH}"
1093+
mkdir -p "${STAGING}/bin" "${STAGING}/share/man/man5" "${STAGING}/share/man/man8"
1094+
cp src/sniproxy "${STAGING}/bin/"
1095+
cp man/sniproxy.8 "${STAGING}/share/man/man8/"
1096+
cp man/sniproxy.conf.5 "${STAGING}/share/man/man5/"
1097+
tar czf "${STAGING}.tar.gz" "${STAGING}"
1098+
1099+
- name: Upload macOS artifacts
1100+
uses: actions/upload-artifact@v7
1101+
with:
1102+
name: macos-packages
1103+
path: sniproxy-*-macos-*.tar.gz
1104+
if-no-files-found: error
1105+
10521106
publish:
10531107
name: Upload Release Assets
10541108
runs-on: ubuntu-latest
@@ -1064,6 +1118,7 @@ jobs:
10641118
- build-rpm-opensuse
10651119
- build-rpm-suse
10661120
- build-apk-alpine
1121+
- build-macos
10671122
steps:
10681123
- name: Download Debian artifacts
10691124
uses: actions/download-artifact@v8
@@ -1086,6 +1141,12 @@ jobs:
10861141
path: release-assets/apk
10871142
merge-multiple: true
10881143

1144+
- name: Download macOS artifacts
1145+
uses: actions/download-artifact@v8
1146+
with:
1147+
name: macos-packages
1148+
path: release-assets/macos
1149+
10891150
- name: Upload release assets
10901151
uses: softprops/action-gh-release@v2
10911152
with:
@@ -1094,3 +1155,4 @@ jobs:
10941155
release-assets/deb/*.deb
10951156
release-assets/rpm/*.rpm
10961157
release-assets/apk/*.apk
1158+
release-assets/macos/*.tar.gz

0 commit comments

Comments
 (0)