-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CHERTS/dev-0.11.4
Release v0.11.4
- Loading branch information
Showing
46 changed files
with
1,005 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
ignore: | ||
- "screenshot" | ||
- "web" | ||
- "server/conf" | ||
- "server/files" | ||
- "^doc" | ||
- "^home" | ||
- "^web" | ||
- "^server/conf" | ||
- "^server/files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.idea/ | ||
anylink-deploy | ||
anylink-deploy.tar.gz | ||
anylink-deploy-* | ||
anylink | ||
anylink.db | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
version: 1 | ||
|
||
dist: dist | ||
|
||
before: | ||
hooks: | ||
- pwd | ||
|
||
builds: | ||
- id: "build" | ||
dir: ./server | ||
hooks: | ||
pre: | ||
- cmd: go mod tidy | ||
dir: ./server | ||
output: true | ||
- cmd: go generate | ||
dir: ./server | ||
output: true | ||
# {{- if eq .Arch "amd64" }}CC=x86_64-linux-gnu-gcc CXX=x86_64-linux-gnu-g++{{- end }} | ||
env: | ||
- CGO_ENABLED=1 | ||
- >- | ||
{{- if eq .Os "linux" }} | ||
{{- if eq .Arch "amd64" }}CC=x86_64-linux-musl-gcc{{- end }} | ||
{{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} | ||
{{- end }} | ||
{{- if eq .Os "darwin" }} | ||
{{- if eq .Arch "amd64"}}CC=o64-clang{{- end }} | ||
{{- if eq .Arch "arm64"}}CC=oa64-clang{{- end }} | ||
{{- end }} | ||
{{- if eq .Os "windows" }} | ||
{{- if eq .Arch "amd64"}}CC=x86_64-w64-mingw32-gcc{{- end }} | ||
{{- if eq .Arch "arm64"}}CC=aarch64-linux-gnu-gcc{{- end }} | ||
{{- end }} | ||
goos: | ||
- linux | ||
#- darwin | ||
#- windows | ||
goarch: | ||
- amd64 | ||
#- arm64 | ||
goamd64: | ||
- v1 | ||
command: build | ||
flags: | ||
- -trimpath | ||
- -tags osusergo,netgo,sqlite_omit_load_extension | ||
ldflags: | ||
- -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=dcross | ||
|
||
archives: | ||
- id: "archive1" | ||
format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of `uname`. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
function RETVAL() { | ||
rt=$1 | ||
if [ $rt != 0 ]; then | ||
echo $rt | ||
exit 1 | ||
fi | ||
} | ||
|
||
#Current directory | ||
cpath=$(pwd) | ||
ver=$(cat version) | ||
echo "Current version $ver" | ||
|
||
echo "Compile frontend project..." | ||
cd $cpath/web | ||
|
||
#npx browserslist@latest --update-db | ||
yarn install --registry=https://registry.npmmirror.com | ||
yarn run build | ||
RETVAL $? | ||
|
||
echo "Compile binaries..." | ||
cd $cpath/server | ||
rm -rf ui | ||
cp -rf $cpath/web/ui . | ||
|
||
# -tags osusergo,netgo,sqlite_omit_load_extension | ||
flags="-v -trimpath" | ||
|
||
# -extldflags '-static' | ||
ldflags="-s -w -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.date=$(date -Iseconds)" | ||
|
||
export GOPROXY=https://goproxy.io | ||
go mod tidy | ||
go build -o anylink $flags -ldflags "$ldflags" | ||
|
||
cd $cpath | ||
|
||
exit 0 | ||
|
||
echo "Build deployment files..." | ||
deploy="anylink-deploy" | ||
rm -rf $deploy ${deploy}.tar.gz | ||
mkdir $deploy | ||
mkdir $deploy/log | ||
cp -r server/anylink $deploy | ||
cp -r server/bridge-init.sh $deploy | ||
cp -r server/conf $deploy | ||
cp -r systemd $deploy | ||
cp -r LICENSE $deploy | ||
cp -r home $deploy | ||
tar zcvf ${deploy}.tar.gz $deploy | ||
|
||
# Make sure to run with root privileges | ||
#cd anylink-deploy | ||
#sudo ./anylink --conf="conf/server.toml" | ||
echo $ver | ||
#Front-end compilation only needs to be executed once | ||
#bash ./build_web.sh | ||
bash build_docker.sh | ||
|
||
deploy="anylink-deploy-$ver" | ||
docker container rm $deploy | ||
docker container create --name $deploy cherts/anylink:$ver | ||
rm -rf anylink-deploy anylink-deploy.tar.gz | ||
docker cp -a $deploy:/app ./anylink-deploy | ||
tar zcf ${deploy}.tar.gz anylink-deploy | ||
./anylink-deploy/anylink -v | ||
echo "anylink compilation completed, directory: anylink-deploy" | ||
ls -lh anylink-deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.