diff --git a/.github/workflows/ci-goreleaser.yaml b/.github/workflows/ci-goreleaser.yaml new file mode 100644 index 00000000..92160d1b --- /dev/null +++ b/.github/workflows/ci-goreleaser.yaml @@ -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 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6813913f..b98bb064 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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" @@ -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" diff --git a/scripts/goreleaser-templates/docker-manifests.template.yaml b/scripts/goreleaser-templates/docker-manifests.template.yaml index 5ae378ca..ef5fe013 100644 --- a/scripts/goreleaser-templates/docker-manifests.template.yaml +++ b/scripts/goreleaser-templates/docker-manifests.template.yaml @@ -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 diff --git a/scripts/goreleaser-templates/docker.template.yaml b/scripts/goreleaser-templates/docker.template.yaml index f8cd95f9..3a569e23 100644 --- a/scripts/goreleaser-templates/docker.template.yaml +++ b/scripts/goreleaser-templates/docker.template.yaml @@ -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