Skip to content

Commit

Permalink
Merge pull request #1444 from kakkoyun/release-0.12
Browse files Browse the repository at this point in the history
Fix cross-platform container builds
  • Loading branch information
kakkoyun authored Jul 29, 2022
2 parents feeab57 + c475f74 commit dcc64c8
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 27 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Go

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

env:
# renovate: datasource=docker depName=docker.io/multiarch/qemu-user-static versioning=regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-(?<build>\\d+)$
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/codeql-analysis-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches:
- main
- release-*
schedule:
- cron: '19 8 * * 1'

Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/codeql-analysis-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches:
- main
- release-*
schedule:
- cron: '19 8 * * 1'

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Container

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Documents

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

jobs:
skip-check:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ on:
push:
tags:
- v*
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

env:
# renovate: datasource=go depName=github.com/golangci/golangci-lint
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/jsonnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Jsonnet

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

jobs:
skip-check:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/proto-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: proto-push

on:
push:
branches: [ main ]
branches:
- main
- release-*

jobs:
skip-check:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release-dry-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Release (Dry Run)

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

env:
# renovate: datasource=go depName=github.com/goreleaser/goreleaser
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: UI

on:
push:
branches: [ main ]
branches:
- main
- release-*
pull_request:
branches: [ main ]
branches:
- main
- release-*

jobs:
skip-check:
Expand Down
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN mkdir /.cache && touch -t 202101010000.00 /.cache

ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETVARIANT
ARG TARGETVARIANT=v1

# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.11
Expand All @@ -15,14 +15,16 @@ RUN if [ "$(go env GOHOSTARCH)" != "$(go env GOARCH)" ]; then \
fi

WORKDIR /app
COPY ./dist /app/dist
COPY dist dist

RUN if [ "amd64" = "$(go env GOARCH)" ]; then \
cp "dist/parca_$(go env GOOS)_$(go env GOARCH)_$(go env GOAMD64)/parca" parca; \
# NOTICE: See goreleaser.yml for the build paths.
RUN if [ "${TARGETARCH}" == 'amd64' ]; then \
cp "dist/parca_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT:-v1}/parca" . ; \
elif [ "${TARGETARCH}" == 'arm' ]; then \
cp "dist/parca_${TARGETOS}_${TARGETARCH}_${TARGETVARIANT##v}/parca" . ; \
else \
cp "dist/parca_$(go env GOOS)_$(go env GOARCH)/parca" parca; \
cp "dist/parca_${TARGETOS}_${TARGETARCH}/parca" . ; \
fi

RUN chmod +x parca

FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.16.0@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c AS runner
Expand Down

0 comments on commit dcc64c8

Please sign in to comment.