Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
with:
context: .
file: Dockerfile.sam-control-plane
build-args: VERSION=${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
platforms: ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.meta-cp.outputs.tags }}
Expand Down Expand Up @@ -136,6 +137,7 @@ jobs:
with:
context: .
file: Dockerfile.sam-console
build-args: VERSION=${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
platforms: ${{ github.ref_type == 'tag' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.meta-console.outputs.tags }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- run: make verify

# A build id whose cmd/ directory no longer exists only fails on the tag
# push, after the release is already underway; catch it on the PR instead.
goreleaser-check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
distribution: goreleaser
version: "~> v2"
args: check
- uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
distribution: goreleaser
version: "~> v2"
args: build --snapshot --clean --single-target

helm-lint:
runs-on: ubuntu-latest
steps:
Expand Down
40 changes: 3 additions & 37 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ builds:
- amd64
- arm64
ldflags:
- -s -w
- -s -w -X github.com/google/sam/internal/version.Version={{ .Tag }}
- id: sam-router
main: ./cmd/sam-router
binary: sam-router
Expand Down Expand Up @@ -59,21 +59,7 @@ builds:
- amd64
- arm64
ldflags:
- -s -w
- id: sam-box
main: ./cmd/sam-box
binary: sam-box
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -s -w -X github.com/google/sam/internal/version.Version={{ .Tag }}
- id: sam-console
main: ./cmd/sam-console
binary: sam-console
Expand All @@ -87,7 +73,7 @@ builds:
- amd64
- arm64
ldflags:
- -s -w
- -s -w -X github.com/google/sam/internal/version.Version={{ .Tag }}
- id: sam-one
main: ./cmd/sam-one
binary: sam-one
Expand All @@ -102,23 +88,6 @@ builds:
- arm64
ldflags:
- -s -w -X github.com/google/sam/internal/version.Version={{ .Tag }}
- id: nano-init
main: .
# nano-init is its own module: it carries a userspace TCP stack, and that
# dependency has no business in the graph every other binary builds from.
dir: ./cmd/nano-init
binary: nano-init
env:
- CGO_ENABLED=0
# linux only: nano-init is PID 1 inside a Linux sandbox — TUN ioctls,
# netlink, namespaces and vsock have no meaning anywhere else.
goos:
- linux
goarch:
- amd64
- arm64
ldflags:
- -s -w
archives:
- formats:
- tar.gz
Expand All @@ -133,6 +102,3 @@ archives:
- goos: windows
formats:
- zip
# nano-init only builds for linux (see build id "nano-init" above), so the
# windows and darwin archives intentionally have one fewer binary.
allow_different_binary_count: true
3 changes: 2 additions & 1 deletion Dockerfile.sam-console
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN CGO_ENABLED=0 go build -o /bin/sam-console ./cmd/sam-console
ARG VERSION=devel
RUN CGO_ENABLED=0 go build -buildvcs=false -ldflags="-X github.com/google/sam/internal/version.Version=${VERSION}" -o /bin/sam-console ./cmd/sam-console

FROM gcr.io/distroless/static-debian12:nonroot@sha256:afa5c872c891853ca7fcf1f12c3edb23f7eeef36189728842dd51042ff57f7ab

Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.sam-control-plane
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -o sam-control-plane ./cmd/sam-control-plane
ARG VERSION=devel
RUN CGO_ENABLED=0 GOOS=linux go build -buildvcs=false -ldflags="-X github.com/google/sam/internal/version.Version=${VERSION}" -o sam-control-plane ./cmd/sam-control-plane
# Pre-create the sqlite data dir owned by the nonroot UID so that a fresh
# named/anonymous volume mounted over it inherits writable ownership instead
# of defaulting to root.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ update:
go mod tidy

docker-build-control-plane:
docker build --load -t sam-control-plane:local -f Dockerfile.sam-control-plane .
docker build --load --build-arg VERSION="$(VERSION)" -t sam-control-plane:local -f Dockerfile.sam-control-plane .

docker-build-router:
docker build --load --build-arg VERSION="$(VERSION)" -t sam-router:local -f Dockerfile.sam-router .
Expand All @@ -274,7 +274,7 @@ docker-build-e2e-runtime:
docker build --load -t sam-e2e-runtime:local -f tests/e2e/docker/Dockerfile.sam-runtime .

docker-build-sam-console:
docker build --load -t sam-console:local -f Dockerfile.sam-console .
docker build --load --build-arg VERSION="$(VERSION)" -t sam-console:local -f Dockerfile.sam-console .

docker-build: docker-build-control-plane docker-build-router docker-build-node docker-build-mock-oidc docker-build-e2e-runtime docker-build-sam-console

Expand Down
55 changes: 0 additions & 55 deletions api/bootstrap_token.go

This file was deleted.

Loading
Loading