Skip to content

Commit a61f843

Browse files
authored
Revert "test: run linux package tests nightly against latest contrib main (#666)" (#761)
This reverts commit 1271690.
1 parent 3ae3def commit a61f843

File tree

12 files changed

+58
-233
lines changed

12 files changed

+58
-233
lines changed

.github/workflows/base-ci-goreleaser.yaml

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ on:
1212
goarch:
1313
required: true
1414
type: string
15-
nightly:
16-
required: false
17-
type: boolean
18-
default: false
19-
description: "Set to true to fetch latest otelcol-contrib main branch version instead of building the version in this repo"
2015

2116
env:
2217
# renovate: datasource=github-tags depName=goreleaser-pro packageName=goreleaser/goreleaser-pro
@@ -69,75 +64,9 @@ jobs:
6964
go-version: '1.23'
7065
check-latest: true
7166

72-
- name: Create artifacts directory to store build artifacts
73-
if: inputs.distribution == 'otelcol-contrib'
74-
run: mkdir -p distributions/otelcol-contrib/artifacts
75-
76-
- name: "[Nightly] Get latest finished run ID from contrib repo build-and-test"
77-
id: get-run-id
78-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly == true && matrix.GOARCH == 'amd64' && matrix.GOOS == 'linux'
79-
env:
80-
GH_TOKEN: ${{ github.token }}
81-
run: |
82-
run_id=$(gh run list \
83-
--branch main \
84-
--workflow build-and-test \
85-
--repo open-telemetry/opentelemetry-collector-contrib \
86-
--limit 1 \
87-
--status success \
88-
--json databaseId \
89-
--jq '.[0].databaseId' \
90-
)
91-
echo "Found run ID: $run_id"
92-
echo "run_id=$run_id" >> "$GITHUB_OUTPUT"
93-
94-
- name: "[Nightly] Create sub-directory for otelcol-contrib nightly build"
95-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly == true && matrix.GOARCH == 'amd64' && matrix.GOOS == 'linux'
96-
run: mkdir -p distributions/otelcol-contrib/artifacts/otelcol-contrib_linux_amd64_v1
97-
98-
- name: "[Nightly] Download built otelcol-contrib artifact from contrib repo"
99-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly == true && matrix.GOARCH == 'amd64' && matrix.GOOS == 'linux'
100-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
101-
with:
102-
name: collector-binaries-linux-amd64
103-
repository: open-telemetry/opentelemetry-collector-contrib
104-
github-token: ${{ secrets.GITHUB_TOKEN }}
105-
run-id: ${{ steps.get-run-id.outputs.run_id }}
106-
107-
- name: "[Nightly] Move downloaded artifact"
108-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly == true && matrix.GOARCH == 'amd64' && matrix.GOOS == 'linux'
109-
run: mv otelcontribcol_linux_amd64 distributions/otelcol-contrib/artifacts/otelcol-contrib_linux_amd64_v1/otelcol-contrib
110-
111-
- name: Generate the sources for ${{ inputs.distribution }}
112-
if: inputs.nightly != true
113-
env:
114-
DISTRIBUTIONS: ${{ inputs.distribution }}
67+
- name: Generate the sources
11568
run: make generate-sources
11669

117-
# otelcol-contrib is built in a separate stage
118-
- name: Build ${{ inputs.distribution }}
119-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly != true
120-
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
121-
with:
122-
distribution: goreleaser-pro
123-
version: ${{ env.GORELEASER_PRO_VERSION }}
124-
workdir: distributions/otelcol-contrib
125-
args: --snapshot --clean --timeout 2h --split --config .goreleaser-build.yaml
126-
env:
127-
GOOS: ${{ matrix.GOOS }}
128-
GOARCH: ${{ matrix.GOARCH }}
129-
GOARM: 7 # Default is 6
130-
GOAMD64: v1
131-
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
132-
133-
- name: Move built artifacts
134-
if: inputs.distribution == 'otelcol-contrib' && inputs.nightly != true
135-
run: mv distributions/otelcol-contrib/dist/**/* distributions/otelcol-contrib/artifacts/
136-
137-
- name: Show built or downloaded content
138-
if: inputs.distribution == 'otelcol-contrib'
139-
run: ls -laR distributions/otelcol-contrib/artifacts
140-
14170
- name: Run GoReleaser for ${{ inputs.distribution }}
14271
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
14372
with:

.github/workflows/ci-goreleaser-contrib.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
package-tests:
3737
name: Package tests
3838
needs: check-goreleaser
39-
uses: ./.github/workflows/base-package-tests.yaml
39+
uses: ./.github/workflows/package-tests.yaml
4040
with:
4141
distribution: otelcol-contrib
4242
type: '[ "deb", "rpm" ]'

.github/workflows/ci-goreleaser-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
package-tests:
3838
name: Package tests
3939
needs: check-goreleaser
40-
uses: ./.github/workflows/base-package-tests.yaml
40+
uses: ./.github/workflows/package-tests.yaml
4141
with:
4242
distribution: otelcol
4343
type: '[ "deb", "rpm" ]'

.github/workflows/package-test.yaml

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ delete-tags:
9292
# Used for debug only
9393
REMOTE?[email protected]:open-telemetry/opentelemetry-collector-releases.git
9494
.PHONY: repeat-tags
95-
repeat-tags: delete-tags push-tags
95+
repeat-tags: delete-tags push-tags

cmd/goreleaser/internal/configure.go

Lines changed: 45 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,22 @@ const (
4242
var (
4343
ImagePrefixes = []string{DockerHub, GHCR}
4444
Architectures = []string{"386", "amd64", "arm", "arm64", "ppc64le", "s390x"}
45+
ArmVersions = []string{"7"}
4546
DefaultConfigDists = map[string]bool{CoreDistro: true, ContribDistro: true}
4647
MSIWindowsDists = map[string]bool{CoreDistro: true, ContribDistro: true, OTLPDistro: true}
4748
K8sDockerSkipArchs = map[string]bool{"arm": true, "386": true}
4849
K8sGoos = []string{"linux"}
4950
K8sArchs = []string{"amd64", "arm64", "ppc64le", "s390x"}
5051
)
5152

52-
func GenerateContribBuildOnly(dist string, buildOrRest bool) config.Project {
53-
return config.Project{
54-
ProjectName: "opentelemetry-collector-releases",
55-
Builds: Builds(dist, buildOrRest),
56-
Version: 2,
57-
Monorepo: config.Monorepo{
58-
TagPrefix: "v",
59-
},
60-
}
61-
}
62-
63-
func Generate(dist string, buildOrRest bool) config.Project {
53+
func Generate(dist string) config.Project {
6454
return config.Project{
6555
ProjectName: "opentelemetry-collector-releases",
6656
Checksum: config.Checksum{
6757
NameTemplate: fmt.Sprintf("{{ .ProjectName }}_%v_checksums.txt", dist),
6858
},
6959
Env: []string{"COSIGN_YES=true"},
70-
Builds: Builds(dist, buildOrRest),
60+
Builds: Builds(dist),
7161
Archives: Archives(dist),
7262
MSI: WinPackages(dist),
7363
NFPMs: Packages(dist),
@@ -83,41 +73,37 @@ func Generate(dist string, buildOrRest bool) config.Project {
8373
}
8474
}
8575

86-
func Builds(dist string, buildOrRest bool) []config.Build {
76+
func Builds(dist string) []config.Build {
8777
return []config.Build{
88-
Build(dist, buildOrRest),
78+
Build(dist),
8979
}
9080
}
9181

9282
// Build configures a goreleaser build.
9383
// https://goreleaser.com/customization/build/
94-
func Build(dist string, buildOrRest bool) config.Build {
95-
goos := []string{"darwin", "linux", "windows"}
96-
archs := Architectures
97-
98-
if dist == ContribDistro && !buildOrRest {
99-
// only return build config for contrib build file
100-
return config.Build{
101-
ID: dist,
102-
Builder: "prebuilt",
103-
PreBuilt: config.PreBuiltOptions{
104-
Path: "artifacts/otelcol-contrib_{{ .Target }}" +
105-
"/otelcol-contrib{{- if eq .Os \"windows\" }}.exe{{ end }}",
106-
},
107-
Goos: goos,
108-
Goarch: archs,
109-
Goarm: ArmVersions(dist),
110-
Dir: "_build",
111-
Binary: dist,
112-
Ignore: IgnoreBuildCombinations(dist),
113-
}
114-
}
115-
84+
func Build(dist string) config.Build {
85+
var goos []string
86+
var archs []string
87+
var ignore []config.IgnoredBuild
88+
var armVersions []string
11689
if dist == K8sDistro {
11790
goos = K8sGoos
11891
archs = K8sArchs
92+
ignore = make([]config.IgnoredBuild, 0)
93+
armVersions = make([]string, 0)
94+
} else {
95+
goos = []string{"darwin", "linux", "windows"}
96+
archs = Architectures
97+
ignore = []config.IgnoredBuild{
98+
{Goos: "darwin", Goarch: "386"},
99+
{Goos: "darwin", Goarch: "arm"},
100+
{Goos: "darwin", Goarch: "s390x"},
101+
{Goos: "windows", Goarch: "arm"},
102+
{Goos: "windows", Goarch: "arm64"},
103+
{Goos: "windows", Goarch: "s390x"},
104+
}
105+
armVersions = ArmVersions
119106
}
120-
121107
return config.Build{
122108
ID: dist,
123109
Dir: "_build",
@@ -129,33 +115,12 @@ func Build(dist string, buildOrRest bool) config.Build {
129115
},
130116
Goos: goos,
131117
Goarch: archs,
132-
Goarm: ArmVersions(dist),
133-
Ignore: IgnoreBuildCombinations(dist),
118+
Goarm: armVersions,
119+
Ignore: ignore,
134120
}
135121
}
136122

137-
func IgnoreBuildCombinations(dist string) []config.IgnoredBuild {
138-
if dist == K8sDistro {
139-
return nil
140-
}
141-
return []config.IgnoredBuild{
142-
{Goos: "darwin", Goarch: "386"},
143-
{Goos: "darwin", Goarch: "arm"},
144-
{Goos: "darwin", Goarch: "s390x"},
145-
{Goos: "windows", Goarch: "arm"},
146-
{Goos: "windows", Goarch: "arm64"},
147-
{Goos: "windows", Goarch: "s390x"},
148-
}
149-
}
150-
151-
func ArmVersions(dist string) []string {
152-
if dist == K8sDistro {
153-
return nil
154-
}
155-
return []string{"7"}
156-
}
157-
158-
func Archives(dist string) []config.Archive {
123+
func Archives(dist string) (r []config.Archive) {
159124
return []config.Archive{
160125
Archive(dist),
161126
}
@@ -173,7 +138,7 @@ func Archive(dist string) config.Archive {
173138

174139
func WinPackages(dist string) []config.MSI {
175140
if _, ok := MSIWindowsDists[dist]; !ok {
176-
return nil
141+
return []config.MSI{}
177142
}
178143
return []config.MSI{
179144
WinPackage(dist),
@@ -195,9 +160,9 @@ func WinPackage(dist string) config.MSI {
195160
}
196161
}
197162

198-
func Packages(dist string) []config.NFPM {
163+
func Packages(dist string) (r []config.NFPM) {
199164
if dist == K8sDistro {
200-
return nil
165+
return []config.NFPM{}
201166
}
202167
return []config.NFPM{
203168
Package(dist),
@@ -226,17 +191,21 @@ func Package(dist string) config.NFPM {
226191
})
227192
}
228193
return config.NFPM{
229-
ID: dist,
230-
Builds: []string{dist},
231-
Formats: []string{"deb", "rpm"},
194+
ID: dist,
195+
Builds: []string{dist},
196+
Formats: []string{"deb", "rpm"},
197+
232198
License: "Apache 2.0",
233199
Description: fmt.Sprintf("OpenTelemetry Collector - %s", dist),
234200
Maintainer: "The OpenTelemetry Collector maintainers <[email protected]>",
235201
Overrides: map[string]config.NFPMOverridables{
236202
"rpm": {
237-
Dependencies: []string{"/bin/sh"},
203+
Dependencies: []string{
204+
"/bin/sh",
205+
},
238206
},
239207
},
208+
240209
NFPMOverridables: config.NFPMOverridables{
241210
PackageName: dist,
242211
Scripts: config.NFPMScripts{
@@ -250,14 +219,16 @@ func Package(dist string) config.NFPM {
250219
}
251220

252221
func DockerImages(dist string) []config.Docker {
253-
var r []config.Docker
222+
r := make([]config.Docker, 0)
254223
for _, arch := range Architectures {
255-
if dist == K8sDistro && K8sDockerSkipArchs[arch] {
256-
continue
224+
if dist == K8sDistro {
225+
if _, ok := K8sDockerSkipArchs[arch]; ok {
226+
continue
227+
}
257228
}
258229
switch arch {
259230
case ArmArch:
260-
for _, vers := range ArmVersions(dist) {
231+
for _, vers := range ArmVersions {
261232
r = append(r, DockerImage(dist, arch, vers))
262233
}
263234
default:
@@ -331,7 +302,7 @@ func DockerManifest(prefix, version, dist string) config.DockerManifest {
331302
}
332303
switch arch {
333304
case ArmArch:
334-
for _, armVers := range ArmVersions(dist) {
305+
for _, armVers := range ArmVersions {
335306
dockerArchTag := strings.ReplaceAll(archName(arch, armVers), "/", "")
336307
imageTemplates = append(
337308
imageTemplates,

cmd/goreleaser/main.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,21 @@ import (
1919
"log"
2020
"os"
2121

22-
"github.com/goreleaser/goreleaser-pro/v2/pkg/config"
2322
"gopkg.in/yaml.v3"
2423

2524
"github.com/open-telemetry/opentelemetry-collector-releases/cmd/goreleaser/internal"
2625
)
2726

2827
var distFlag = flag.String("d", "", "Collector distributions to build")
29-
var contribBuildOrRestFlag = flag.Bool("generate-build-step", false, "Collector Contrib distribution only - switch between build and package config file - set to true to generate build step, false to generate package step")
3028

3129
func main() {
3230
flag.Parse()
3331

3432
if len(*distFlag) == 0 {
3533
log.Fatal("no distribution to build")
3634
}
37-
var project config.Project
3835

39-
if *distFlag == internal.ContribDistro && *contribBuildOrRestFlag {
40-
// Special care needs to be taken for otelcol-contrib since it has a split setup
41-
project = internal.GenerateContribBuildOnly(*distFlag, *contribBuildOrRestFlag)
42-
} else {
43-
project = internal.Generate(*distFlag, *contribBuildOrRestFlag)
44-
}
36+
project := internal.Generate(*distFlag)
4537

4638
partial := map[string]any{
4739
"partial": map[string]any{

0 commit comments

Comments
 (0)