-
Notifications
You must be signed in to change notification settings - Fork 420
60 lines (56 loc) · 2.26 KB
/
tools-releases.yml
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
name: Package controller-runtime envtest
on:
push:
branches:
- main
paths:
- 'hack/envtest/_matrix/*.yaml'
permissions:
contents: write
pull-requests: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # tag=v45.0.4
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
done
- name: Build packages
run: |
make release-envtest KUBERNETES_VERSION=${{ env.KUBERNETES_VERSION }}
- name: Release
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # tag=v2.1.0
with:
tag_name: envtest-${{ env.KUBERNETES_VERSION }}
draft: false
make_latest: false
files: |
out/envtest-*.tar.gz
out/envtest-*.tar.gz.sha512
fail_on_unmatched_files: true
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # tag=v7.0.5
with:
commit-message: Promote envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}
title: ":seedling: Promotion of envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}"
body: |
This PR promotes the envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}.
branch: promote-envtest-${{ env.KUBERNETES_VERSION }}
add-paths: |
envtest-releases.yaml