Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Create PRs for github.com/gardener/gardener dependency updates
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
open-pull-requests-limit: 5
# Create PRs for golang version updates
- package-ecosystem: docker
directory: /
schedule:
interval: daily
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Format of PR Title: <category>: <description>
Possible values:
- category: breaking|feature|doc|build|chore|ci|docs|feature|fix|perf|refactor|revert|style|test
- description: <short description of the PR>
-->

**What this PR does / why we need it**:
``` Detailed description of PR; If no description, remove the block.

```

**Special notes for your reviewer**:
``` If no notes, remove the block.

```

**Release note**:
``` Release notes; If no release note is required, just write "NONE" within the block.

```
45 changes: 33 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
name: CI

name: ci
on:
pull_request:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
ci:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: recursive

- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version: stable
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
- name: Run tests
run: go test -race ./...
go-version-file: go.mod

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.42.1

- name: task generate
run: |
task generate --verbose
git diff --exit-code

- name: task validate
run: task validate --verbose

- name: task test
run: task test --verbose
Comment thread Fixed
158 changes: 158 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Versioned Release

on:
push:
branches:
- main

permissions:
contents: write # we need this to be able to push tags
actions: write

jobs:
release_tag:
name: Release version
runs-on: ubuntu-24.04
steps:
- name: Generate token from GitHub App
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_PUSH_TAG_ID }}
private_key: ${{ secrets.APP_PUSH_TAG_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: ${{ steps.generate-token.outputs.token }}
fetch-tags: true
fetch-depth: 0
submodules: recursive

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x

- name: Read and validate VERSION
id: version
run: |
VERSION=$(task version)
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev(-[0-9a-f]*)?)?$ ]]; then
echo "Invalid version format: $VERSION"
exit 1
fi
echo "New version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV

- name: Skip release if version is a dev version
if: contains(env.version, '-dev')
run: |
echo "Skipping development version release: ${{ env.version }}"
echo "SKIP=true" >> $GITHUB_ENV
exit 0

- name: Check if VERSION is already tagged
id: check_tag
run: |
if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
echo "Tag ${{ env.version }} already exists. Skipping release."
echo "SKIP=true" >> $GITHUB_ENV
exit 0
fi
echo "Tag ${{ env.version }} doesn't exists. Proceeding with release."

- name: Determine Next Version
id: set-next-version
if: ${{ env.SKIP != 'true' }}
run: |
latest_version=${{ env.version }}
echo "Latest tag: $latest_version"

# Extract version components
major=$(echo $latest_version | cut -d. -f1 | tr -d 'v')
minor=$(echo $latest_version | cut -d. -f2)
patch=$(echo $latest_version | cut -d. -f3)

echo "Current version: $major.$minor.$patch"

patch=$((patch + 1))

next_version="v$major.$minor.$patch"
echo "Next version: $next_version"

echo "next_version=$next_version" >> $GITHUB_ENV

- name: Create Git tag
if: ${{ env.SKIP != 'true' }}
run: |
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"

echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV

git config user.name "$AUTHOR_NAME"
git config user.email "$AUTHOR_EMAIL"

git tag -a "${{ env.version }}" -m "Release ${{ env.version }}"
git push origin "${{ env.version }}"
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@e92187bd633e680ebfdd15961a7c30b2d097e7ad # v5
with:
mode: "PR"
configurationJson: |
{
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}}: ##{{NUMBER}}",
"categories": [
{
"title": "## Feature",
"labels": ["feat", "feature"]
},
{
"title": "## Fix",
"labels": ["fix", "bug"]
},
{
"title": "## Other",
"labels": []
}
],
"label_extractor": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"on_property": "title",
"target": "$1"
}
]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub release
if: ${{ env.SKIP != 'true' }}
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
with:
tag_name: ${{ env.version }}
name: Release ${{ env.version }}
body: ${{steps.github_release.outputs.changelog}}
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push dev VERSION
if: ${{ env.SKIP != 'true' }}
run: |
task release:set-version --verbose -- "${{ env.next_version }}-dev"
git config user.name "${{ env.AUTHOR_NAME }}"
git config user.email "${{ env.AUTHOR_EMAIL }}"
git add VERSION
git commit -m "Update VERSION to ${{ env.next_version }}-dev"
git push origin main
11 changes: 11 additions & 0 deletions .github/workflows/reuse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: REUSE Compliance Check

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
Comment thread Fixed
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "hack/common"]
path = hack/common
url = https://github.com/openkcm/build.git
File renamed without changes.
9 changes: 9 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 3

includes:
shared:
taskfile: hack/common/Taskfile_library.yaml
flatten: true
vars:
CODE_DIRS: '{{.ROOT_DIR}}/pkg/... {{.ROOT_DIR}}/internal/... {{.ROOT_DIR}}/api/...'
GENERATE_DOCS_INDEX: "false"
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.2
v0.1.0-dev
1 change: 1 addition & 0 deletions hack/common
Submodule common added at b61abd
Loading