Skip to content

Commit

Permalink
feat(go):更新至go1.21
Browse files Browse the repository at this point in the history
feat(github):添加自动构建action
  • Loading branch information
li1553770945 committed Nov 7, 2023
1 parent e5a6036 commit 605c90f
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 79 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Build project
run: |
chmod +x build.sh
./build.sh
working-directory: . # 替换成你的仓库路径

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: output
path: output
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/file
/files
conf
personal-page-be
main
4 changes: 3 additions & 1 deletion .idea/personal-page-be.iml

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

2 changes: 1 addition & 1 deletion biz/internal/service/global_service/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func (s *GlobalService) DeleteFile() {
root := "./file"
root := "./files"
files, err := os.ReadDir(root)
if err != nil {
panic(err)
Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
RUN_NAME="personal-page-be"
mkdir -p output/bin
cp run.sh output
go env -w GOPROXY=https://goproxy.cn
go build -o output/bin/${RUN_NAME}
34 changes: 18 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
module personal-page-be

go 1.19
go 1.21

require (
github.com/cloudwego/hertz v0.5.2
github.com/google/uuid v1.3.0
github.com/cloudwego/hertz v0.7.1
github.com/google/uuid v1.4.0
github.com/google/wire v0.5.0
github.com/hertz-contrib/sessions v1.0.1
github.com/hertz-contrib/sessions v1.0.2
github.com/hertz-contrib/websocket v0.0.1
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.0
golang.org/x/crypto v0.6.0
golang.org/x/sync v0.1.0
github.com/sirupsen/logrus v1.9.3
golang.org/x/crypto v0.14.0
golang.org/x/sync v0.5.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/postgres v1.4.8
gorm.io/gorm v1.24.5
gorm.io/driver/postgres v1.5.4
gorm.io/gorm v1.25.5
)

require (
github.com/bytedance/go-tagexpr/v2 v2.9.2 // indirect
github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7 // indirect
github.com/bytedance/sonic v1.5.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 // indirect
github.com/cloudwego/netpoll v0.3.1 // indirect
github.com/bytedance/sonic v1.8.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cloudwego/netpoll v0.5.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/gorilla/context v1.1.1 // indirect
Expand All @@ -33,18 +33,20 @@ require (
github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgx/v5 v5.3.0 // indirect
github.com/jackc/pgx/v5 v5.4.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/nyaruka/phonenumbers v1.0.55 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d // indirect
github.com/tidwall/gjson v1.13.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading

0 comments on commit 605c90f

Please sign in to comment.