Skip to content

Commit

Permalink
Chore: use Go v1.17 & support Windows ARM64 (p4gefau1t#377)
Browse files Browse the repository at this point in the history
* Chore: use Go v1.17 & support Windows ARM64
* Chore: update workflow
  • Loading branch information
Loyalsoldier authored Aug 28, 2021
1 parent 07fec5e commit 98cfe18
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 68 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ["1.16"]
go-version: ["1.17"]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -37,5 37,4 @@ jobs:

- name: Build
run: |
make geosite.dat geoip.dat
make release -j$(nproc)
16 changes: 7 additions & 9 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.16"
go-version: "1.17"

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -25,15 25,13 @@ jobs:
- name: Build
run: |
make geosite.dat geoip.dat
make release -j$(nproc)
- name: Release
uses: softprops/action-gh-release@v1
uses: svenstaro/upload-release-action@v2
with:
draft: true
name: ${{ env.TAG_NAME }}
tag_name: ${{ env.TAG_NAME }}
files: ./trojan-go-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG_NAME }}
file: ./trojan-go-*.zip
file_glob: true
prerelease: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ["1.16"]
go-version: ["1.17"]
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 14,7 @@
# Dependency directories (remove the comment below to include it)
# vendor/

build/
*.DS_Store
*.zip
*.tar.gz
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 19,9 @@ clean:
geoip.dat:
wget https://github.com/v2fly/geoip/raw/release/geoip.dat

geoip-only-cn-private.dat:
wget https://github.com/v2fly/geoip/raw/release/geoip-only-cn-private.dat

geosite.dat:
wget https://github.com/v2fly/domain-list-community/raw/release/dlc.dat -O geosite.dat

Expand All @@ -30,7 33,7 @@ trojan-go:
mkdir -p $(BUILD_DIR)
$(GOBUILD)

install: $(BUILD_DIR)/$(NAME) geoip.dat geosite.dat
install: $(BUILD_DIR)/$(NAME) geoip.dat geoip-only-cn-private.dat geosite.dat
mkdir -p /etc/$(NAME)
mkdir -p /usr/share/$(NAME)
cp example/*.json /etc/$(NAME)
Expand All @@ -40,7 43,9 @@ install: $(BUILD_DIR)/$(NAME) geoip.dat geosite.dat
systemctl daemon-reload
cp geosite.dat /usr/share/$(NAME)/geosite.dat
cp geoip.dat /usr/share/$(NAME)/geoip.dat
cp geoip-only-cn-private.dat /usr/share/$(NAME)/geoip-only-cn-private.dat
ln -fs /usr/share/$(NAME)/geoip.dat /usr/bin/
ln -fs /usr/share/$(NAME)/geoip-only-cn-private.dat /usr/bin/
ln -fs /usr/share/$(NAME)/geosite.dat /usr/bin/

uninstall:
Expand All @@ -51,19 56,20 @@ uninstall:
rm -rd /etc/$(NAME)
rm -rd /usr/share/$(NAME)
rm /usr/bin/geoip.dat
rm /usr/bin/geoip-only-cn-private.dat
rm /usr/bin/geosite.dat

%.zip: % geosite.dat geoip.dat
%.zip: % geosite.dat geoip.dat geoip-only-cn-private.dat
@zip -du $(NAME)-$@ -j $(BUILD_DIR)/$</*
@zip -du $(NAME)-$@ example/*
@-zip -du $(NAME)-$@ *.dat
@echo "<<< ---- $(NAME)-$@"

release: geosite.dat geoip.dat darwin-amd64.zip darwin-arm64.zip linux-386.zip linux-amd64.zip \
release: geosite.dat geoip.dat geoip-only-cn-private.dat darwin-amd64.zip darwin-arm64.zip linux-386.zip linux-amd64.zip \
linux-arm.zip linux-armv5.zip linux-armv6.zip linux-armv7.zip linux-armv8.zip \
linux-mips-softfloat.zip linux-mips-hardfloat.zip linux-mipsle-softfloat.zip linux-mipsle-hardfloat.zip \
linux-mips64.zip linux-mips64le.zip freebsd-386.zip freebsd-amd64.zip \
windows-386.zip windows-amd64.zip windows-arm.zip windows-armv6.zip windows-armv7.zip
windows-386.zip windows-amd64.zip windows-arm.zip windows-armv6.zip windows-armv7.zip windows-arm64.zip

darwin-amd64:
mkdir -p $(BUILD_DIR)/$@
Expand Down Expand Up @@ -152,3 158,7 @@ windows-armv6:
windows-armv7:
mkdir -p $(BUILD_DIR)/$@
GOARCH=arm GOOS=windows GOARM=7 $(GOBUILD)/$@

windows-arm64:
mkdir -p $(BUILD_DIR)/$@
GOARCH=arm64 GOOS=windows $(GOBUILD)/$@
4 changes: 2 additions & 2 deletions api/service/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 28 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 1,39 @@
module github.com/p4gefau1t/trojan-go

go 1.16
go 1.17

require (
github.com/go-sql-driver/mysql v1.6.0
github.com/patrickmn/go-cache v2.1.0 incompatible // indirect
github.com/refraction-networking/utls v0.0.0-20201210053706-2179f286686b
github.com/refraction-networking/utls v0.0.0-20210713165636-0b2885c8c0d4
github.com/shadowsocks/go-shadowsocks2 v0.1.5
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/testify v1.7.0
github.com/txthinking/runnergroup v0.0.0-20210326110939-37fc67d0da7c // indirect
github.com/txthinking/socks5 v0.0.0-20210326104807-61b5745ff346
github.com/txthinking/x v0.0.0-20210326105829-476fab902fbe // indirect
github.com/v2fly/v2ray-core/v4 v4.39.2
github.com/txthinking/socks5 v0.0.0-20210716140126-fa1f52a8f2da
github.com/v2fly/v2ray-core/v4 v4.41.1
github.com/xtaci/smux v1.5.15
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/grpc v1.38.0
google.golang.org/protobuf v1.26.0
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gopherjs/gopherjs v0.0.0-20210420193930-a4630ec28c79 // indirect
github.com/jtolds/gls v4.20.0 incompatible // indirect
github.com/patrickmn/go-cache v2.1.0 incompatible // indirect
github.com/pires/go-proxyproto v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/txthinking/runnergroup v0.0.0-20210608031112-152c7c4432bf // indirect
github.com/txthinking/x v0.0.0-20210326105829-476fab902fbe // indirect
go.starlark.net v0.0.0-20210602144842-1cdb82c9e17a // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
)
Loading

0 comments on commit 98cfe18

Please sign in to comment.