Skip to content

Commit c664a4f

Browse files
authored
Push to dockerhub (#8)
1 parent bb4d37e commit c664a4f

File tree

10 files changed

+320
-112
lines changed

10 files changed

+320
-112
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Create release
2+
on:
3+
pull_request_target:
4+
branches:
5+
- main
6+
types:
7+
- closed
8+
jobs:
9+
release:
10+
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, 'skip-release')
11+
uses: libops/.github/.github/workflows/bump-release.yaml@main
12+
permissions:
13+
contents: write
14+
actions: write
15+
secrets: inherit

.github/workflows/goreleaser.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: goreleaser
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
22+
with:
23+
go-version: ">=1.25.6"
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
27+
with:
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-push-ar
1+
name: build-push
22
on:
33
push:
44
jobs:
@@ -7,33 +7,23 @@ jobs:
77
contents: read
88
runs-on: ubuntu-24.04
99
steps:
10-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
1111

12-
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
12+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
1313
with:
14-
go-version: '>=1.23.4'
14+
go-version: ">=1.25.3"
1515

16-
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6
18-
with:
19-
version: latest
20-
21-
- name: Install dependencies
22-
run: go get .
23-
24-
- name: Build
25-
run: go build -v
16+
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
2617

2718
- name: Test with the Go CLI
2819
run: go test -v -race ./...
2920

30-
31-
build-push-ar:
21+
build-push:
3222
needs: [test]
33-
uses: libops/actions/.github/workflows/build-push.yml@main
23+
uses: libops/.github/.github/workflows/build-push.yaml@main
3424
with:
35-
image: "shared/vault-init"
25+
docker-registry: "libops"
3626
permissions:
3727
contents: read
38-
id-token: write
28+
packages: write
3929
secrets: inherit

.github/workflows/validate-renovate.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.golangci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1+
version: "2"
12
linters:
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- ../../go
12+
- ../../../../opt
13+
- ./vendor
14+
- third_party$
15+
- builtin$
16+
- examples$
17+
formatters:
218
enable:
319
- gofmt
4-
20+
exclusions:
21+
generated: lax
22+
paths:
23+
- ../../go
24+
- ../../../../opt
25+
- ./vendor
26+
- third_party$
27+
- builtin$
28+
- examples$

.goreleaser.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- binary: vault-init
6+
env:
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
13+
archives:
14+
- format: tar.gz
15+
# this name template makes the OS and Arch compatible with the results of uname.
16+
name_template: >-
17+
{{ .ProjectName }}_
18+
{{- title .Os }}_
19+
{{- if eq .Arch "amd64" }}x86_64
20+
{{- else if eq .Arch "386" }}i386
21+
{{- else }}{{ .Arch }}{{ end }}
22+
{{- if .Arm }}v{{ .Arm }}{{ end }}
23+
# use zip for windows archives
24+
format_overrides:
25+
- goos: windows
26+
format: zip
27+
checksum:
28+
name_template: "checksums.txt"
29+
snapshot:
30+
name_template: "{{ incpatch .Version }}-next"
31+
changelog:
32+
sort: asc
33+
filters:
34+
exclude:
35+
- "^docs:"
36+
- "^test:"

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
FROM golang:1.23.4 AS builder
2-
3-
RUN apt-get -qq update && \
4-
apt-get -yqq install curl -y
1+
FROM golang:1.25.6@sha256:ce63a16e0f7063787ebb4eb28e72d477b00b4726f79874b3205a965ffd797ab2 AS builder
52

63
ENV GO111MODULE=on \
74
CGO_ENABLED=0 \
@@ -10,7 +7,11 @@ ENV GO111MODULE=on \
107

118
WORKDIR /src
129

13-
COPY . .
10+
COPY go.mod go.sum ./
11+
RUN --mount=type=cache,target=/go/pkg/mod \
12+
go mod download
13+
14+
COPY main.go .
1415
RUN go build \
1516
-a \
1617
-trimpath \
@@ -19,8 +20,6 @@ RUN go build \
1920
-o /bin/vault-init \
2021
.
2122

22-
RUN strip /bin/vault-init
23-
2423
FROM scratch
2524
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2625
COPY --from=builder /bin/vault-init /bin/vault-init

go.mod

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,65 @@
11
module github.com/libops/vault-init
22

3-
go 1.23.4
3+
go 1.24.0
44

55
require (
6-
cloud.google.com/go/storage v1.13.0
7-
google.golang.org/api v0.40.0
6+
cloud.google.com/go/storage v1.59.1
7+
google.golang.org/api v0.262.0
88
)
99

1010
require (
11-
cloud.google.com/go v0.78.0 // indirect
12-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
13-
github.com/golang/protobuf v1.5.0 // indirect
14-
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
15-
github.com/jstemmer/go-junit-report v0.9.1 // indirect
16-
go.opencensus.io v0.22.6 // indirect
17-
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
18-
golang.org/x/mod v0.4.1 // indirect
19-
golang.org/x/net v0.0.0-20210222171744-9060382bd457 // indirect
20-
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 // indirect
21-
golang.org/x/sys v0.0.0-20210223095934-7937bea0104d // indirect
22-
golang.org/x/text v0.3.5 // indirect
23-
golang.org/x/tools v0.1.0 // indirect
24-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
25-
google.golang.org/appengine v1.6.7 // indirect
26-
google.golang.org/genproto v0.0.0-20210223151946-22b48be4551b // indirect
27-
google.golang.org/grpc v1.35.0 // indirect
28-
google.golang.org/protobuf v1.33.0 // indirect
11+
cel.dev/expr v0.25.1 // indirect
12+
cloud.google.com/go v0.123.0 // indirect
13+
cloud.google.com/go/auth v0.18.1 // indirect
14+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
15+
cloud.google.com/go/compute/metadata v0.9.0 // indirect
16+
cloud.google.com/go/iam v1.5.3 // indirect
17+
cloud.google.com/go/monitoring v1.24.3 // indirect
18+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0 // indirect
19+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 // indirect
20+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 // indirect
21+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
22+
github.com/cncf/xds/go v0.0.0-20260121142036-a486691bba94 // indirect
23+
github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect
24+
github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect
25+
github.com/felixge/httpsnoop v1.0.4 // indirect
26+
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
27+
github.com/go-logr/logr v1.4.3 // indirect
28+
github.com/go-logr/stdr v1.2.2 // indirect
29+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
30+
github.com/golang/protobuf v1.5.4 // indirect
31+
github.com/google/s2a-go v0.1.9 // indirect
32+
github.com/google/uuid v1.6.0 // indirect
33+
github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect
34+
github.com/googleapis/gax-go/v2 v2.16.0 // indirect
35+
github.com/jstemmer/go-junit-report v1.0.0 // indirect
36+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
37+
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
38+
go.opencensus.io v0.24.0 // indirect
39+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
40+
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
41+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.64.0 // indirect
42+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect
43+
go.opentelemetry.io/otel v1.39.0 // indirect
44+
go.opentelemetry.io/otel/metric v1.39.0 // indirect
45+
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
46+
go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect
47+
go.opentelemetry.io/otel/trace v1.39.0 // indirect
48+
golang.org/x/crypto v0.47.0 // indirect
49+
golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect
50+
golang.org/x/mod v0.32.0 // indirect
51+
golang.org/x/net v0.49.0 // indirect
52+
golang.org/x/oauth2 v0.34.0 // indirect
53+
golang.org/x/sync v0.19.0 // indirect
54+
golang.org/x/sys v0.40.0 // indirect
55+
golang.org/x/text v0.33.0 // indirect
56+
golang.org/x/time v0.14.0 // indirect
57+
golang.org/x/tools v0.41.0 // indirect
58+
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
59+
google.golang.org/appengine v1.6.8 // indirect
60+
google.golang.org/genproto v0.0.0-20260122232226-8e98ce8d340d // indirect
61+
google.golang.org/genproto/googleapis/api v0.0.0-20260122232226-8e98ce8d340d // indirect
62+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260122232226-8e98ce8d340d // indirect
63+
google.golang.org/grpc v1.78.0 // indirect
64+
google.golang.org/protobuf v1.36.11 // indirect
2965
)

0 commit comments

Comments
 (0)