Skip to content

Commit fa5add8

Browse files
committed
feat: improve Docker workflow for plugin builds by disabling workspace mode
- Replaced vendor directory creation with disabling workspace mode to ensure consistent plugin builds. - Updated go mod tidy commands to run with GOWORK=off for reliable dependency management across SQLite, MySQL, and PostgreSQL plugins. - Enhanced environment variable settings in the build process to maintain consistency and clarity.
1 parent 5ed25b4 commit fa5add8

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/docker-deploy.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ jobs:
8888
go mod verify
8989
go mod tidy
9090
91-
# Create vendor directory to ensure consistent builds
92-
go mod vendor
91+
# Disable workspace mode for consistent plugin builds
92+
export GOWORK=off
9393
9494
GO_RELEASE_V=$(go version | { read _ _ v _; echo ${v#go}; })
9595
@@ -108,11 +108,11 @@ jobs:
108108
109109
# Add plugin-specific dependencies
110110
go mod edit -require=github.com/mattn/go-sqlite3@v1.14.15
111-
go mod tidy
111+
GOWORK=off go mod tidy
112112
113-
xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out sqlite -dest ../../../bin \
113+
GOWORK=off xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out sqlite -dest ../../../bin \
114114
-buildmode=plugin -targets="linux/amd64,linux/386,linux/arm64,linux/arm-7,darwin/amd64,darwin/arm64" \
115-
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct" .
115+
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct,GOWORK=off" .
116116
117117
# Restore original go.mod if it existed
118118
if [ -f "./go.mod.backup" ]; then
@@ -138,11 +138,11 @@ jobs:
138138
139139
# Add plugin-specific dependencies
140140
go mod edit -require=github.com/go-sql-driver/mysql@v1.6.0
141-
go mod tidy
141+
GOWORK=off go mod tidy
142142
143-
xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out mysql -dest ../../../bin \
143+
GOWORK=off xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out mysql -dest ../../../bin \
144144
-buildmode=plugin -targets="linux/amd64,linux/386,linux/arm64,linux/arm-7,darwin/amd64,darwin/arm64" \
145-
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct" .
145+
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct,GOWORK=off" .
146146
147147
# Restore original go.mod if it existed
148148
if [ -f "./go.mod.backup" ]; then
@@ -168,11 +168,11 @@ jobs:
168168
169169
# Add plugin-specific dependencies
170170
go mod edit -require=github.com/lib/pq@v1.10.7
171-
go mod tidy
171+
GOWORK=off go mod tidy
172172
173-
xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out postgres -dest ../../../bin \
173+
GOWORK=off xgo -image techknowlogick/xgo:latest -v -ldflags="-s -w" -go $GO_RELEASE_V -out postgres -dest ../../../bin \
174174
-buildmode=plugin -targets="linux/amd64,linux/386,linux/arm64,linux/arm-7,darwin/amd64,darwin/arm64" \
175-
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct" .
175+
-env="GO111MODULE=on,GOPROXY=https://proxy.golang.org,direct,GOWORK=off" .
176176
177177
# Restore original go.mod if it existed
178178
if [ -f "./go.mod.backup" ]; then

0 commit comments

Comments
 (0)