forked from kubernetes-sigs/kustomize
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (105 loc) · 2.94 KB
/
release-kyaml.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: release-kyaml
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: release type (major, minor, or patch).
options:
- major
- minor
- patch
required: true
default: 'patch'
release_branch:
type: string
description: release branch name "release-kyaml-v*"
required: true
default: 'master'
jobs:
pre-build:
name: Pre-build
runs-on: ubuntu-latest
steps:
- name: Fetch changes
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.release_branch }}
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: "**/*.sum"
- name: Unit test
id: unit_test
run: |
# Run unit test
echo "Executing unit test"
go install github.com/jstemmer/go-junit-report@latest
make test-unit-all | go-junit-report -set-exit-code > report.xml
- name: Test Summary
uses: test-summary/action@v2
with:
paths: |
./report.xml
if: always()
build:
name: Build
needs: pre-build
runs-on: ubuntu-latest
steps:
- name: Fetch changes
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.release_branch }}
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: "**/*.sum"
- name: Build test
run: |
make build-kustomize-api
release:
name: Release
needs: build
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Fetch changes
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.release_branch }}
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: "**/*.sum"
- name: Release kyaml
run: |
# Prepare git
git config --global user.email "development@kustomize.io"
git config --global user.name "Development"
git checkout ${{inputs.release_branch}}
# Release kyaml
make install-tools
gorepomod release kyaml ${{ inputs.release_type }} --local --doIt
- name: Create release changelog
run: |
# Create release draft
changelog_file=$(mktemp)
currentTag=$(git describe --tags)
./releasing/compile-changelog.sh "kyaml" "${currentTag}" "${changelog_file}"
# Create github releases
gh release create "${currentTag}" \
--title "${currentTag}" \
--draft \
--notes-file "${changelog_file}"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}