forked from kubernetes-sigs/kustomize
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (122 loc) · 3.65 KB
/
release-kustomize.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: release-kustomize
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-kustomize-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: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: go.work
cache-dependency-path: "**/*.sum"
- name: Test Summary
uses: test-summary/action@v2
with:
paths: |
./report.xml
if: always()
build:
name: Build
runs-on: ubuntu-latest
needs: pre-build
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
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
- name: Install local tools
run: |
make install-local-tools
- name: Pin kyaml, cmd/config, and api
run: |
# Prepare git
git config --global user.email "development@kustomize.io"
git config --global user.name "Development"
git remote add upstream "https://x-access-token:${GITHUB_TOKEN}@github.com/antoooks/kustomize.git"
git remote -v
# Pin dependencies: kyaml, cmd/config, api
# TODO: delete hardcoded version after stable
gorepomod pin kyaml v0.16.0 --doIt
gorepomod pin cmd/config v0.13.0 --doIt
gorepomod pin api v0.16.0 --doIt
- name: Build test
run: |
make build-kustomize-api
- name: Commit pinned dependencies
run: |
# Commit pinned dependencies and handle no commit
git add --all
git commit -m "pin kyaml, cmd/config, api" || true
git push
release:
name: Release
runs-on: ubuntu-latest
needs: build
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
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"
# Release kustomize
make install-local-tools
gorepomod release kustomize ${{ inputs.release_type }} --local --doIt
- name: Build kustomize library and create release
run: |
# Create release draft
./releasing/build-kustomize-library.sh