Skip to content

Commit

Permalink
GitHub: Rework release action.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko committed Jul 30, 2024
1 parent 3f37d25 commit 78b5942
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Releases

on:
push:
branches:
- main
- master
# Remove when ready.
- liljx
paths:
- "*/v*.*.*/release.yaml"

jobs:
get-releases:
name: Get releases
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get releases
id: get-releases
# TODO: Replace specific providers in glob with * as soon as it matches all of them anyway.
run: echo releases="$(jq --null-input --args '$ARGS.positional' --compact-output -- {azure,capa}/v*.*.*)" >> "${GITHUB_OUTPUT}"

outputs:
releases: ${{ steps.get-releases.outputs.releases }}

create-release:
name: Create release
runs-on: ubuntu-latest
needs: get-releases

strategy:
matrix:
release: ${{ fromJSON(needs.get-releases.outputs.releases) }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get provider & version
id: get-provider-version
env:
release: ${{ matrix.release }}
run: |
# Get provider & version.
provider="${release%/v*.*.*}"
version="${release#${provider}/}"
# Map provider.
case "${provider}" in
capa)
provider="aws"
;;
esac
# Store provider & version.
echo provider="${provider}" >> "${GITHUB_OUTPUT}"
echo version="${version}" >> "${GITHUB_OUTPUT}"
- name: Get release
id: get-release
env:
GH_TOKEN: ${{ secrets.TAYLORBOT_GITHUB_ACTION }}
provider: ${{ steps.get-provider-version.outputs.provider }}
version: ${{ steps.get-provider-version.outputs.version }}
run: |
# Define tag.
tag="${provider}/${version}"
# Check release.
[ "$(gh release view "${tag}" --json id)" ] && exists=true || exists=false
# Store tag & exists.
echo tag="${tag}" >> "${GITHUB_OUTPUT}"
echo exists="${exists}" >> "${GITHUB_OUTPUT}"
- name: Create release
if: ${{ ! fromJSON(steps.get-release.outputs.exists) }}
env:
GH_TOKEN: ${{ secrets.TAYLORBOT_GITHUB_ACTION }}
release: ${{ matrix.release }}
provider: ${{ steps.get-provider-version.outputs.provider }}
version: ${{ steps.get-provider-version.outputs.version }}
tag: ${{ steps.get-release.outputs.tag }}
run: |
# Define title, notes & files.
title="Workload cluster release ${version} for ${provider}"
notes="This release was automatically created by GitHub Actions."
files=("${release}/release.yaml")
# Determine pre-release.
[[ "${version}" == v*.*.*-* ]] && prerelease="--prerelease" || prerelease=""
# Create release.
echo gh release create --target "${GITHUB_REF_NAME}" "${tag}" --title "${title}" --notes "${notes}" ${files[@]} ${prerelease}
7 changes: 7 additions & 0 deletions capa/v28.0.1-alpha1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# :zap: Giant Swarm Release v28.0.0 for CAPA :zap:

## Changes compared to v27.0.0

- Kubernetes version change from 1.27.14 to 1.28.11
- cloud-provider-aws (formerly aws-cloud-controller-manager-app) from 1.27.7-gs1 to 1.28.6-gs1
- cluster-autoscaler from 1.27.3-gs9 to 1.28.5-gs1
3 changes: 3 additions & 0 deletions capa/v28.0.1-alpha1/announcement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Workload cluster release v28.0.0 for CAPA is available**. This release upgrades Kubernetes version to v1.28.

Further details can be found in the [release notes](https://docs.giantswarm.io/changes/workload-cluster-releases-capa/releases/aws-28.0.0/).
2 changes: 2 additions & 0 deletions capa/v28.0.1-alpha1/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- release.yaml
122 changes: 122 additions & 0 deletions capa/v28.0.1-alpha1/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
apiVersion: release.giantswarm.io/v1alpha1
kind: Release
metadata:
name: aws-28.0.0
spec:
apps:
- name: aws-ebs-csi-driver
version: 2.30.1
dependsOn:
- cloud-provider-aws
- name: aws-ebs-csi-driver-servicemonitors
version: 0.1.0
dependsOn:
- cert-manager
- name: aws-pod-identity-webhook
version: 1.16.0
dependsOn:
- cert-manager
- name: capi-node-labeler
version: 0.5.0
- name: cert-exporter
version: 2.9.0
dependsOn:
- kyverno
- name: cert-manager
version: 3.7.6
dependsOn:
- prometheus-operator-crd
- name: chart-operator-extensions
version: 1.1.2
dependsOn:
- prometheus-operator-crd
- name: cilium
version: 0.24.0
- name: cilium-crossplane-resources
version: 0.1.0
- name: cilium-servicemonitors
version: 0.1.2
dependsOn:
- prometheus-operator-crd
- name: cloud-provider-aws
version: 1.28.6-gs1
dependsOn:
- vertical-pod-autoscaler-crd
- name: cluster-autoscaler
version: 1.28.5-gs1
dependsOn:
- kyverno
- name: coredns
version: 1.21.0
dependsOn:
- cilium
- name: etcd-k8s-res-count-exporter
version: 1.10.0
dependsOn:
- kyverno
- name: external-dns
version: 3.1.0
dependsOn:
- prometheus-operator-crd
- name: irsa-servicemonitors
version: 0.0.1
dependsOn:
- cert-manager
- name: k8s-audit-metrics
version: 0.9.0
dependsOn:
- kyverno
- name: k8s-dns-node-cache
version: 2.6.2
dependsOn:
- kyverno
- name: metrics-server
version: 2.4.2
dependsOn:
- kyverno
- name: net-exporter
version: 1.19.0
dependsOn:
- prometheus-operator-crd
- name: network-policies
version: 0.1.1
catalog: cluster
dependsOn:
- cilium
- name: node-exporter
version: 1.19.0
dependsOn:
- kyverno
- name: observability-bundle
version: 1.3.4
dependsOn:
- coredns
- name: prometheus-blackbox-exporter
version: 0.4.1
dependsOn:
- prometheus-operator-crd
- name: security-bundle
version: 1.7.0
catalog: giantswarm
dependsOn:
- prometheus-operator-crd
- name: teleport-kube-agent
version: 0.9.0
- name: vertical-pod-autoscaler
version: 5.2.2
dependsOn:
- prometheus-operator-crd
- name: vertical-pod-autoscaler-crd
version: 3.1.0
components:
- name: cluster-aws
catalog: cluster
version: 1.0.1
- name: flatcar
version: 3815.2.2
- name: flatcar-variant
version: 1.0.0
- name: kubernetes
version: 1.28.11
date: "2024-07-10T09:00:00Z"
state: active

0 comments on commit 78b5942

Please sign in to comment.