Skip to content

Commit 3a88507

Browse files
authored
New release pipeline in operator (#260)
1 parent 5744c87 commit 3a88507

20 files changed

+154
-150
lines changed

.changes/header.tpl.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

.changes/unreleased/.gitkeep

Whitespace-only changes.

.changes/v0.5.31.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## v0.5.31 - 2024-11-04
2+
### Added
3+
* Initialized a changelog

.changie.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
changesDir: .changes
2+
unreleasedDir: unreleased
3+
headerPath: header.tpl.md
4+
changelogPath: CHANGELOG.md
5+
versionExt: md
6+
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
7+
kindFormat: '### {{.Kind}}'
8+
changeFormat: '* {{.Body}}'
9+
kinds:
10+
- label: Added
11+
auto: minor
12+
- label: Changed
13+
auto: major
14+
- label: Deprecated
15+
auto: minor
16+
- label: Removed
17+
auto: major
18+
- label: Fixed
19+
auto: patch
20+
- label: Security
21+
auto: patch
22+
newlines:
23+
afterChangelogHeader: 1
24+
beforeChangelogVersion: 1
25+
endOfVersion: 1
26+
envPrefix: CHANGIE_

.github/scripts/check-work-copy-equals-to-committed.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/scripts/format-all-go-code.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/scripts/format-go-code.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/scripts/is_autogenerated_file.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: create-release-pr
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-release-pr:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: checkout
11+
uses: actions/checkout@v4
12+
13+
- name: batch-changes
14+
uses: miniscruff/changie-action@v2
15+
with:
16+
version: latest
17+
args: batch patch
18+
19+
- name: merge-changes
20+
uses: miniscruff/changie-action@v2
21+
with:
22+
version: latest
23+
args: merge
24+
25+
- name: print the latest version
26+
id: latest
27+
uses: miniscruff/changie-action@v2
28+
with:
29+
version: latest
30+
args: latest
31+
32+
- name: print the latest version without "v"
33+
id: latest-no-v
34+
uses: miniscruff/changie-action@v2
35+
with:
36+
version: latest
37+
args: latest --remove-prefix
38+
39+
- name: check-chart-version
40+
run: |
41+
VERSION=${{ steps.latest-no-v.outputs.output }}
42+
APP_VERSION=$(grep '^appVersion:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"')
43+
CHART_VERSION=$(grep '^version:' ./deploy/ydb-operator/Chart.yaml | awk '{print $2}' | tr -d '"')
44+
45+
if [ "$APP_VERSION" != "$VERSION" ] || [ "$CHART_VERSION" != "$VERSION" ]; then
46+
echo "Version mismatch: appVersion ($APP_VERSION) or version ($CHART_VERSION) does not match expected version ($VERSION). You most likely forgot to bump the version in Chart.yaml, please do so."
47+
exit 1
48+
else
49+
echo "Version matches: appVersion ($APP_VERSION) and version ($CHART_VERSION) are both $VERSION."
50+
fi
51+
52+
- name: Create Pull Request
53+
uses: peter-evans/create-pull-request@v7
54+
with:
55+
title: Release ${{ steps.latest.outputs.output }}
56+
branch: release/${{ steps.latest.outputs.output }}
57+
commit-message: Release ${{ steps.latest.outputs.output }}
58+
token: ${{ github.token }}

.github/workflows/run-tests.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: checkout
15-
uses: actions/checkout@v3
16-
- name: setup-go
17-
uses: actions/setup-go@v3
18-
with:
19-
go-version: '1.20'
15+
uses: actions/checkout@v4
2016
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v2
22-
with:
23-
version: v1.58.1
24-
code-format-check:
25-
concurrency:
26-
group: lint-autoformat-${{ github.head_ref || github.ref_name }}
27-
cancel-in-progress: true
28-
runs-on: ubuntu-latest
29-
steps:
30-
- name: checkout
31-
uses: actions/checkout@v3
32-
- name: setup-go
33-
uses: actions/setup-go@v3
17+
uses: golangci/golangci-lint-action@v6
3418
with:
35-
go-version: '1.20'
36-
- name: install-utilities
37-
run: |
38-
go install mvdan.cc/gofumpt@v0.5.0
39-
go install github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8
40-
- name: format all files with auto-formatter
41-
run: bash ./.github/scripts/format-all-go-code.sh "$PWD"
42-
- name: check-repository-diff
43-
run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken"
19+
version: v1.61.0
4420
run-unit-tests:
4521
concurrency:
4622
group: run-unit-tests-${{ github.head_ref || github.ref_name }}

0 commit comments

Comments
 (0)