-
Notifications
You must be signed in to change notification settings - Fork 228
124 lines (107 loc) · 4.42 KB
/
base-ci-binary.yaml
File metadata and controls
124 lines (107 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI - Other Binaries
on:
workflow_call:
inputs:
binary:
required: true
type: string
description: "Which binary to build. Possible options: ['builder', 'opampsupervisor']"
collector-dependency:
required: false
type: string
default: ""
description: "Set this to the repo slug of collector core or contrib to check out if it's needed as a dependency"
dependency-target-folder:
required: false
type: string
default: ""
description: "The collector dependency will be put into this folder"
linux-packages:
required: false
type: boolean
default: false
description: "Set to true if linux packages should be uploaded as an artifact"
windows-msi:
required: false
type: boolean
default: false
description: 'Set to true if windows msi should be uploaded as an artifact'
permissions:
contents: read
env:
# renovate: datasource=github-releases packageName=goreleaser/goreleaser-pro
GORELEASER_PRO_VERSION: v2.13.3
jobs:
check-goreleaser:
runs-on: ubuntu-24.04
steps:
- name: Checkout Releases Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Checkout Collector dependency repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
repository: ${{ inputs.collector-dependency }}
path: ${{ inputs.dependency-target-folder }}
- name: Copy Dockerfile to Core Repo directory
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
- name: Copy MSI files to Core Repo directory
if: inputs.windows-msi == true
run: |
cp cmd/${{ inputs.binary }}/opentelemetry.ico ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
cp cmd/${{ inputs.binary }}/config.windows.example.yaml ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
- uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
with:
cosign-release: "v2.6.1"
- uses: anchore/sbom-action/download-syft@62ad5284b8ced813296287a0b63906cb364b73ee # v0.22.0
- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
with:
platforms: amd64,arm64,ppc64le,riscv64
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Setup Go
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: "~1.25.0"
- name: Setup wixl # Required to build MSI packages for Windows
if: inputs.windows-msi == true && runner.os != 'Windows'
run: |
sudo apt-get update
sudo apt-get install -y wixl
- name: Check GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
distribution: goreleaser-pro
version: ${{ env.GORELEASER_PRO_VERSION }}
args: check --verbose -f cmd/${{ inputs.binary }}/.goreleaser.yaml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
distribution: goreleaser-pro
version: ${{ env.GORELEASER_PRO_VERSION }}
args: --snapshot --clean -f cmd/${{ inputs.binary }}/.goreleaser.yaml --skip sign
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: false
- name: Upload linux service packages
if: ${{ inputs.linux-packages == true }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: linux-packages
path: |
dist/*amd64*.deb
dist/*amd64*.rpm
if-no-files-found: error
- name: Upload Windows MSI
if: ${{ inputs.windows-msi == true }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: windows-msi
path: |
dist/msi/**/*.msi
if-no-files-found: error