Skip to content

Commit 3ce3a85

Browse files
authored
Merge branch 'main' into udp_conntrack
2 parents 3f63618 + ba19046 commit 3ce3a85

23 files changed

+450
-202
lines changed

.github/workflows/prerelease.yml

+104-36
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
goos: [ linux ]
16-
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
16+
goarch: [ arm64, 386, riscv64, loong64, mips64, mips64le, mipsle, mips, ppc64, ppc64le, s390x ]
1717
include:
1818
# BEGIN Linux ARM 5 6 7
1919
- goos: linux
@@ -91,55 +91,126 @@ jobs:
9191
find ./go-mod/ -maxdepth 1 ! -name "cache" ! -name "go-mod" -exec rm -rf {} \;
9292
sed -i 's/#export GOMODCACHE=$(PWD)\/go-mod/export GOMODCACHE=$(PWD)\/go-mod/' Makefile
9393
94-
- name: Create full source ZIP archive and Signature
94+
- name: Create directory for placing archives & packages temporarily
95+
run: mkdir -p ./bundled/
96+
97+
- name: Create full source archive
9598
if: matrix.goarch == 'arm64'
9699
run: |
97-
zip -9vr dae-full-src.zip . -x .git/\*
98-
FILE=./dae-full-src.zip
99-
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
100-
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
101-
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
102-
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
100+
zip -9vr ./bundled/dae-full-src.zip . -x .git/\* bundled/\*
101+
tar -I 'xz -9' -cvf ./bundled/dae-full-src.tar.xz --exclude .git --exclude bundled .
103102
104103
- name: Build dae
105104
run: |
106-
mkdir -p ./build/
107105
export CGO_ENABLED=0
108106
export GOFLAGS="-trimpath -modcacherw"
109-
export OUTPUT=build/dae-$ASSET_NAME
110-
export VERSION=${{ steps.get_version.outputs.VERSION }}
107+
export OUTPUT=build/usr/bin/dae
108+
export VERSION=${{ env.VERSION }}
111109
export CLANG=clang-15
112110
export STRIP=llvm-strip-15
113111
make
114-
cp ./install/dae.service ./build/
115-
cp ./example.dae ./build/
116-
curl -L -o ./build/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
117-
curl -L -o ./build/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
112+
install -Dm644 ./install/dae.service -t ./build/usr/lib/systemd/system/
113+
install -Dm640 ./install/empty.dae ./build/etc/dae/config.dae
114+
install -Dm644 ./example.dae -t ./build/etc/dae/
115+
install -d ./build/usr/share/dae/
116+
curl -L -o ./build/usr/share/dae/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
117+
curl -L -o ./build/usr/share/dae/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
118118
119119
- name: Smoking test
120120
if: matrix.goarch == 'amd64' && matrix.goamd64 == 'v1'
121-
run: ./build/dae-$ASSET_NAME --version
121+
run: ./build/usr/bin/dae --version
122+
123+
- name: Create binary archive
124+
run: tar -cJvf ./bundled/dae-$ASSET_NAME.tar.xz -C build .
122125

123-
- name: Create binary ZIP archive and Signature
126+
- name: Build Linux packages
127+
if: ${{ env.GOARM == '7' || env.GOARM == '' }}
128+
run: |
129+
sudo apt install -y libarchive-tools
130+
sudo gem install fpm
131+
132+
case $GOARCH in
133+
'amd64' | 'i386' | 'arm64' | 'arm' | 'riscv64' | 'loong64' | 'ppc64' | 'ppc64le') archlinux_pacman='pacman' ;;
134+
*) echo "Skip unsupported architecture for Arch Linux" ;;
135+
esac
136+
137+
for pkg_mgr in deb rpm $archlinux_pacman; do
138+
case $GOARCH in
139+
'amd64')
140+
if [ $pkg_mgr == 'deb' ]; then
141+
pkg_arch='amd64'
142+
else
143+
pkg_arch='x86_64'
144+
fi ;;
145+
'386')
146+
case $pkg_mgr in
147+
'deb') pkg_arch='i386' ;;
148+
'rpm') pkg_arch='x86' ;;
149+
'pacman') pkg_arch'i486' ;;
150+
esac ;;
151+
'arm64')
152+
if [ $pkg_mgr == 'deb' ]; then
153+
pkg_arch='arm64'
154+
else
155+
pkg_arch='aarch64'
156+
fi ;;
157+
'arm')
158+
case $pkg_mgr in
159+
'deb') pkg_arch='armhf' ;;
160+
'rpm') pkg_arch='armhfp' ;;
161+
'pacman') pkg_arch='armv7h' ;;
162+
esac ;;
163+
'loong64')
164+
if [ $pkg_mgr != 'rpm' ]; then
165+
pkg_arch='loong64'
166+
else
167+
pkg_arch='loongarch64'
168+
fi ;;
169+
'mips64le') pkg_arch='mips64el' ;;
170+
'mipsle') pkg_arch='mipsel' ;;
171+
'ppc64le')
172+
if [ $pkg_mgr == 'deb' ]; then
173+
pkg_arch='ppc64el'
174+
else
175+
pkg_arch='ppc64le'
176+
fi ;;
177+
*) pkg_arch=$GOARCH ;;
178+
esac
179+
180+
fpm -s dir -t $pkg_mgr -a $pkg_arch -v ${VERSION/v/} -n dae \
181+
--url "https://github.com/daeuniverse/dae" \
182+
--description "eBPF-based Linux high-performance transparent proxy solution" \
183+
--maintainer "daeuniverse <[email protected]>" \
184+
--license 'AGPL-3.0' \
185+
--package ./bundled/dae-$ASSET_NAME.$pkg_mgr \
186+
--after-install ./install/package_after_install.sh \
187+
--after-remove ./install/package_after_remove.sh \
188+
--deb-compression xz \
189+
--deb-compression-level 9 \
190+
--rpm-compression xz \
191+
--verbose \
192+
-C build .
193+
done
194+
195+
if [ $archlinux_pacman == 'pacman' ]; then
196+
mv ./bundled/dae-$ASSET_NAME.pacman ./bundled/dae-$ASSET_NAME.pkg.tar.zst
197+
fi
198+
199+
- name: Create signature
124200
run: |
125-
pushd build || exit 1
126-
zip -9vr ../dae-$ASSET_NAME.zip .
127-
popd || exit 1
128-
FILE=./dae-$ASSET_NAME.zip
129-
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
130-
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
131-
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
132-
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
201+
cd bundled
202+
for FILE in *; do
203+
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
204+
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
205+
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
206+
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
207+
done
133208
134209
- name: Upload files to Artifacts
135210
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
136211
with:
137212
if-no-files-found: ignore
138-
path: |
139-
dae-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
140-
dae-${{ steps.get_filename.outputs.ASSET_NAME }}.zip.dgst
141-
dae-full-src.zip
142-
dae-full-src.zip.dgst
213+
path: ./bundled/*
143214

144215
upload-release:
145216
needs: [build]
@@ -152,16 +223,13 @@ jobs:
152223

153224
- name: Prepare files for upload
154225
run: |
155-
cp release/*/*.zip ./
156-
cp release/*/*.zip.dgst ./
157226
echo "Show files are going to upload..."
158-
ls -lh | grep ".zip"
227+
cd release
228+
ls -lh */*
159229
160230
- name: Upload full source and artifacts to GitHub release
161231
uses: softprops/action-gh-release@v2
162232
with:
163233
tag_name: ${{ inputs.tag }}
164-
files: |
165-
*zip
166-
*dgst
234+
files: release/*/*
167235
prerelease: true

.github/workflows/release.yml

+104-36
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
goos: [ linux ]
16-
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
16+
goarch: [ arm64, 386, riscv64, loong64, mips64, mips64le, mipsle, mips, ppc64, ppc64le, s390x ]
1717
include:
1818
# BEGIN Linux ARM 5 6 7
1919
- goos: linux
@@ -91,55 +91,126 @@ jobs:
9191
find ./go-mod/ -maxdepth 1 ! -name "cache" ! -name "go-mod" -exec rm -rf {} \;
9292
sed -i 's/#export GOMODCACHE=$(PWD)\/go-mod/export GOMODCACHE=$(PWD)\/go-mod/' Makefile
9393
94-
- name: Create full source ZIP archive and Signature
94+
- name: Create directory for placing archives & packages temporarily
95+
run: mkdir -p ./bundled/
96+
97+
- name: Create full source archive
9598
if: matrix.goarch == 'arm64'
9699
run: |
97-
zip -9vr dae-full-src.zip . -x .git/\*
98-
FILE=./dae-full-src.zip
99-
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
100-
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
101-
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
102-
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
100+
zip -9vr ./bundled/dae-full-src.zip . -x .git/\* bundled/\*
101+
tar -I 'xz -9' -cvf ./bundled/dae-full-src.tar.xz --exclude .git --exclude bundled .
103102
104103
- name: Build dae
105104
run: |
106-
mkdir -p ./build/
107105
export CGO_ENABLED=0
108106
export GOFLAGS="-trimpath -modcacherw"
109-
export OUTPUT=build/dae-$ASSET_NAME
110-
export VERSION=${{ steps.get_version.outputs.VERSION }}
107+
export OUTPUT=build/usr/bin/dae
108+
export VERSION=${{ env.VERSION }}
111109
export CLANG=clang-15
112110
export STRIP=llvm-strip-15
113111
make
114-
cp ./install/dae.service ./build/
115-
cp ./example.dae ./build/
116-
curl -L -o ./build/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
117-
curl -L -o ./build/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
112+
install -Dm644 ./install/dae.service -t ./build/usr/lib/systemd/system/
113+
install -Dm640 ./install/empty.dae ./build/etc/dae/config.dae
114+
install -Dm644 ./example.dae -t ./build/etc/dae/
115+
install -d ./build/usr/share/dae/
116+
curl -L -o ./build/usr/share/dae/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
117+
curl -L -o ./build/usr/share/dae/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
118118
119119
- name: Smoking test
120120
if: matrix.goarch == 'amd64' && matrix.goamd64 == 'v1'
121-
run: ./build/dae-$ASSET_NAME --version
121+
run: ./build/usr/bin/dae --version
122+
123+
- name: Create binary archive
124+
run: tar -cJvf ./bundled/dae-$ASSET_NAME.tar.xz -C build .
122125

123-
- name: Create binary ZIP archive and Signature
126+
- name: Build Linux packages
127+
if: ${{ env.GOARM == '7' || env.GOARM == '' }}
128+
run: |
129+
sudo apt install -y libarchive-tools
130+
sudo gem install fpm
131+
132+
case $GOARCH in
133+
'amd64' | 'i386' | 'arm64' | 'arm' | 'riscv64' | 'loong64' | 'ppc64' | 'ppc64le') archlinux_pacman='pacman' ;;
134+
*) echo "Skip unsupported architecture for Arch Linux" ;;
135+
esac
136+
137+
for pkg_mgr in deb rpm $archlinux_pacman; do
138+
case $GOARCH in
139+
'amd64')
140+
if [ $pkg_mgr == 'deb' ]; then
141+
pkg_arch='amd64'
142+
else
143+
pkg_arch='x86_64'
144+
fi ;;
145+
'386')
146+
case $pkg_mgr in
147+
'deb') pkg_arch='i386' ;;
148+
'rpm') pkg_arch='x86' ;;
149+
'pacman') pkg_arch'i486' ;;
150+
esac ;;
151+
'arm64')
152+
if [ $pkg_mgr == 'deb' ]; then
153+
pkg_arch='arm64'
154+
else
155+
pkg_arch='aarch64'
156+
fi ;;
157+
'arm')
158+
case $pkg_mgr in
159+
'deb') pkg_arch='armhf' ;;
160+
'rpm') pkg_arch='armhfp' ;;
161+
'pacman') pkg_arch='armv7h' ;;
162+
esac ;;
163+
'loong64')
164+
if [ $pkg_mgr != 'rpm' ]; then
165+
pkg_arch='loong64'
166+
else
167+
pkg_arch='loongarch64'
168+
fi ;;
169+
'mips64le') pkg_arch='mips64el' ;;
170+
'mipsle') pkg_arch='mipsel' ;;
171+
'ppc64le')
172+
if [ $pkg_mgr == 'deb' ]; then
173+
pkg_arch='ppc64el'
174+
else
175+
pkg_arch='ppc64le'
176+
fi ;;
177+
*) pkg_arch=$GOARCH ;;
178+
esac
179+
180+
fpm -s dir -t $pkg_mgr -a $pkg_arch -v ${VERSION/v/} -n dae \
181+
--url "https://github.com/daeuniverse/dae" \
182+
--description "eBPF-based Linux high-performance transparent proxy solution" \
183+
--maintainer "daeuniverse <[email protected]>" \
184+
--license 'AGPL-3.0' \
185+
--package ./bundled/dae-$ASSET_NAME.$pkg_mgr \
186+
--after-install ./install/package_after_install.sh \
187+
--after-remove ./install/package_after_remove.sh \
188+
--deb-compression xz \
189+
--deb-compression-level 9 \
190+
--rpm-compression xz \
191+
--verbose \
192+
-C build .
193+
done
194+
195+
if [ $archlinux_pacman == 'pacman' ]; then
196+
mv ./bundled/dae-$ASSET_NAME.pacman ./bundled/dae-$ASSET_NAME.pkg.tar.zst
197+
fi
198+
199+
- name: Create signature
124200
run: |
125-
pushd build || exit 1
126-
zip -9vr ../dae-$ASSET_NAME.zip .
127-
popd || exit 1
128-
FILE=./dae-$ASSET_NAME.zip
129-
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
130-
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
131-
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
132-
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
201+
cd bundled
202+
for FILE in *; do
203+
echo "$(md5sum $FILE)"" md5" >> $FILE.dgst
204+
echo "$(shasum -a 1 $FILE)"" sha1" >> $FILE.dgst
205+
echo "$(shasum -a 256 $FILE)"" sha256" >> $FILE.dgst
206+
echo "$(shasum -a 512 $FILE)"" sha512" >> $FILE.dgst
207+
done
133208
134209
- name: Upload files to Artifacts
135210
uses: nanoufo/action-upload-artifacts-and-release-assets@v2
136211
with:
137212
if-no-files-found: ignore
138-
path: |
139-
dae-${{ steps.get_filename.outputs.ASSET_NAME }}.zip
140-
dae-${{ steps.get_filename.outputs.ASSET_NAME }}.zip.dgst
141-
dae-full-src.zip
142-
dae-full-src.zip.dgst
213+
path: ./bundled/*
143214

144215
upload-release:
145216
needs: [build]
@@ -152,15 +223,12 @@ jobs:
152223

153224
- name: Prepare files for upload
154225
run: |
155-
cp release/*/*.zip ./
156-
cp release/*/*.zip.dgst ./
157226
echo "Show files are going to upload..."
158-
ls -lh | grep ".zip"
227+
cd release
228+
ls -lh */*
159229
160230
- name: Upload full source and artifacts to GitHub release
161231
uses: softprops/action-gh-release@v2
162232
with:
163233
tag_name: ${{ inputs.tag }}
164-
files: |
165-
*zip
166-
*dgst
234+
files: release/*/*

.github/workflows/seed-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
matrix:
3232
goos: [ linux ]
33-
goarch: [ arm64, 386, riscv64, mips64, mips64le, mipsle, mips ]
33+
goarch: [ arm64, 386, riscv64, loong64, mips64, mips64le, mipsle, mips, ppc64, ppc64le, s390x ]
3434
include:
3535
# BEGIN Linux ARM 5 6 7
3636
- goos: linux

0 commit comments

Comments
 (0)