-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Initial implementation building images
- Loading branch information
Showing
92 changed files
with
11,781 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore build and test binaries. | ||
bin/ |
This file contains 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,5 @@ | ||
use asdf | ||
|
||
PATH_add .local/bin | ||
|
||
dotenv_if_exists .envrc.local |
This file contains 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,14 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains 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,24 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
- dependencies | ||
authors: | ||
- octocat | ||
- dependabot | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- breaking | ||
- title: Exciting New Features 🎉 | ||
labels: | ||
- feature | ||
- title: Fixes 🔧 | ||
labels: | ||
- fix | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains 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,105 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
branches: | ||
- main | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2.1.0 | ||
with: | ||
asdf_branch: v0.11.2 | ||
|
||
- name: Run unit tests | ||
run: make test | ||
|
||
- name: Annotate tests | ||
if: always() | ||
uses: guyarb/golang-test-annotations@v0.6.0 | ||
with: | ||
test-results: test.json | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gather tool versions | ||
uses: endorama/asdf-parse-tool-versions@v1 | ||
id: versions | ||
|
||
- name: github-actions-lint | ||
uses: reviewdog/action-actionlint@v1 | ||
with: | ||
fail_on_error: true | ||
reporter: github-pr-review | ||
|
||
- name: golangci-lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
fail_on_error: true | ||
reporter: github-pr-review | ||
go_version: v${{ fromJson(steps.versions.outputs.tools).golang }} | ||
golangci_lint_version: v${{ fromJson(steps.versions.outputs.tools).golangci-lint }} | ||
|
||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gather tool versions | ||
uses: endorama/asdf-parse-tool-versions@v1 | ||
id: versions | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ fromJson(steps.versions.outputs.tools).golang }} | ||
check-latest: false | ||
cache: true | ||
|
||
- uses: mfinelli/setup-shfmt@v2 | ||
with: | ||
shfmt-version: ${{ fromJson(steps.versions.outputs.tools).shfmt }} | ||
|
||
- uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: --all-files --show-diff-on-failure | ||
env: | ||
SKIP: no-commit-to-branch,golangci-lint | ||
|
||
build-and-run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2.1.0 | ||
with: | ||
asdf_branch: v0.11.2 | ||
|
||
- name: Build | ||
run: make build-snapshot | ||
|
||
- name: Run binary | ||
run: | | ||
./dist/kubernetes-upgrader_linux_amd64_v1/kubernetes-upgrader --version |
This file contains 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,43 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: codeql | ||
|
||
on: | ||
schedule: | ||
- cron: '32 21 * * 2' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2.1.0 | ||
with: | ||
asdf_branch: v0.11.2 | ||
|
||
- name: Build | ||
run: make build-snapshot | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains 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,14 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: conventional-release-labels | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
jobs: | ||
label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: bcoe/conventional-release-labels@v1 |
This file contains 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,16 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: "conventional-pr-title" | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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,47 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: dependabot | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
- uses: actions/checkout@v3 | ||
- name: Approve a PR if not already approved | ||
run: | | ||
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status` | ||
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; then | ||
gh pr review --approve "$PR_URL" | ||
else | ||
echo "PR already approved, skipping additional approvals to minimize emails/notification noise." | ||
fi | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
enable-automerge: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]'}} | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains 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,35 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: release-please-main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-22.04 | ||
# Map a step output to a job output | ||
outputs: | ||
release_created: ${{ steps.release-please.outputs.release_created }} | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3.7 | ||
id: release-please | ||
with: | ||
release-type: go | ||
package-name: kubernetes-upgrader | ||
pull-request-title-pattern: "build${scope}: release${component} ${version}" | ||
changelog-notes-type: github | ||
|
||
release-tag: | ||
needs: release-please | ||
uses: ./.github/workflows/release-tag.yaml | ||
secrets: inherit | ||
if: ${{ needs.release-please.outputs.release_created }} |
This file contains 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,31 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
release-tag: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Install tools via asdf | ||
uses: asdf-vm/actions/install@v2.1.0 | ||
with: | ||
asdf_branch: v0.11.2 | ||
|
||
- name: Release | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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,31 @@ | ||
# Copyright 2023 Dimitri Koshkin. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: stacked-prs | ||
|
||
permissions: | ||
actions: write | ||
checks: write | ||
issues: write | ||
pull-requests: write | ||
statuses: write | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: z0al/dependent-issues@v1 | ||
env: | ||
# (Required) The token to use to make API calls to GitHub. | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# (Optional) The label to use to mark dependent issues | ||
label: stacked | ||
|
||
# (Optional) A comma-separated list of keywords. Default | ||
# "depends on, blocked by" | ||
keywords: depends on, blocked by |
Oops, something went wrong.