Skip to content

Commit

Permalink
Add goreleaser to CI (#41)
Browse files Browse the repository at this point in the history
* Add goreleaser to CI

This PR adds goreleaser to the CI, ensuring that the build can still run most of the release process.

Fixes #40

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Remove armv6, armv7, and arm64

Until #40 gets fixed, arm builds are disabled.

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Split GoReleaser CI into its own workflow

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
jpkrohling authored Dec 15, 2021
1 parent bc17ab4 commit 2e63d6d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 100 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration - GoReleaser

on:
push:
branches: [main]
paths: [".goreleaser.yaml"]
pull_request:
branches: [main]
paths: [".goreleaser.yaml"]

jobs:
check-goreleaser:
name: Check GoReleaser Configuration
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Generate the sources
run: make generate-sources

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --snapshot --rm-dist
50 changes: 0 additions & 50 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ docker_manifests:
- name_template: otel/opentelemetry-collector:{{ .Version }}
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-amd64
- otel/opentelemetry-collector:{{ .Version }}-armv6
- otel/opentelemetry-collector:{{ .Version }}-armv7
- otel/opentelemetry-collector:{{ .Version }}-arm64
dockers:
- image_templates:
- "otel/opentelemetry-collector:{{ .Version }}-amd64"
Expand All @@ -57,53 +54,6 @@ dockers:
extra_files:
- "configs/otelcol.yaml"
goarch: amd64
- image_templates:
- "otel/opentelemetry-collector:{{ .Version }}-armv6"
dockerfile: "distributions/otelcol/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm/v6"
extra_files:
- "configs/otelcol.yaml"
goarch: arm
goarm: 6
- image_templates:
- "otel/opentelemetry-collector:{{ .Version }}-armv7"
dockerfile: "distributions/otelcol/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm/v7"
extra_files:
- "configs/otelcol.yaml"
goarch: arm
goarm: 7
- image_templates:
- "otel/opentelemetry-collector:{{ .Version }}-arm64"
dockerfile: "distributions/otelcol/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
extra_files:
- "configs/otelcol.yaml"
goarch: arm64
nfpms:
- id: "otelcol"
package_name: "otelcol"
Expand Down
3 changes: 0 additions & 3 deletions scripts/goreleaser-templates/docker-manifests.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ docker_manifests:
- name_template: ${CONTAINER_BASE_NAME}:{{ .Version }}
image_templates:
- ${CONTAINER_BASE_NAME}:{{ .Version }}-amd64
- ${CONTAINER_BASE_NAME}:{{ .Version }}-armv6
- ${CONTAINER_BASE_NAME}:{{ .Version }}-armv7
- ${CONTAINER_BASE_NAME}:{{ .Version }}-arm64
47 changes: 0 additions & 47 deletions scripts/goreleaser-templates/docker.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,3 @@ dockers:
extra_files:
- "configs/{distribution}.yaml"
goarch: amd64
- image_templates:
- "${CONTAINER_BASE_NAME}:{{ .Version }}-armv6"
dockerfile: "distributions/{distribution}/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm/v6"
extra_files:
- "configs/{distribution}.yaml"
goarch: arm
goarm: 6
- image_templates:
- "${CONTAINER_BASE_NAME}:{{ .Version }}-armv7"
dockerfile: "distributions/{distribution}/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm/v7"
extra_files:
- "configs/{distribution}.yaml"
goarch: arm
goarm: 7
- image_templates:
- "${CONTAINER_BASE_NAME}:{{ .Version }}-arm64"
dockerfile: "distributions/{distribution}/Dockerfile"
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
extra_files:
- "configs/{distribution}.yaml"
goarch: arm64

0 comments on commit 2e63d6d

Please sign in to comment.