Skip to content

Add release series for v0.2 (#77) #25

Add release series for v0.2 (#77)

Add release series for v0.2 (#77) #25

Workflow file for this run

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/#-action@v3.2.0
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/action-gh-release@v2.0.6
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') }}