-
Notifications
You must be signed in to change notification settings - Fork 2
168 lines (142 loc) · 3.99 KB
/
release-kloudlite.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: release kloudlite
on:
workflow_dispatch:
push:
branches:
- 'release-v*'
tags:
- '*'
paths:
- api
- operator
- infrastructure-as-code
- kubelet-metrics-reexporter
- autoscaler
- "api/**"
- "operator/**"
- "infrastructure-as-code/**"
- "kubelet-metrics-reexporter/**"
- "autoscaler/**"
- "kl/**"
- "web/**"
- ".github/workflows/**"
permissions:
contents: write
packages: write
jobs:
# setup:
# - uses: dorny/paths-filter@v3
# id: changes
# with:
# filters: |
# api:
# - 'api/**'
# operator:
# - 'operator/**'
# infrastructure-as-code:
# - 'infrastructure-as-code/**'
web:
uses: ./.github/workflows/web.yml
kl:
uses: ./.github/workflows/kl.yml
api:
uses: ./.github/workflows/api.yml
operator:
uses: ./.github/workflows/operator.yml
infrastructure-as-code:
uses: ./.github/workflows/iac.yml
autoscaler:
uses: ./.github/workflows/autoscaler.yml
kubelet-metrics-reexporter:
uses: ./.github/workflows/kubelet-metrics-reexporter.yml
k3s:
runs-on: ubuntu-latest
name: supported k3s binary
env:
K3S_VERSION: "v1.28.6+k3s2"
steps:
- name: k3s binary download
run: |+
curl -L0 "https://github.com/k3s-io/k3s/releases/download/$K3S_VERSION/k3s" > ./k3s
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: k3s
path: ./k3s
github_release:
needs:
- api
- operator
- infrastructure-as-code
- autoscaler
- web
- kl
- kubelet-metrics-reexporter
runs-on: ubuntu-latest
name: Creating a Github Release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: k3s-runner
path: k3s-runner-artifacts
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: kl
path: kl-artifacts
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: k3s
path: k3s
- run: |+
ls k3s-runner-artifacts/*
ls kl-artifacts/*
ls k3s/*
- name: Create Release Tag from branch name
id: gitref_branch
if: startsWith(github.ref, 'refs/heads/release')
shell: bash
run: |
set +e
RELEASE_TAG=${GITHUB_REF#refs/heads/release-}
echo "$RELEASE_TAG" | grep -i '\-nightly$'
if [ $? -ne 0 ]; then
RELEASE_TAG="$RELEASE_TAG-nightly"
fi
set -e
echo "release_tag=$RELEASE_TAG" >> $GITHUB_ENV
echo "override_release_assets=true" >> $GITHUB_ENV
echo "github_branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Create Release Tag from git tag
if: startsWith(github.ref, 'refs/tags/')
id: gitref_tag
shell: bash
run: |
RELEASE_TAG=$(echo ${GITHUB_REF#refs/tags/})
echo "release_tag=$RELEASE_TAG" >> $GITHUB_ENV
echo "override_release_assets=false" >> $GITHUB_ENV
- name: Github Release
uses: ./.github/actions/github-release/
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_tag: ${{ env.release_tag }}
github_ref: ${GITHUB_REF}
files: |+
k3s-runner-artifacts/**
kl-artifacts/**
k3s/**
- name: Push Nightly Release To Discord
uses: ./.github/actions/discord/
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL_NIGHTLY }}
- name: Push Release To Discord
if: startsWith(github.ref, 'refs/tags/')
uses: ./.github/actions/discord/
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}