File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ name : update-version
3+ on :
4+ pull_request :
5+ branches : [master]
6+ paths :
7+ - ' version.txt'
8+
9+ jobs :
10+ update-version-in-pr :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v2
15+ with :
16+ ref : ${{ github.head_ref }}
17+
18+ - if : github.actor == "release-please[bot]"
19+ name : find-and-replace-version
20+ run : |
21+ VERSION=$(cat version.txt)
22+ sed -i -r 's/(var versionString = ")[0-9]+.[0-9]+.[0-9]+(-dev)?/\1'"$VERSION"'/' cmd/cloud_sql_proxy/cloud_sql_proxy.go
23+ git config user.name "release-please[bot]"
24+ git config user.email "55107282+release-please[bot]@users.noreply.github.com"
25+ git add cmd/cloud_sql_proxy/cloud_sql_proxy.go
26+ git commit -m "Update version"
27+ git push origin ${{ github.head_ref }}
28+
29+
30+
Original file line number Diff line number Diff line change 1515# Use the latest stable golang 1.x to compile to a binary
1616FROM golang:1 as build
1717
18- ARG VERSION="1.18.1-dev"
19-
2018WORKDIR /go/src/cloudsql-proxy
2119COPY . .
2220
2321RUN go get ./...
24- RUN go build -ldflags "-X main.versionString=$VERSION -X main. metadataString=container" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
22+ RUN go build -ldflags "-X main.metadataString=container" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
2523
2624# Final Stage
2725FROM gcr.io/distroless/base-debian10:nonroot
Original file line number Diff line number Diff line change 1515# Use the latest stable golang 1.x to compile to a binary
1616FROM golang:1 as build
1717
18- ARG VERSION="1.18.1-dev"
19-
2018WORKDIR /go/src/cloudsql-proxy
2119COPY . .
2220
2321RUN go get ./...
24- RUN go build -ldflags "-X main.versionString=$VERSION -X main. metadataString=container.alpine" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
22+ RUN go build -ldflags "-X main.metadataString=container.alpine" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
2523
2624# Final stage
2725FROM alpine:3
Original file line number Diff line number Diff line change 1515# Use the latest stable golang 1.x to compile to a binary
1616FROM golang:1 as build
1717
18- ARG VERSION="1.18.1-dev"
19-
2018WORKDIR /go/src/cloudsql-proxy
2119COPY . .
2220
2321RUN go get ./...
24- RUN go build -ldflags "-X main.versionString=$VERSION -X main. metadataString=container.buster" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
22+ RUN go build -ldflags "-X main.metadataString=container.buster" -o cloud_sql_proxy ./cmd/cloud_sql_proxy
2523
2624# Final stage
2725FROM debian:buster
You can’t perform that action at this time.
0 commit comments