Skip to content

Commit 1267356

Browse files
committed
feat: upgrade to Go 1.21, fix CI errors
1 parent fe5ccd4 commit 1267356

File tree

3 files changed

+66
-35
lines changed

3 files changed

+66
-35
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
name: Build
22

3-
on: [push, pull_request]
4-
3+
on: [ push, pull_request ]
4+
55
jobs:
66

77
frontend:
88
name: Front-end
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
13-
with:
14-
node-version: 16
15-
- uses: c-hive/gha-yarn-cache@v2
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
1613
with:
17-
directory: ./web
14+
node-version: 20
15+
cache: 'yarn'
16+
cache-dependency-path: ./web/yarn.lock
1817
- run: yarn install && CI=false yarn run build
1918
working-directory: ./web
2019

@@ -23,29 +22,35 @@ jobs:
2322
runs-on: ubuntu-latest
2423
steps:
2524
- uses: actions/checkout@v3
26-
- uses: actions/setup-go@v3
25+
- uses: actions/setup-go@v4
2726
with:
2827
go-version: '^1.16.5'
29-
28+
cache-dependency-path: ./go.mod
29+
- run: go version
3030
- name: Build
3131
run: |
3232
go build -race -ldflags "-extldflags '-static'"
3333
working-directory: ./
34-
34+
3535
linter:
3636
name: Go-Linter
3737
runs-on: ubuntu-latest
38+
needs: [ go-tests ]
3839
steps:
3940
- uses: actions/checkout@v3
40-
- uses: actions/setup-go@v3
41+
- uses: actions/setup-go@v4
4142
with:
4243
go-version: '^1.16.5'
43-
44+
cache: false
45+
46+
# gen a dummy config file
47+
- run: touch dummy.yml
48+
4449
- name: golangci-lint
4550
uses: golangci/golangci-lint-action@v3
4651
with:
47-
version: v1.29
48-
args: --disable-all -E gofumpt --max-same-issues=0 --max-issues-per-linter=0 --timeout 5m ./...
52+
version: latest
53+
args: --disable-all -c dummy.yml -E=gofumpt --max-same-issues=0 --timeout 5m --modules-download-mode=mod
4954

5055
release-and-push:
5156
name: Release And Push
@@ -54,13 +59,13 @@ jobs:
5459
needs: [ frontend, backend, linter ]
5560
steps:
5661
- name: Checkout
57-
uses: actions/checkout@v2
62+
uses: actions/checkout@v3
5863
with:
59-
fetch-depth: 0
64+
fetch-depth: -1
6065
- name: Setup Node.js
61-
uses: actions/setup-node@v2
66+
uses: actions/setup-node@v3
6267
with:
63-
node-version: 16
68+
node-version: 20
6469

6570
- name: Fetch Previous version
6671
id: get-previous-tag
@@ -69,7 +74,7 @@ jobs:
6974
- name: Release
7075
run: yarn global add [email protected] && semantic-release
7176
env:
72-
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
77+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7378

7479
- name: Fetch Current version
7580
id: get-current-tag
@@ -86,23 +91,23 @@ jobs:
8691
8792
if [ ${old_array[0]} != ${new_array[0]} ]
8893
then
89-
echo "push='true'" >> GITHUB_OUTPUT
94+
echo ::set-output name=push::'true'
9095
elif [ ${old_array[1]} != ${new_array[1]} ]
9196
then
92-
echo "push='true'" >> GITHUB_OUTPUT
97+
echo ::set-output name=push::'true'
9398
else
94-
echo "push='false'" >> GITHUB_OUTPUT
99+
echo ::set-output name=push::'false'
95100
fi
96101
97102
- name: Log in to Docker Hub
98103
uses: docker/login-action@v1
99-
if: github.repository == 'casbin/casnode' && github.event_name == 'push' &&steps.should_push.outputs.push=='true'
104+
if: github.repository == 'casbin/casnode' && github.event_name == 'push' && steps.should_push.outputs.push=='true'
100105
with:
101106
username: ${{ secrets.DOCKERHUB_USERNAME }}
102107
password: ${{ secrets.DOCKERHUB_PASSWORD }}
103108

104109
- name: Push to Docker Hub
105-
uses: docker/build-push-action@v2
110+
uses: docker/build-push-action@v3
106111
if: github.repository == 'casbin/casnode' && github.event_name == 'push' && steps.should_push.outputs.push=='true'
107112
with:
108113
push: true

go.mod

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,63 @@
11
module github.com/casbin/casnode
22

3-
go 1.16
3+
go 1.21
44

55
require (
6-
github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect
76
github.com/astaxie/beego v1.12.3
87
github.com/casbin/google-groups-crawler v0.1.3
98
github.com/casdoor/casdoor-go-sdk v0.30.1
109
github.com/chromedp/chromedp v0.8.4
11-
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
1210
github.com/go-sql-driver/mysql v1.5.0
13-
github.com/golang/protobuf v1.5.2 // indirect
1411
github.com/gomarkdown/markdown v0.0.0-20210408062403-ad838ccf8cdd
1512
github.com/huichen/sego v0.0.0-20180617034105-3f3c8a8cfacc
1613
github.com/issue9/assert v1.4.1
17-
github.com/lib/pq v1.10.2 // indirect
1814
github.com/microcosm-cc/bluemonday v1.0.5
1915
github.com/mileusna/crontab v1.0.1
2016
github.com/mozillazg/go-slugify v0.2.0
17+
github.com/sromku/go-gitter v0.0.0-20170828210750-70f7030a94a6
18+
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
19+
xorm.io/core v0.7.2
20+
xorm.io/xorm v0.8.1
21+
)
22+
23+
require (
24+
github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect
25+
github.com/aymerick/douceur v0.2.0 // indirect
26+
github.com/beorn7/perks v1.0.1 // indirect
27+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
28+
github.com/chris-ramon/douceur v0.2.0 // indirect
29+
github.com/chromedp/cdproto v0.0.0-20220812200530-d0d83820bffc // indirect
30+
github.com/chromedp/sysutil v1.0.0 // indirect
31+
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
32+
github.com/gobwas/httphead v0.1.0 // indirect
33+
github.com/gobwas/pool v0.2.1 // indirect
34+
github.com/gobwas/ws v1.1.0 // indirect
35+
github.com/golang-jwt/jwt/v4 v4.1.0 // indirect
36+
github.com/golang/protobuf v1.5.2 // indirect
37+
github.com/gomodule/redigo v2.0.0+incompatible // indirect
38+
github.com/gorilla/css v1.0.0 // indirect
39+
github.com/hashicorp/golang-lru v0.5.4 // indirect
40+
github.com/josharian/intern v1.0.0 // indirect
41+
github.com/lib/pq v1.10.2 // indirect
42+
github.com/mailru/easyjson v0.7.7 // indirect
43+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
2144
github.com/mozillazg/go-unidecode v0.1.1 // indirect
2245
github.com/mreiferson/go-httpclient v0.0.0-20201222173833-5e475fde3a4d // indirect
2346
github.com/mrexodia/wray v0.0.0-20160318003008-78a2c1f284ff // indirect
2447
github.com/prometheus/client_golang v1.11.0 // indirect
48+
github.com/prometheus/client_model v0.2.0 // indirect
49+
github.com/prometheus/common v0.26.0 // indirect
50+
github.com/prometheus/procfs v0.6.0 // indirect
2551
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
2652
github.com/smartystreets/goconvey v1.7.2 // indirect
27-
github.com/sromku/go-gitter v0.0.0-20170828210750-70f7030a94a6
2853
github.com/stretchr/testify v1.7.0 // indirect
2954
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
30-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
55+
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
56+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
3157
golang.org/x/text v0.3.5 // indirect
58+
google.golang.org/appengine v1.6.6 // indirect
59+
google.golang.org/protobuf v1.26.0 // indirect
3260
gopkg.in/yaml.v2 v2.4.0 // indirect
3361
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
34-
xorm.io/core v0.7.2
35-
xorm.io/xorm v0.8.1
62+
xorm.io/builder v0.3.6 // indirect
3663
)

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
411411
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
412412
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
413413
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
414-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
415414
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
416415
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
417416
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=

0 commit comments

Comments
 (0)