File tree 2 files changed +73
-0
lines changed 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Release
2
+ on :
3
+ push :
4
+ tags :
5
+ - ' *'
6
+ jobs :
7
+ build :
8
+ runs-on : " ubuntu-latest"
9
+ container : " debian:10.3"
10
+ strategy :
11
+ matrix :
12
+ node-version : [14]
13
+ steps :
14
+ - name : Set up Go 1.18.x
15
+ uses : actions/setup-go@v2
16
+ with :
17
+ go-version : 1.18.x
18
+ id : go
19
+
20
+ - name : Instasll tools
21
+ shell : bash
22
+ run : " apt update && apt install make curl gcc ca-certificates zip git -y"
23
+
24
+ - name : Install gox
25
+ run : go install github.com/mitchellh/gox@master
26
+
27
+ - name : Instasll node apt repo
28
+ shell : bash
29
+ run : " curl -sL https://deb.nodesource.com/setup_14.x | bash -"
30
+
31
+ - name : Instasll node
32
+ shell : bash
33
+ run : " apt install nodejs -y"
34
+
35
+ - name : Step pnpm
36
+
37
+ with :
38
+ version : latest
39
+
40
+ - name : Checkout
41
+ uses : actions/checkout@v2
42
+
43
+ - name : Build frontend
44
+ run : make build-frontend
45
+
46
+ - name : Build go binary
47
+ shell : bash
48
+ run : gox -osarch='darwin/arm64 darwin/amd64 windows/arm64 windows/amd64 linux/arm64 linux/amd64' -ldflags="
49
+ -X main.Version=$(git describe --tags $(git rev-parse HEAD))
50
+ -X main.Commit=$(git rev-parse HEAD)" ./
51
+
52
+ - name : compress go binary
53
+ shell : bash
54
+ run : for i in edgeRec_*; do zip "$(echo $i | sed 's/\..*//').zip" $i; done
55
+
56
+ - name : Upload Release
57
+ uses : softprops/action-gh-release@v1
58
+ with :
59
+ files : edgeRec*.zip
60
+ draft : true
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
3
3
import (
4
4
"context"
5
5
"embed"
6
+ "flag"
6
7
"github.com/auxten/edgeRec/example/movielens"
7
8
nn "github.com/auxten/edgeRec/nn/neural_network"
8
9
rcmd "github.com/auxten/edgeRec/recommend"
@@ -12,7 +13,19 @@ import (
12
13
//go:embed frontend/website/*
13
14
var f embed.FS
14
15
16
+ var verFlag = flag .Bool ("v" , false , "show binary version" )
17
+
18
+ var Version = "unknown-version"
19
+ var Commit = "unknown-commit"
20
+
15
21
func main () {
22
+ flag .Parse ()
23
+ if * verFlag {
24
+ log .Println ("Version: " , Version )
25
+ log .Println ("Commit: " , Commit )
26
+ return
27
+ }
28
+
16
29
var (
17
30
recSys = & movielens.RecSysImpl {
18
31
DataPath : "movielens.db" ,
You can’t perform that action at this time.
0 commit comments