forked from observIQ/bindplane-otel-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (67 loc) · 2.85 KB
/
manual_msi_build.yml
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
name: manual_msi_build
on:
workflow_dispatch:
inputs:
version:
description: "Collector Version"
required: true
default: "v0.0.1"
jobs:
build-64bit-msi:
runs-on: windows-2022
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser-pro
version: "v2.1.0"
args: build --single-target --skip=validate --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- name: Copy Windows Collector Binary
run: cp dist/windows_amd64/collector_windows_amd64_v1/observiq-otel-collector.exe windows/observiq-otel-collector.exe
- name: Copy Windows Updater Binary
run: cp dist/windows_amd64/updater_windows_amd64_v1/updater.exe windows/updater.exe
- name: Copy Plugins to MSI Build Directory
run: cp -r release_deps/plugins windows/
- name: Copy Example Config
run: cp config/example.yaml windows/config.yaml
- name: Copy Logging Config
run: cp config/logging.yaml windows/logging.yaml
- name: Copy JMX Receiver Jar
run: cp release_deps/opentelemetry-java-contrib-jmx-metrics.jar windows/opentelemetry-java-contrib-jmx-metrics.jar
- name: Copy LICENSE
run: cp LICENSE windows/LICENSE
- name: Copy VERSION file
run: cp release_deps/VERSION.txt windows/VERSION.txt
# HACK: Copy build directory to C drive to avoid this error, since there must be a relative path from the tempdir that go-msi uses
# for the MSI to build properly
- name: Copy Build Dir
run: |
cp -r windows C:/build
echo "C:/build" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Installs go-msi and wix.
- name: Install Build Tools
run: |
curl -f -L -o go-msi.exe https://github.com/observIQ/go-msi/releases/download/v2.2.0/go-msi.exe
curl -f -L -o wix310-binaries.zip https://github.com/wixtoolset/wix3/releases/download/wix3104rtm/wix310-binaries.zip
unzip wix310-binaries.zip
working-directory: C:/build
- name: "Build MSI from Tagged Release"
run: go-msi.exe make -m observiq-otel-collector.msi --version ${{ github.event.inputs.version }} --arch amd64
working-directory: C:/build
- name: "Upload MSI"
uses: actions/upload-artifact@v4
with:
name: observiq-otel-collector.msi
path: C:/build/observiq-otel-collector.msi
# Short lived because this is meant as an action for developers
retention-days: 1