-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (138 loc) · 6.35 KB
/
autotag.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
name: autotag
on:
push:
branches: [ main ]
jobs:
autotag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
token: ${{ secrets.PAT }}
- name: Get previous tag
id: agent
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: agent-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: agent-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.agent.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "agent/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=agent-${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: fluentbit
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: fluentbit-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: fluentbit-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.fluentbit.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "fluentbit/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=fluentbit-v${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: grafana
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: grafana-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: grafana-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.grafana.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "grafana/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=grafana-v${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: loki
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: loki-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: loki-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.loki.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "loki/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=loki-v${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: mimir
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: mimir-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: mimir-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.mimir.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "mimir/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=mimir-v${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: tempo
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: tempo-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: tempo-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.tempo.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "tempo/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=tempo-v${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"
- name: Get previous tag
id: yace
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: yace-v0.0.0 # Optional fallback tag to use when no tag can be found
prefix: yace-v # Optional prefix to strip from the tag
- name: Read version from file
run: |
echo "previous_version=${{ steps.yace.outputs.tag }}" >> "$GITHUB_ENV"
CURRENT_VERSION=$(head -n 1 "yace/Dockerfile" | grep "FROM" | cut -d ":" -f 2 | cut -d " " -f 1)
echo "current_version=yace-${CURRENT_VERSION}" >> "$GITHUB_ENV"
- name: Set new tag
if: env.previous_version != env.current_version
uses: rickstaa/action-create-tag@v1
with:
github_token: ${{ secrets.PAT }}
tag: ${{ env.current_version }}
message: "Release ${{ env.current_version }}"