forked from SumoLogic/sumologic-otel-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (129 loc) · 4.53 KB
/
chris-test.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Releases
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-rc.[0-9]+'
defaults:
run:
shell: bash
env:
GO_VERSION: "1.21.4"
jobs:
get-version:
name: Get application version for this revision
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: get-version
run: |
echo "version=$(echo ${GITHUB_REF#refs/tags/v})" > $GITHUB_OUTPUT
- name: Print version
run: echo ::notice title=Version::${{ steps.get-version.outputs.version }}
package-msi:
name: Package MSI
runs-on: windows-2019
needs:
- build
strategy:
matrix:
include:
- arch_os: windows_amd64
platform: x64
fips: false
steps:
- uses: actions/checkout@v4
- name: Fetch current branch
run: ./ci/fetch_current_branch.sh
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# Store the install script from the packaging repository as a release artifact.
# Originally, this script was stored in this repository, and the official download url pointed
# to the most recent release here. The script has since been moved to the packaging repository.
# It is kept here for backwards compatibility. Once the download count for this artifact
# reaches 0 for new releases, this can be removed.
install-script:
name: Store install script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: SumoLogic/sumologic-otel-collector-packaging
- name: Store Linux install script as action artifact
uses: actions/upload-artifact@v4
with:
name: install.sh
path: ./install-script/install.sh
if-no-files-found: error
- name: Sign PowerShell Install Script
uses: skymatic/code-sign-action@v3
with:
certificate: '${{ secrets.MICROSOFT_CERTIFICATE }}'
password: '${{ secrets.MICROSOFT_CERTIFICATE_PASSWORD }}'
certificatesha1: '${{ secrets.MICROSOFT_CERTHASH }}'
certificatename: '${{ secrets.MICROSOFT_CERTNAME }}'
description: '${{ secrets.MICROSOFT_DESCRIPTION }}'
folder: ./install-script/
- name: Store Windows install script as action artifact
uses: actions/upload-artifact@v4
with:
name: install.ps1
path: ./install-script/install.ps1
if-no-files-found: error
create-release:
name: Create Github release
runs-on: ubuntu-20.04
needs:
- package-msi
- get-version
steps:
- name: Download all binaries stored as artifact
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: Add version to binary names
working-directory: artifacts/
run: |
find . -type f -name 'otelcol-sumo*' \
| grep -v '\.msi' \
| sed 's/^\.\///' \
| while read -r file; do
new_name=$(echo "$file" | sed 's/otelcol-sumo/otelcol-sumo-${{ needs.get-version.outputs.version }}/g')
mv "$file" "$new_name"
done
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: false
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
body: |
## v${{ needs.get-version.outputs.version }}
**TODO**
### Upstream releases
** TODO: Add upstream versions in the links below**
Core: https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v
Contrib: https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v
### Changelog
**TODO**
### Container images:
```
docker pull public.ecr.aws/sumologic/sumologic-otel-collector:${{ needs.get-version.outputs.version }}
```
artifacts: "artifacts/*"
artifactErrorsFailBuild: true
replacesArtifacts: true