Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
9cc14b80b9 | |||
85410e1f25 | |||
6fce893428 | |||
2dd7a87f4c | |||
c6d1b7aff4 | |||
dc0dc1cfe1 | |||
e0bec5ad2b | |||
d7e63975b9 | |||
394a297368 | |||
10a9eab542 | |||
368a44ff73 | |||
4209aa6738 | |||
e22053ce2c |
@ -1,8 +1,15 @@
|
|||||||
name: alpha
|
name: prerelease
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- Alpha
|
||||||
|
- Beta
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- Alpha
|
||||||
|
- Beta
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
Build:
|
||||||
if: ${{ !contains(github.event.head_commit.message, '[Skip CI]') }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Get latest go version
|
- name: Get latest go version
|
||||||
@ -24,9 +31,10 @@ jobs:
|
|||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
# - name: Get dependencies, run test
|
- name: Test
|
||||||
# run: |
|
if: ${{env.GITHUB_REF_NAME=='Beta'}}
|
||||||
# go test ./...
|
run: |
|
||||||
|
go test ./...
|
||||||
- name: Build
|
- name: Build
|
||||||
if: success()
|
if: success()
|
||||||
env:
|
env:
|
||||||
@ -38,34 +46,22 @@ jobs:
|
|||||||
uses: andreaswilli/delete-release-assets-action@v2.0.0
|
uses: andreaswilli/delete-release-assets-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: alpha
|
tag: ${{ env.GITHUB_REF_NAME }}
|
||||||
deleteOnlyFromDrafts: false
|
deleteOnlyFromDrafts: false
|
||||||
|
|
||||||
- name: Tag Repo
|
- name: Tag Repo
|
||||||
uses: richardsimko/update-tag@v1
|
uses: richardsimko/update-tag@v1
|
||||||
with:
|
with:
|
||||||
tag_name: alpha
|
tag_name: ${{env.GITHUB_REF_NAME}}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Upload Alpha
|
- name: Upload Alpha
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: ${{ env.GIT_BRANCH != 'Meta' && success() }}
|
if: ${{ success() }}
|
||||||
with:
|
with:
|
||||||
tag: ${{ github.ref }}
|
tag: ${{env.GITHUB_REF_NAME}}
|
||||||
tag_name: alpha
|
tag_name: ${{env.GITHUB_REF_NAME}}
|
||||||
files: bin/*
|
files: bin/*
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
generate_release_notes: true
|
||||||
# - name: send telegram message on push
|
|
||||||
# uses: appleboy/telegram-action@master
|
|
||||||
# with:
|
|
||||||
# to: ${{ secrets.TTELEGRAM_CHAT_ID }}
|
|
||||||
# token: ${{ secrets.TELEGRAM_TOKEN }}
|
|
||||||
# message: |
|
|
||||||
# ${{ github.actor }} created commit:
|
|
||||||
# Commit message: ${{ github.event.commits[0].message }}
|
|
||||||
#
|
|
||||||
# Repository: ${{ github.repository }}
|
|
||||||
#
|
|
||||||
# See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
|
44
.github/workflows/release.yaml
vendored
Normal file
44
.github/workflows/release.yaml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get latest go version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: ${{ steps.version.outputs.go_version }}
|
||||||
|
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Cache go module
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
go test ./...
|
||||||
|
- name: Build
|
||||||
|
if: success()
|
||||||
|
env:
|
||||||
|
NAME: Clash.Meta
|
||||||
|
BINDIR: bin
|
||||||
|
run: make -j releases
|
||||||
|
|
||||||
|
- name: Upload Alpha
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: ${{ success() && startsWith(github.ref, 'refs/tags/')}}
|
||||||
|
with:
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
files: bin/*
|
||||||
|
generate_release_notes: true
|
9
Makefile
9
Makefile
@ -1,7 +1,16 @@
|
|||||||
NAME=Clash.Meta
|
NAME=Clash.Meta
|
||||||
BINDIR=bin
|
BINDIR=bin
|
||||||
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
ifeq ($(BRANCH),Alpha)
|
||||||
VERSION=alpha-$(shell git rev-parse --short HEAD)
|
VERSION=alpha-$(shell git rev-parse --short HEAD)
|
||||||
|
else ifeq ($(BRANCH),Beta)
|
||||||
|
VERSION=beta-$(shell git rev-parse --short HEAD)
|
||||||
|
else ifeq ($(BRANCH),Meta)
|
||||||
|
VERSION=$(shell git describe --tags)
|
||||||
|
else
|
||||||
|
VERSION=unknown
|
||||||
|
endif
|
||||||
|
|
||||||
BUILDTIME=$(shell date -u)
|
BUILDTIME=$(shell date -u)
|
||||||
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=$(VERSION)" \
|
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=$(VERSION)" \
|
||||||
-X "github.com/Dreamacro/clash/constant.BuildTime=$(BUILDTIME)" \
|
-X "github.com/Dreamacro/clash/constant.BuildTime=$(BUILDTIME)" \
|
||||||
|
@ -44,7 +44,7 @@ func Start(device io.ReadWriter, gateway, portal, broadcast netip.Addr) (*TCP, *
|
|||||||
for {
|
for {
|
||||||
n, err := device.Read(buf)
|
n, err := device.Read(buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnln("system error:%s", err.Error())
|
log.Errorf("system error:%s", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func Test_SumNeon(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compat := SumCompat(bytes[:size])
|
compat := SumCompat(bytes[:size])
|
||||||
neon := sumNeon(bytes[:size])
|
neon := SumNeon(bytes[:size])
|
||||||
|
|
||||||
if compat != neon {
|
if compat != neon {
|
||||||
t.Errorf("Sum of length=%d mismatched", size)
|
t.Errorf("Sum of length=%d mismatched", size)
|
||||||
@ -46,6 +46,6 @@ func Benchmark_SumNeon(b *testing.B) {
|
|||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
sumNeon(bytes)
|
SumNeon(bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user