Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorres committed Nov 4, 2024
1 parent 5744c87 commit 79ef879
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 95 deletions.
1 change: 1 addition & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
Empty file added .changes/unreleased/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .changes/v0.5.31.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## v0.5.31 - 2024-11-04
### Added
* Initialized a changelog
26 changes: 26 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Added
auto: minor
- label: Changed
auto: major
- label: Deprecated
auto: minor
- label: Removed
auto: major
- label: Fixed
auto: patch
- label: Security
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
envPrefix: CHANGIE_
11 changes: 0 additions & 11 deletions .github/scripts/check-work-copy-equals-to-committed.sh

This file was deleted.

22 changes: 0 additions & 22 deletions .github/scripts/format-all-go-code.sh

This file was deleted.

13 changes: 0 additions & 13 deletions .github/scripts/format-go-code.sh

This file was deleted.

10 changes: 0 additions & 10 deletions .github/scripts/is_autogenerated_file.sh

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/create-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: create-release-pr

on:
workflow_dispatch:

jobs:
create-release-pr:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: batch-changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: batch patch

- name: merge-changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: merge

- name: print the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
commit-message: Release ${{ steps.latest.outputs.output }}
token: ${{ github.token }}
20 changes: 0 additions & 20 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: v1.58.1
code-format-check:
concurrency:
group: lint-autoformat-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: install-utilities
run: |
go install mvdan.cc/[email protected]
go install github.com/rinchsan/gosimports/cmd/[email protected]
- name: format all files with auto-formatter
run: bash ./.github/scripts/format-all-go-code.sh "$PWD"
- name: check-repository-diff
run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken"
run-unit-tests:
concurrency:
group: run-unit-tests-${{ github.head_ref || github.ref_name }}
Expand Down
69 changes: 52 additions & 17 deletions .github/workflows/upload-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
name: upload-artifacts

on:
push:
branches:
- master
paths:
- 'CHANGELOG.md'
workflow_dispatch:

jobs:
tag-job:
tag-and-release:
runs-on: ubuntu-latest
outputs:
tagcreated: ${{steps.tag-step.outputs.tagcreated}}
steps:
- uses: actions/checkout@v3
- id: tag-step
uses: butlerlogic/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4

- name: get-latest-version
uses: miniscruff/changie-action@v2
with:
strategy: regex
root: "./deploy/ydb-operator/Chart.yaml"
regex_pattern: 'version:[\s]*(["]?[0-9\.]{3,}["]?)'
upload-artifacts:
runs-on: ubuntu-latest
needs: tag-job
if: ${{ needs.tag-job.outputs.tagcreated == 'yes' }}
steps:
- uses: actions/checkout@v3
version: latest
args: latest
- name: get-latest-no-v-version
uses: miniscruff/changie-action@v2
with:
version: latest
# Echoes the same version as previous step, but without "v" prefix.
# Is used as a docker image tag in the release step.
# E.g. "v0.5.31" -> "0.5.31"
args: latest --remove-prefix

- name: update-chart-version-with-release-version
run: |
RELEASE_VERSION=${{ steps.get-latest-no-v-version.outputs.output }}
sed -i 's/<IS_SUBSTITUTED_IN_CI_RELEASE_JOB>/'"$RELEASE_VERSION"'/g' ./deploy/ydb-operator/Chart.yaml
- name: create-tag
uses: mathieudutour/[email protected]
with:
tag_prefix: ""
custom_tag: ${{ steps.get-latest-version.outputs.output }}
github_token: ${{ github.token }}

- name: install-dependencies
run: |
HELM_PKG="helm-v3.10.3-linux-amd64.tar.gz"
Expand Down Expand Up @@ -96,3 +112,22 @@ jobs:
aws s3 --endpoint-url=https://storage.yandexcloud.net \
cp ./charts/index.yaml s3://charts.ydb.tech/index.yaml
- name: add-dockerhub-info-to-release
run: |
echo "\nDocker image has been uploaded to:\n" >> .changes/${{ steps.get-latest-version.outputs.output }}.md
echo "- ydbplatform/ydb-kubernetes-operator:${{ steps.get-latest-no-v-version.outputs.output }} on Dockerhub" >> .changes/${{ steps.get-latest-version.outputs.output }}.md
echo "- cr.yandex/yc/ydb-kubernetes-operator:${{ steps.get-latest-no-v-version.outputs.output }} on YDB public registry" >> .changes/${{ steps.get-latest-version.outputs.output }}.md
with:
body_path: .changes/${{ steps.get-latest-version.outputs.output }}.md
tag_name: ${{ steps.get-latest-version.outputs.output }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: create-github-release
uses: softprops/action-gh-release@v1
with:
body_path: .changes/${{ steps.get-latest-version.outputs.output }}.md
tag_name: ${{ steps.get-latest-version.outputs.output }}
env:
GITHUB_TOKEN: ${{ github.token }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog


## v0.5.31 - 2024-11-04
### Added
* Initialized a changelog
4 changes: 2 additions & 2 deletions deploy/ydb-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.30
version: "<IS_SUBSTITUTED_IN_CI_RELEASE_JOB>"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.5.30"
appVersion: "<IS_SUBSTITUTED_IN_CI_RELEASE_JOB>"

0 comments on commit 79ef879

Please sign in to comment.