-
Notifications
You must be signed in to change notification settings - Fork 39
143 lines (122 loc) · 3.86 KB
/
tag-release.yaml
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
---
name: Build and release versioned container images
# yamllint disable-line rule:truthy
on:
create
jobs:
tag_bundle:
name: Build and release the bundle container-image
if: >
github.repository == 'csi-addons/kubernetes-csi-addons'
&&
github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Generate the bundle contents
run: make bundle TAG=${{ github.ref_name }}
- name: Validate the bundle contents
run: make bundle-validate
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build bundle container image
uses: docker/build-push-action@v6
with:
context: .
file: bundle.Dockerfile
push: true
tags: quay.io/csiaddons/k8s-bundle:${{ github.ref_name }}
tag_controller:
name: Build and release the controller container-image
if: >
github.repository == 'csi-addons/kubernetes-csi-addons'
&&
github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push controller container image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: quay.io/csiaddons/k8s-controller:${{ github.ref_name }}
tag_sidecar:
name: Build and release the sidecar container-image
if: >
github.repository == 'csi-addons/kubernetes-csi-addons'
&&
github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build and push sidecar container image
uses: docker/build-push-action@v6
with:
context: .
file: build/Containerfile.sidecar
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: quay.io/csiaddons/k8s-sidecar:${{ github.ref_name }}
publish_release:
name: Publish a release based on the tag
if: >
github.repository == 'csi-addons/kubernetes-csi-addons'
&&
github.ref_type == 'tag'
needs:
- tag_bundle
- tag_controller
- tag_sidecar
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Generate manifests for installation by kubectl
run: make manifests TAG=${{ github.ref_name }}
- name: Publish the release and attach YAML files
uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
artifacts: "deploy/*/*.yaml"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}