-
Notifications
You must be signed in to change notification settings - Fork 7
feat: incorporate the build workflow #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3fc8bd9
feat: incorporate the build workflow
nnicora 45e424a
remove the generate task
nnicora 19e2610
exclude some tasks
nnicora 9fbac7e
run go imports
nnicora 6a48583
update the list of the core directories
nnicora bac709f
revert back the reformating by running goimports
nnicora 153a2be
add permissions
nnicora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
|
|
||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,37 @@ | ||
| name: CI | ||
|
|
||
| name: ci | ||
| on: | ||
| pull_request: | ||
| push: | ||
| tags: | ||
| - v* | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| 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: | ||
| go-version: stable | ||
| - name: Run golangci-lint | ||
| uses: golangci/golangci-lint-action@v8 | ||
| - name: Run tests | ||
| run: go test -race ./... | ||
| submodules: recursive | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Install Task | ||
| uses: arduino/setup-task@v2 | ||
| with: | ||
| version: 3.42.1 | ||
|
|
||
| - name: task validate | ||
| run: task validate --verbose | ||
|
|
||
| - name: task test | ||
| run: task test --verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: REUSE Compliance Check | ||
|
|
||
| on: [push, pull_request] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| - name: REUSE Compliance Check | ||
| uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/bootstrap/... {{.ROOT_DIR}}/internal/consts/... {{.ROOT_DIR}}/api/...' | ||
| GENERATE_DOCS_INDEX: "false" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| v0.4.2 | ||
| v0.1.0-dev |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.