Skip to content

Commit faf7450

Browse files
committed
Use GO111 modules with go mod vendor, update bump version script
1 parent 4b6f02f commit faf7450

File tree

4 files changed

+105
-11
lines changed

4 files changed

+105
-11
lines changed

.github/workflows/windows.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
integration_tests:
99
strategy:
1010
matrix:
11-
go-versions: [1.13.x]
11+
go: ['1.16']
1212
platform: [windows-latest]
1313
runs-on: ${{ matrix.platform }}
1414
steps:
1515
- name: Install Go
16-
uses: actions/setup-go@v1
16+
uses: actions/setup-go@v2
1717
with:
1818
go-version: ${{ matrix.go-version }}
1919
- name: Checkout code
@@ -36,14 +36,14 @@ jobs:
3636
unit_tests:
3737
strategy:
3838
matrix:
39-
go-versions: [1.13.x]
39+
go: ['1.16']
4040
platform: [windows-latest]
4141
runs-on: ${{ matrix.platform }}
4242
steps:
4343
- name: Install Go
44-
uses: actions/setup-go@v1
44+
uses: actions/setup-go@v2
4545
with:
46-
go-version: ${{ matrix.go-version }}
46+
go-version: ${{ matrix.go }}
4747
- name: Checkout code
4848
uses: actions/checkout@v2
4949
- name: Run Windows Unit Tests
@@ -53,16 +53,32 @@ jobs:
5353
bump_version_test:
5454
strategy:
5555
matrix:
56-
go-versions: [1.16.x]
56+
go: ['1.16']
5757
platform: [ubuntu-latest]
5858
runs-on: ${{ matrix.platform }}
5959
steps:
6060
- name: Install Go
61-
uses: actions/setup-go@v1
61+
uses: actions/setup-go@v2
6262
with:
63-
go-version: ${{ matrix.go-version }}
63+
go-version: ${{ matrix.go }}
64+
- name: Install Tools
65+
run: |
66+
echo "${HOME}/.local/bin" >> $GITHUB_PATH
67+
echo "/home/runner/work/csi-proxy/csi-proxy/go/bin" >> $GITHUB_PATH
68+
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
69+
curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
70+
unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/.local
6471
- name: Checkout code
6572
uses: actions/checkout@v2
73+
with:
74+
fetch-depth: 1
75+
path: go/src/github.com/kubernetes-csi/csi-proxy
6676
- name: Run bump version script
77+
env:
78+
GOPATH: /home/runner/work/csi-proxy/csi-proxy/go
79+
GOBIN: /home/runner/work/csi-proxy/csi-proxy/go/bin
6780
run: |
81+
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
82+
protoc --version
83+
cd /home/runner/work/csi-proxy/csi-proxy/go/src/github.com/kubernetes-csi/csi-proxy
6884
API_GROUP=filesystem OLD_API_VERSION=v1beta2 NEW_API_VERSION=v99 scripts/bump-version.sh

scripts/bump-version.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ function generate_client_files {
3535
# the path to regenerate
3636
target=$1
3737

38-
# delete the vendor folder, otherwise generate-protobuf is going to create a wrong path
38+
# delete the vendor folder, otherwise generate-protobuf is going to create a wrong path in the api.pb.go file
3939
rm -rf vendor
40-
40+
rm client/api/$target/api.pb.go || true
4141
rm client/groups/$target/client_generated.go || true
4242

4343
# generate client_generated.go
@@ -77,7 +77,7 @@ function bump_server {
7777

7878
# it looks like at this point client/groups/<version>/client_generated.go is generated
7979
# sync it to the vendor folder
80-
go mod vendor
80+
env GO111MODULE=on go mod vendor
8181
}
8282

8383
function bump_integration {
@@ -116,6 +116,9 @@ EOF
116116
}
117117

118118
function main {
119+
printenv | sort | uniq
120+
protoc --version
121+
119122
validate_args
120123
bump_client
121124
bump_server

vendor/github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1/client_generated.go

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1alpha1
5858
github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta1
5959
github.com/kubernetes-csi/csi-proxy/client/groups/filesystem/v1beta2
6060
github.com/kubernetes-csi/csi-proxy/client/groups/iscsi/v1alpha2
61+
github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1
6162
github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1alpha1
6263
github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1beta1
6364
github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1beta2

0 commit comments

Comments
 (0)