Skip to content

Commit 8d67a08

Browse files
[opampsupervisor] Reapply and fix MSI installer with fixed release workflow (#1337)
* Reapply "[opampsupervisor] Add MSI installer to release artifacts (#1261)" (#1332) This reverts commit 47811da. * Install wixl on binary release workflow Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> * Add new changelog entry Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> * Rename changelog file Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> * Gate some build steps behind explicit msi input Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --------- Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
1 parent c2cf2d8 commit 8d67a08

File tree

19 files changed

+234
-0
lines changed

19 files changed

+234
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
5+
component: opampsupervisor
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Readd fixed MSI package release artifacts for the OpAMP supervisor
9+
10+
# One or more tracking issues or pull requests related to the change
11+
issues: [1261, 1332]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:
17+
18+
# Optional: The change log or logs in which this entry should be included.
19+
# e.g. '[user]' or '[user, api]'
20+
# Include 'user' if the change is relevant to end users.
21+
# Include 'api' if there is a change to a library API.
22+
# Default: '[user]'
23+
change_logs: [user]

.github/workflows/base-binary-release.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
type: string
1717
default: ""
1818
description: "The collector dependency will be put into this folder"
19+
windows-msi:
20+
required: false
21+
type: boolean
22+
default: false
23+
description: "Set to true if the binary needs a Windows MSI to be built"
1924

2025
env:
2126
# renovate: datasource=github-releases packageName=goreleaser/goreleaser-pro
@@ -85,6 +90,12 @@ jobs:
8590
- name: Copy Dockerfile to Collector dependency directory
8691
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
8792

93+
- name: Copy MSI files to Core Repo directory
94+
if: inputs.windows-msi == true
95+
run: |
96+
cp cmd/${{ inputs.binary }}/opentelemetry.ico ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
97+
cp cmd/${{ inputs.binary }}/config.windows.example.yaml ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
98+
8899
- uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
89100
with:
90101
cosign-release: "v2.6.1"
@@ -102,6 +113,12 @@ jobs:
102113
with:
103114
go-version: "~1.25.0"
104115

116+
- name: Setup wixl # Required to build MSI packages for Windows
117+
if: inputs.windows-msi == true && runner.os != 'Windows'
118+
run: |
119+
sudo apt-get update
120+
sudo apt-get install -y wixl
121+
105122
- name: Log into Docker.io
106123
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
107124
with:

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
type: boolean
2323
default: false
2424
description: "Set to true if linux packages should be uploaded as an artifact"
25+
windows-msi:
26+
required: false
27+
type: boolean
28+
default: false
29+
description: 'Set to true if windows msi should be uploaded as an artifact'
2530

2631
permissions:
2732
contents: read
@@ -49,6 +54,12 @@ jobs:
4954
- name: Copy Dockerfile to Core Repo directory
5055
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
5156

57+
- name: Copy MSI files to Core Repo directory
58+
if: inputs.windows-msi == true
59+
run: |
60+
cp cmd/${{ inputs.binary }}/opentelemetry.ico ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
61+
cp cmd/${{ inputs.binary }}/config.windows.example.yaml ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
62+
5263
- uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
5364
with:
5465
cosign-release: "v2.6.1"
@@ -66,6 +77,12 @@ jobs:
6677
with:
6778
go-version: "~1.25.0"
6879

80+
- name: Setup wixl # Required to build MSI packages for Windows
81+
if: inputs.windows-msi == true && runner.os != 'Windows'
82+
run: |
83+
sudo apt-get update
84+
sudo apt-get install -y wixl
85+
6986
- name: Check GoReleaser
7087
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
7188
with:
@@ -96,3 +113,12 @@ jobs:
96113
dist/*amd64*.deb
97114
dist/*amd64*.rpm
98115
if-no-files-found: error
116+
117+
- name: Upload Windows MSI
118+
if: ${{ inputs.windows-msi == true }}
119+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
120+
with:
121+
name: windows-msi
122+
path: |
123+
dist/msi/**/*.msi
124+
if-no-files-found: error

.github/workflows/ci-opampsupervisor.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ jobs:
3838
collector-dependency: 'open-telemetry/opentelemetry-collector-contrib'
3939
dependency-target-folder: '.contrib'
4040
linux-packages: true
41+
windows-msi: true
4142
secrets: inherit
4243
permissions: write-all

.github/workflows/release-opampsupervisor.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ jobs:
1515
binary: opampsupervisor
1616
collector-dependency: 'open-telemetry/opentelemetry-collector-contrib'
1717
dependency-target-folder: '.contrib'
18+
windows-msi: true
1819
secrets: inherit
1920
permissions: write-all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dist/
77
.core
88
.contrib
99
.tools
10+
.DS_Store
11+
.zed

cmd/builder/.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
12
version: 2
23
project_name: opentelemetry-collector-releases
34
env:

cmd/goreleaser/internal/distro_opamp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
withBinaryMonorepo(".contrib/cmd/opampsupervisor").
3434
withDefaultBinaryRelease(opampReleaseHeader).
3535
withDefaultNfpms().
36+
withDefaultMSIConfig().
3637
// This is required because of some non-obvious path/workdir handling in
3738
// Github Actions specific to the binaries CI.
3839
withConfigFunc(func(d *distribution) {
@@ -48,6 +49,9 @@ var (
4849
d.Nfpms[0].Scripts.PreInstall = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PreInstall)
4950
d.Nfpms[0].Scripts.PostInstall = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PostInstall)
5051
d.Nfpms[0].Scripts.PreRemove = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PreRemove)
52+
53+
d.MsiConfig[0].Files = append(d.MsiConfig[0].Files, "config.windows.example.yaml")
54+
d.MsiConfig[0].WXS = path.Join("cmd", d.Name, d.MsiConfig[0].WXS)
5155
}).
5256
withNightlyConfig().
5357
build()

cmd/goreleaser/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func main() {
2525
}
2626
project := internal.BuildDistribution(*distFlag, *contribBuildOrRestFlag)
2727

28+
os.Stdout.WriteString("# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json\n")
2829
e := yaml.NewEncoder(os.Stdout)
2930
e.SetIndent(2)
3031
if err := e.Encode(&project); err != nil {

cmd/opampsupervisor/.goreleaser.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
12
version: 2
23
project_name: opentelemetry-collector-releases
34
env:
@@ -13,6 +14,13 @@ release:
1314
name: opentelemetry-collector-releases
1415
make_latest: "false"
1516
header: '### Release of OpAMP supervisor artifacts'
17+
msi:
18+
- id: opampsupervisor
19+
name: opampsupervisor_{{ .Version }}_{{ .Os }}_{{ .MsiArch }}
20+
wxs: cmd/opampsupervisor/windows-installer.wxs
21+
extra_files:
22+
- opentelemetry.ico
23+
- config.windows.example.yaml
1624
builds:
1725
- id: opampsupervisor-linux
1826
goos:

0 commit comments

Comments
 (0)