mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2024-11-21 14:53:08 +01:00
Update publish.yml
Update publish.yml Update publish.yml Update go.yml
This commit is contained in:
parent
cdb096b8e4
commit
acb750ea5e
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list > /dev/null
|
||||
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev
|
||||
sudo apt-get install -y libmemif libmemif-dev
|
||||
sudo apt-get install -y wireguard-tools upx-ucl
|
||||
|
||||
- name: Build x86_64
|
||||
@ -77,7 +77,7 @@ jobs:
|
||||
add-apt-repository ppa:longsleep/golang-backports
|
||||
|
||||
apt-get -y update
|
||||
apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev || true
|
||||
apt-get install -y libmemif libmemif-dev || true
|
||||
apt-get install -y wireguard-tools golang-go build-essential git
|
||||
run: |
|
||||
make all static
|
||||
|
38
.github/workflows/publish.yml
vendored
38
.github/workflows/publish.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list > /dev/null
|
||||
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
|
||||
sudo apt-get -y update
|
||||
sudo apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev
|
||||
sudo apt-get install -y libmemif libmemif-dev
|
||||
sudo apt-get install -y wireguard-tools upx-ucl
|
||||
|
||||
- name: Build x86_64
|
||||
@ -38,6 +38,7 @@ jobs:
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go
|
||||
overwrite: true
|
||||
asset_name: etherguard-go-x86_64
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
@ -46,7 +47,8 @@ jobs:
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go-vpp
|
||||
asset_name: etherguard-go-x86_64
|
||||
overwrite: true
|
||||
asset_name: etherguard-go-vpp-x86_64
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
- name: Upload x86_64 static build
|
||||
@ -54,6 +56,7 @@ jobs:
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go-static
|
||||
overwrite: true
|
||||
asset_name: etherguard-go-static-x86_64
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
@ -74,24 +77,16 @@ jobs:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go
|
||||
asset_name: etherguard-go-mipsle
|
||||
overwrite: true
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
|
||||
- name: Upload mipsle dynamic vpp build
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go-vpp
|
||||
asset_name: etherguard-go-mipsle
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
|
||||
- name: Upload mipsle static build
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: etherguard-go-static
|
||||
asset_name: etherguard-go-static-mipsle
|
||||
overwrite: true
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
multi-arch:
|
||||
@ -128,7 +123,7 @@ jobs:
|
||||
add-apt-repository ppa:longsleep/golang-backports
|
||||
|
||||
apt-get -y update
|
||||
apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev || true
|
||||
apt-get install -y libmemif libmemif-dev || true
|
||||
apt-get install -y wireguard-tools golang-go build-essential git
|
||||
run: |
|
||||
make all static
|
||||
@ -152,8 +147,9 @@ jobs:
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: artifacts/${{ martix.arch }}/etherguard-go
|
||||
asset_name: etherguard-go-${{ martix.arch }}
|
||||
file: artifacts/${{ matrix.arch }}/etherguard-go
|
||||
asset_name: etherguard-go-${{ matrix.arch }}
|
||||
overwrite: true
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
- name: Upload ${{ matrix.arch }} dynamic vpp build
|
||||
@ -161,14 +157,16 @@ jobs:
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: artifacts/${{ martix.arch }}/etherguard-go
|
||||
asset_name: etherguard-go-${{ martix.arch }}
|
||||
file: artifacts/${{ matrix.arch }}/etherguard-go
|
||||
asset_name: etherguard-go-vpp-${{ matrix.arch }}
|
||||
overwrite: true
|
||||
tag: ${{ github.ref }}
|
||||
|
||||
- name: Upload ${{ matrix.arch }} static build
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: artifacts/${{ martix.arch }}/etherguard-go-static
|
||||
asset_name: etherguard-go-static-${{ martix.arch }}
|
||||
tag: ${{ github.ref }}
|
||||
file: artifacts/${{ matrix.arch }}/etherguard-go-static
|
||||
asset_name: etherguard-go-static-${{ matrix.arch }}
|
||||
overwrite: true
|
||||
tag: ${{ github.ref }}
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
etherguard-go
|
||||
etherguard-go-vpp
|
||||
etherguard-go-static
|
||||
vendor
|
||||
.ipynb_checkpoints
|
@ -11,7 +11,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net"
|
||||
"sort"
|
||||
"sync"
|
||||
@ -187,19 +186,8 @@ func (f *filterwindow) Push(e float64) float64 {
|
||||
f.value = e
|
||||
return f.value
|
||||
}
|
||||
pivot := ((elemlen + 1) / 2) - 1
|
||||
left := window[:pivot+1]
|
||||
right := window[pivot:]
|
||||
lm := f.filter(left, 1)
|
||||
rm := f.filter(right, 2)
|
||||
pv := window[pivot]
|
||||
ldiff := math.Abs(lm - pv)
|
||||
rdiff := math.Abs(rm - pv)
|
||||
if ldiff < rdiff {
|
||||
f.value = lm
|
||||
} else {
|
||||
f.value = rm
|
||||
}
|
||||
f.value = f.filter(window, 2)
|
||||
|
||||
return f.value
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user