|
1 |
| -name: "Prepare the release" |
| 1 | +name: "Create the release" |
2 | 2 | on:
|
3 | 3 | push:
|
4 |
| - tags: [ 'v*' ] |
| 4 | + branches: |
| 5 | + - 'release/**' |
| 6 | + - 'main' |
| 7 | + paths: |
| 8 | + - 'versions.txt' |
5 | 9 |
|
6 | 10 | jobs:
|
| 11 | + get-versions: |
| 12 | + runs-on: ubuntu-22.04 |
| 13 | + outputs: |
| 14 | + current_version: ${{ steps.get-versions.outputs.current_version }} |
| 15 | + desired_version: ${{ steps.get-versions.outputs.desired_version }} |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + with: |
| 19 | + fetch-depth: 0 |
| 20 | + - name: "Get versions from versions.txt" |
| 21 | + id: get-versions |
| 22 | + run: | |
| 23 | + echo "desired_version=$(grep -v '#' versions.txt | grep operator= | awk -F= '{print $2}')" >> $GITHUB_OUTPUT |
| 24 | + echo "current_version=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_OUTPUT |
| 25 | +
|
7 | 26 | release:
|
8 | 27 | runs-on: ubuntu-22.04
|
| 28 | + needs: get-versions |
| 29 | + if: needs.get-versions.outputs.desired_version != needs.get-versions.outputs.current_version |
| 30 | + env: |
| 31 | + CURRENT_VERSION: ${{ needs.get-versions.outputs.current_version }} |
| 32 | + DESIRED_VERSION: ${{ needs.get-versions.outputs.desired_version }} |
9 | 33 | steps:
|
| 34 | + - uses: actions/checkout@v4 |
| 35 | + |
10 | 36 | - name: Set up Go
|
11 | 37 | uses: actions/setup-go@v5
|
12 | 38 | with:
|
13 | 39 | go-version: "~1.21.1"
|
14 | 40 |
|
15 |
| - - uses: actions/checkout@v4 |
16 |
| - |
17 | 41 | - name: "generate release resources"
|
18 |
| - run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator" |
| 42 | + run: make release-artifacts IMG_PREFIX="ghcr.io/open-telemetry/opentelemetry-operator" VERSION=${DESIRED_VERSION} |
19 | 43 |
|
20 | 44 | - name: "create the release in GitHub"
|
21 | 45 | env:
|
|
24 | 48 |
|
25 | 49 | - name: "refresh go proxy module info on release"
|
26 | 50 | run: |
|
27 |
| - OPERATOR_VERSION=$(git describe --tags) |
28 |
| - curl https://proxy.golang.org/github.com/open-telemetry/opentelemetry-operator/@v/${OPERATOR_VERSION}.info |
29 |
| -
|
30 |
| - operator-hub-prod-release: |
31 |
| - needs: release |
32 |
| - uses: ./.github/workflows/reusable-operator-hub-release.yaml |
33 |
| - with: |
34 |
| - org: redhat-openshift-ecosystem |
35 |
| - repo: community-operators-prod |
36 |
| - secrets: |
37 |
| - OPENTELEMETRYBOT_GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |
38 |
| - |
39 |
| - operator-hub-community-release: |
40 |
| - needs: release |
41 |
| - uses: ./.github/workflows/reusable-operator-hub-release.yaml |
42 |
| - with: |
43 |
| - org: k8s-operatorhub |
44 |
| - repo: community-operators |
45 |
| - secrets: |
46 |
| - OPENTELEMETRYBOT_GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} |
| 51 | + curl https://proxy.golang.org/github.com/open-telemetry/opentelemetry-operator/@v/${DESIRED_VERSION}.info |
0 commit comments