Skip to content

Add hash and release notes #37

Add hash and release notes

Add hash and release notes #37

Workflow file for this run

name: Package controller-runtime envtest
on:
push:
branches:
- main
- tools-releases
paths:
- 'hack/envtest/_matrix/*.yaml'
permissions:
contents: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@635f118699dd888d737c15018cd30aff2e0274f8 # tag=v44.0.1
with:
files: |
hack/envtest/_matrix/*.yaml
- name: Setup package release version
id: release-version
run: |
if [[ ${{ steps.changed-files.outputs.all_changed_files_count }} != 1 ]]; then
echo "One Kubernetes patch version files should be changed for a release, found ${{ steps.changed-files.outputs.all_changed_files_count }}"
exit 1
fi
for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do
export KUBERNETES_VERSION=$(echo "${changed_file}" | grep -oP '(?<=/)[^/]+(?=\.yaml)')
echo "KUBERNETES_VERSION=$KUBERNETES_VERSION" >> $GITHUB_ENV
GO_VERSION=$(yq eval '.go' $changed_file)
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV
ETCD_VERSION=$(yq eval '.etcd' $changed_file)
echo "ETCD_VERSION=$ETCD_VERSION" >> $GITHUB_ENV
done
- name: Build packages
run: |
make release-envtest \
KUBERNETES_VERSION=${{ env.KUBERNETES_VERSION }} \
GO_VERSION=${{ env.GO_VERSION }} \
ETCD_VERSION=${{ env.ETCD_VERSION }}
- name: Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # tag=v2.0.4
with:
name: envtest-${{ env.KUBERNETES_VERSION }}
draft: true
prerelease: true
make_latest: false
files: out/envtest-*.tar.gz
fail_on_unmatched_files: true
body_path: out/release-notes.md