-
Notifications
You must be signed in to change notification settings - Fork 524
87 lines (77 loc) · 2.69 KB
/
bump-golang.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
---
name: bump-golang
on:
workflow_dispatch:
schedule:
- cron: '0 20 * * 6'
permissions:
contents: read
jobs:
labels:
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
backports: ${{ steps.labels.outputs.backports }}
steps:
- id: generate
name: Generate matrix
uses: elastic/apm-pipeline-library/.github/actions/elastic-stack-snapshot-branches@current
with:
exclude-branches: '7.17,main'
- uses: actions/github-script@v7
id: labels
env:
BRANCHES: ${{ steps.generate.outputs.branches }}
with:
script: |
// We only support the latest minor version
const branches = JSON.parse(process.env.BRANCHES)
.sort((a, b) => parseFloat(b) - parseFloat(a));
const latest = branches[0]
core.setOutput("backports", `backport-${branches[0].trim()}`)
bump:
runs-on: ubuntu-latest
needs: [labels]
steps:
- uses: actions/checkout@v4
<<<<<<< HEAD
- uses: elastic/oblt-actions/updatecli/[email protected]
=======
- uses: elastic/oblt-actions/updatecli/run@v1
>>>>>>> 3351902f8 (updatecli: use updatecli policies (#13934))
with:
command: --experimental apply --config .ci/updatecli/bump-golang.yml --values .ci/updatecli/values.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
GITHUB_BRANCH: 'main'
GITHUB_LABELS: ${{ needs.labels.outputs.backports }}
- if: ${{ failure() }}
uses: elastic/oblt-actions/slack/send@v1
bump-7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '7.17'
- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: --experimental apply --config .ci/updatecli/bump-golang.yml --values .ci/updatecli/values.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
GITHUB_BRANCH: '7.17'
GITHUB_LABELS: 'backport-skip'
notify:
runs-on: ubuntu-latest
needs: [bump, bump-7]
if: always()
steps:
- id: check
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- if: ${{ steps.check.outputs.isSuccess == 'false' }}
uses: elastic/oblt-actions/slack/send@v1
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-server"
message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"