-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (61 loc) · 2.48 KB
/
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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
jobs:
release:
permissions:
contents: write # for release
packages: write # for publishing docker images
name: Release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Retrieve build information
id: build
run: |
VERSION="${GITHUB_REF#refs/tags/}"
echo "Releasing ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check out code
uses: actions/checkout@v4
- name: Build bootstrap provider image
run: make BOOTSTRAP_IMG_TAG=${{ env.VERSION }} docker-build-bootstrap
- name: Build controlplane provider image
run: make CONTROLPLANE_IMG_TAG=${{ env.VERSION }} docker-build-controlplane
- name: Publish bootstrap provider image
run: |
make BOOTSTRAP_IMG_TAG=${{ env.VERSION }} docker-push-bootstrap
make BOOTSTRAP_IMG_TAG=${{ env.VERSION }} docker-manifest-bootstrap
- name: Publish controlplane provider image
run: |
make CONTROLPLANE_IMG_TAG=${{ env.VERSION }} docker-push-controlplane
make CONTROLPLANE_IMG_TAG=${{ env.VERSION }} docker-manifest-controlplane
- name: Build manifests
run: |
make release
sed -i "s,ghcr.io/canonical/cluster-api-k8s/bootstrap-controller:latest,ghcr.io/canonical/cluster-api-k8s/bootstrap-controller:${{ env.VERSION }}," out/bootstrap-components.yaml
sed -i "s,ghcr.io/canonical/cluster-api-k8s/controlplane-controller:latest,ghcr.io/canonical/cluster-api-k8s/controlplane-controller:${{ env.VERSION }}," out/control-plane-components.yaml
- name: Create GitHub Release
uses: softprops/[email protected]
with:
name: 'Release ${{ env.VERSION }}'
tag_name: ${{ env.VERSION }}
files: |
out/bootstrap-components.yaml
out/control-plane-components.yaml
out/metadata.yaml
generate_release_notes: true
draft: ${{ contains(env.VERSION, 'rc') }}
prerelease: ${{ contains(env.VERSION, 'rc') }}