-
Notifications
You must be signed in to change notification settings - Fork 608
56 lines (49 loc) · 1.87 KB
/
release.yaml
File metadata and controls
56 lines (49 loc) · 1.87 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
name: "Create the release"
on:
push:
branches:
- 'release/**'
- 'main'
paths:
- 'versions.txt'
permissions:
contents: read
jobs:
get-versions:
runs-on: ubuntu-latest
outputs:
current_version: ${{ steps.get-versions.outputs.current_version }}
desired_version: ${{ steps.get-versions.outputs.desired_version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: "Get versions from versions.txt"
id: get-versions
run: |
echo "desired_version=$(grep -v '#' versions.txt | grep operator= | awk -F= '{print $2}')" >> $GITHUB_OUTPUT
echo "current_version=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT
release:
permissions:
contents: write # required for creating GitHub releases
runs-on: ubuntu-latest
needs: get-versions
if: needs.get-versions.outputs.desired_version != needs.get-versions.outputs.current_version
env:
CURRENT_VERSION: ${{ needs.get-versions.outputs.current_version }}
DESIRED_VERSION: ${{ needs.get-versions.outputs.desired_version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: "~1.26.1"
- name: "generate release resources"
run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator" VERSION=${DESIRED_VERSION}
- name: "create the release in GitHub"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./.ci/create-release-github.sh
- name: "refresh go proxy module info on release"
run: |
curl https://proxy.golang.org/github.com/open-telemetry/opentelemetry-operator/@v/${DESIRED_VERSION}.info