Skip to content

Commit 802d804

Browse files
committed
[chore] Combine pipelines
revert workflow permissions after PR was reverted fix merge artifacts fix missing target folder variable update binary ci workflows to use new one parameterise workflow whitespace fix goreleaser renovate annotations copy builder ci pipeline as base binary pipeline resolve merge artifacts change binary release pipelines to make use of new base release pipeline prepare pipeline for generalisation whitespaces add pipeline
1 parent 771adb3 commit 802d804

File tree

6 files changed

+218
-299
lines changed

6 files changed

+218
-299
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Reusable binary release workflow
2+
on:
3+
workflow_call:
4+
inputs:
5+
binary:
6+
required: true
7+
type: string
8+
description: "Which binary to release. Possible options: ['builder', 'opampsupervisor']"
9+
collector-dependency:
10+
required: false
11+
type: string
12+
default: ""
13+
description: "Set this to the repo slug of collector core or contrib to check out if it's needed as a dependency"
14+
dependency-target-folder:
15+
required: false
16+
type: string
17+
default: ""
18+
description: "The collector dependency will be put into this folder"
19+
20+
env:
21+
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
22+
GORELEASER_PRO_VERSION: v2.11.0
23+
24+
jobs:
25+
goreleaser:
26+
runs-on: ubuntu-latest
27+
28+
permissions:
29+
id-token: write
30+
packages: write
31+
contents: write
32+
33+
steps:
34+
- name: Checkout Releases Repo
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Push ${{ inputs.binary }} Tag
40+
run: |
41+
tag="cmd/${{ inputs.binary }}/${{ github.ref_name }}"
42+
message="Releasing ${{ inputs.binary }} binaries for ${{ github.ref_name }}"
43+
git config user.name "${GITHUB_ACTOR}"
44+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
45+
git tag -a "${tag}" -m "${message}"
46+
git push origin "${tag}"
47+
48+
- name: Checkout Collector dependency repo
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
with:
51+
fetch-depth: 0
52+
repository: ${{ inputs.collector-dependency }}
53+
ref: ${{ github.ref_name }}
54+
path: ${{ inputs.dependency-target-folder }}
55+
56+
- name: Copy Dockerfile to Core Repo directory
57+
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
58+
59+
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
60+
61+
- uses: anchore/sbom-action/download-syft@cee1b8e05ae5b2593a75e197229729eabaa9f8ec # v0.20.2
62+
63+
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
64+
with:
65+
platforms: amd64,arm64,ppc64le
66+
67+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
68+
69+
- name: Setup Go
70+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
71+
with:
72+
go-version: "~1.24"
73+
74+
- name: Log into Docker.io
75+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
76+
with:
77+
username: ${{ vars.DOCKER_USERNAME }}
78+
password: ${{ secrets.DOCKER_TOKEN_COLLECTOR_RELEASES }}
79+
80+
- name: Login to GitHub Package Registry
81+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
82+
with:
83+
registry: ghcr.io
84+
username: ${{ github.repository_owner }}
85+
password: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Run GoReleaser
88+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
89+
with:
90+
distribution: goreleaser-pro
91+
version: ${{ env.GORELEASER_PRO_VERSION }}
92+
args: release --clean -f cmd/${{ inputs.binary }}/.goreleaser.yml
93+
env:
94+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
COSIGN_YES: true
97+
SKIP_SIGNS: false
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI - Binaries
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
binary:
7+
required: true
8+
type: string
9+
description: "Which binary to build. Possible options: ['builder', 'opampsupervisor']"
10+
collector-dependency:
11+
required: false
12+
type: string
13+
default: ""
14+
description: "Set this to the repo slug of collector core or contrib to check out if it's needed as a dependency"
15+
dependency-target-folder:
16+
required: false
17+
type: string
18+
default: ""
19+
description: "The collector dependency will be put into this folder"
20+
21+
22+
env:
23+
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
24+
GORELEASER_PRO_VERSION: v2.11.0
25+
26+
jobs:
27+
check-goreleaser:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout Releases Repo
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Checkout Collector dependency repo
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
with:
38+
fetch-depth: 0
39+
repository: ${{ inputs.collector-dependency }}
40+
path: ${{ inputs.dependency-target-folder }}
41+
42+
- name: Copy Dockerfile to Core Repo directory
43+
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
44+
45+
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
46+
47+
- uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
48+
49+
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
50+
with:
51+
platforms: amd64,arm64,ppc64le
52+
53+
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
54+
55+
- name: Setup Go
56+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
57+
with:
58+
go-version: "~1.24"
59+
60+
- name: Check GoReleaser
61+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
62+
with:
63+
distribution: goreleaser-pro
64+
version: ${{ env.GORELEASER_PRO_VERSION }}
65+
args: check --verbose -f cmd/${{ inputs.binary }}/.goreleaser.yml
66+
env:
67+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Run GoReleaser
71+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
72+
with:
73+
distribution: goreleaser-pro
74+
version: ${{ env.GORELEASER_PRO_VERSION }}
75+
args: --snapshot --clean -f cmd/${{ inputs.binary }}/.goreleaser.yml
76+
env:
77+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
COSIGN_YES: false
80+
SKIP_SIGNS: true

.github/workflows/ci-builder.yaml

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI - Builder
22

33
on:
4-
merge_group:
4+
merge_group:
55
push:
66
branches:
77
- main
@@ -27,53 +27,12 @@ on:
2727
- "go.mod"
2828
- "go.sum"
2929

30-
env:
31-
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
32-
GORELEASER_PRO_VERSION: v2.11.2
33-
3430
jobs:
35-
check-goreleaser:
36-
runs-on: ubuntu-latest
37-
steps:
38-
- name: Checkout Releases Repo
39-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40-
with:
41-
fetch-depth: 0
42-
- name: Checkout Core Repo
43-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44-
with:
45-
fetch-depth: 0
46-
repository: "open-telemetry/opentelemetry-collector"
47-
path: ".core"
48-
- name: Copy Dockerfile to Core Repo directory
49-
run: cp cmd/builder/Dockerfile .core/cmd/builder/Dockerfile
50-
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
51-
- uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
52-
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
53-
with:
54-
platforms: amd64, arm64,ppc64le
55-
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
56-
- name: Setup Go
57-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
58-
with:
59-
go-version: "~1.24"
60-
- name: Check GoReleaser
61-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
62-
with:
63-
distribution: goreleaser-pro
64-
version: ${{ env.GORELEASER_PRO_VERSION }}
65-
args: check --verbose -f cmd/builder/.goreleaser.yml
66-
env:
67-
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
- name: Run GoReleaser
70-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
71-
with:
72-
distribution: goreleaser-pro
73-
version: ${{ env.GORELEASER_PRO_VERSION }}
74-
args: --snapshot --clean -f cmd/builder/.goreleaser.yml
75-
env:
76-
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
77-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
COSIGN_YES: false
79-
SKIP_SIGNS: true
31+
ci:
32+
uses: ./.github/workflows/base-ci-binary.yaml
33+
with:
34+
binary: builder
35+
collector-dependency: 'open-telemetry/opentelemetry-collector'
36+
dependency-target-folder: '.core'
37+
secrets: inherit
38+
permissions: write-all

.github/workflows/ci-opampsupervisor.yaml

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- main
88
- release/*
99
paths:
10+
- "distributions/otelcol/**"
1011
- "cmd/**"
1112
- ".github/**"
1213
- "scripts/**"
@@ -18,60 +19,20 @@ on:
1819
- main
1920
- release/*
2021
paths:
22+
- "distributions/otelcol/**"
2123
- "cmd/**"
2224
- ".github/**"
2325
- "scripts/**"
2426
- "Makefile"
2527
- "go.mod"
2628
- "go.sum"
2729

28-
env:
29-
# renovate: datasource=github-releases depName=goreleaser/goreleaser-pro
30-
GORELEASER_PRO_VERSION: v2.11.2
31-
3230
jobs:
33-
check-goreleaser:
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Checkout Releases Repo
37-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38-
with:
39-
fetch-depth: 0
40-
- name: Checkout Core Repo
41-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42-
with:
43-
fetch-depth: 0
44-
repository: "open-telemetry/opentelemetry-collector-contrib"
45-
path: ".contrib"
46-
- name: Copy Dockerfile to Core Repo directory
47-
run: cp cmd/opampsupervisor/Dockerfile .contrib/cmd/opampsupervisor/Dockerfile
48-
- uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
49-
- uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4
50-
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
51-
with:
52-
platforms: amd64, arm64,ppc64le
53-
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
54-
- name: Setup Go
55-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
56-
with:
57-
go-version: "~1.24"
58-
- name: Check GoReleaser
59-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
60-
with:
61-
distribution: goreleaser-pro
62-
version: ${{ env.GORELEASER_PRO_VERSION }}
63-
args: check --verbose -f cmd/opampsupervisor/.goreleaser.yml
64-
env:
65-
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
- name: Run GoReleaser
68-
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
69-
with:
70-
distribution: goreleaser-pro
71-
version: ${{ env.GORELEASER_PRO_VERSION }}
72-
args: --snapshot --clean -f cmd/opampsupervisor/.goreleaser.yml
73-
env:
74-
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
75-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76-
COSIGN_YES: false
77-
SKIP_SIGNS: true
31+
ci:
32+
uses: ./.github/workflows/base-ci-binary.yaml
33+
with:
34+
binary: opampsupervisor
35+
collector-dependency: 'open-telemetry/opentelemetry-collector-contrib'
36+
dependency-target-folder: '.contrib'
37+
secrets: inherit
38+
permissions: write-all

0 commit comments

Comments
 (0)