Compare commits

..

19 Commits

Author SHA1 Message Date
Alex Jones
03ae895f92 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 14:52:06 +01:00
Alex Jones
7872278fe1 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 14:03:50 +01:00
Alex Jones
4063f1ed26 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 12:55:21 +01:00
Alex Jones
5b89bbee2f chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 12:20:16 +01:00
Alex Jones
4961969956 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 12:05:54 +01:00
Alex Jones
db9d48e729 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 11:31:32 +01:00
Alex Jones
76a133b738 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 11:19:45 +01:00
Alex Jones
9fada2297c chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:49:14 +01:00
Alex Jones
9fceb96da8 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:45:18 +01:00
Alex Jones
40e7646c45 chore: removed digest
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:42:47 +01:00
Alex Jones
83f2911a7b chore: testing splitting job across runners
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:36:57 +01:00
Alex Jones
019cb50fb6 chore: testing splitting job across runners
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:16:25 +01:00
Alex Jones
6865f4ecb3 Merge branch 'main' into fix/build-system
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:04:32 +01:00
Alex Jones
ac4d509c39 chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 10:03:10 +01:00
Alex Jones
4f764f0b6b chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 09:52:20 +01:00
Alex Jones
14fffd810c chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 09:39:43 +01:00
Alex Jones
a1bc1dbbb4 chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 09:31:28 +01:00
Alex Jones
8eb5b2a3ed chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 08:55:53 +01:00
Alex Jones
f65a1d4af6 chore: setting up build system fixes
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
2025-04-07 08:49:18 +01:00
5 changed files with 82 additions and 93 deletions

View File

@@ -8,13 +8,16 @@ on:
pull_request:
branches:
- 'main'
- fix/build-system
- '[0-9]+.[1-9][0-9]*.x'
paths-ignore:
- "**.md"
env:
GO_VERSION: "~1.22"
GO_VERSION: "~1.23"
IMAGE_NAME: "k8sgpt"
REGISTRY_IMAGE: ghcr.io/k8sgpt-ai/k8sgpt
defaults:
run:
shell: bash
@@ -33,7 +36,7 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4
- name: Extract branch name
id: extract_branch
@@ -51,101 +54,104 @@ jobs:
id: get_run_type
run: |
NON_FORKED_AND_NON_ROBOT_RUN=${{ ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) && ( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository ) }}
echo "github.actor != 'renovate[bot]' = ${{ github.actor != 'renovate[bot]' }}"
echo "github.actor != 'dependabot[bot]' = ${{ github.actor != 'dependabot[bot]' }}"
echo "github.event_name == 'push' = ${{ github.event_name == 'push' }}"
echo "github.event.pull_request.head.repo.full_name == github.repository = ${{ github.event.pull_request.head.repo.full_name == github.repository }}"
echo "NON_FORKED_AND_NON_ROBOT_RUN = $NON_FORKED_AND_NON_ROBOT_RUN"
echo "NON_FORKED_AND_NON_ROBOT_RUN=$NON_FORKED_AND_NON_ROBOT_RUN" >> "$GITHUB_OUTPUT"
build_image:
name: Build Container Image
build:
name: Build for ${{ matrix.platform }}
needs: prepare_ci_run
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
# - linux/arm64
env:
BRANCH: ${{ needs.prepare_ci_run.outputs.BRANCH }}
DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }}
BUILD_TIME: ${{ needs.prepare_ci_run.outputs.BUILD_TIME }}
GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }}
RELEASE_REGISTRY: "localhost:5000/k8sgpt"
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4
- name: Set env pair
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.K8SGPT_BOT_SECRET }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
- name: Debug image tags
run: |
echo "Pushing tag: ${{ env.REGISTRY_IMAGE }}:${{ needs.prepare_ci_run.outputs.DATETIME }}"
- name: Build and push the image
id: build
if: ${{ needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' }}
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
file: ./container/Dockerfile
platforms: ${{ matrix.platform }}
target: production
tags: |
${{ env.RELEASE_REGISTRY }}/${{ env.IMAGE_NAME }}:dev-${{ env.DATETIME }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.K8SGPT_BOT_SECRET }}
build-args: |
GIT_HASH=${{ env.GIT_SHA }}
RELEASE_VERSION=dev-${{ env.DATETIME }}
BUILD_TIME=${{ env.BUILD_TIME }}
builder: ${{ steps.buildx.outputs.name }}
push: false
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_NAME }}
cache-to: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_NAME }}
outputs: type=docker,dest=/tmp/${{ env.IMAGE_NAME }}-image.tar
tags: |
${{ env.REGISTRY_IMAGE }}:${{ needs.prepare_ci_run.outputs.DATETIME }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.K8SGPT_BOT_SECRET }}
outputs: type=image,push=true
- name: Upload image as artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ env.IMAGE_NAME }}-image.tar
path: /tmp/${{ env.IMAGE_NAME }}-image.tar
upload_images:
name: Upload images to ghcr registry
needs: [ prepare_ci_run, build_image ]
if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' # only run on push to main/maintenance branches
merge:
name: Create and Push Manifest List
needs: [build, prepare_ci_run]
runs-on: ubuntu-latest
env:
DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }}
BUILD_TIME: ${{ needs.prepare_ci_run.outputs.BUILD_TIME }}
GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }}
permissions:
packages: write # Needed for pushing images to the registry
contents: read # Needed for checking out the repository
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Login to GitHub Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
uses: docker/login-action@v3
with:
registry: "ghcr.io"
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.K8SGPT_BOT_SECRET }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
- name: Build Docker Image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
uses: docker/setup-buildx-action@v3
- name: Debug DATETIME
run: echo "DATETIME=${{ needs.prepare_ci_run.outputs.DATETIME }}"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
context: .
file: ./container/Dockerfile
platforms: linux/amd64,linux/arm64
target: production
images: ${{ env.REGISTRY_IMAGE }}
tags: |
ghcr.io/k8sgpt-ai/${{ env.IMAGE_NAME }}:dev-${{ env.DATETIME }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.K8SGPT_BOT_SECRET }}
build-args: |
GIT_HASH=${{ env.GIT_SHA }}
RELEASE_VERSION=dev-${{ env.DATETIME }}
BUILD_TIME=${{ env.BUILD_TIME }}
builder: ${{ steps.buildx.outputs.name }}
push: true
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_NAME }}
cache-to: type=gha,scope=${{ github.ref_name }}-${{ env.IMAGE_NAME }}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
- name: Create manifest list and push
run: |
docker manifest create ${{ env.REGISTRY_IMAGE }}:${{ needs.prepare_ci_run.outputs.DATETIME }} \
${{ env.REGISTRY_IMAGE }}:${{ needs.prepare_ci_run.outputs.DATETIME }}
docker manifest push ${{ env.REGISTRY_IMAGE }}:${{ needs.prepare_ci_run.outputs.DATETIME }}

View File

@@ -103,7 +103,7 @@ jobs:
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.K8SGPT_BOT_SECRET }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6

View File

@@ -1 +1 @@
{".":"0.4.7"}
{".":"0.4.5"}

View File

@@ -1,22 +1,5 @@
# Changelog
## [0.4.7](https://github.com/k8sgpt-ai/k8sgpt/compare/v0.4.6...v0.4.7) (2025-04-07)
### Other
* **deps:** update actions/upload-artifact digest to ea165f8 ([#1425](https://github.com/k8sgpt-ai/k8sgpt/issues/1425)) ([9bffc7c](https://github.com/k8sgpt-ai/k8sgpt/commit/9bffc7cff776733f6d05669e6c02f594ee2db261))
* fixing build ([#1431](https://github.com/k8sgpt-ai/k8sgpt/issues/1431)) ([c5fe2c6](https://github.com/k8sgpt-ai/k8sgpt/commit/c5fe2c68d18d4fd713b3e638066327ad586d1871))
## [0.4.6](https://github.com/k8sgpt-ai/k8sgpt/compare/v0.4.5...v0.4.6) (2025-04-07)
### Other
* **deps:** pin docker/build-push-action action to 471d1dc ([#1428](https://github.com/k8sgpt-ai/k8sgpt/issues/1428)) ([5086ccd](https://github.com/k8sgpt-ai/k8sgpt/commit/5086ccd65942ebb9a37bd2c3a48d16c4be99e8c1))
* fixing docker build push action ([#1426](https://github.com/k8sgpt-ai/k8sgpt/issues/1426)) ([1681aad](https://github.com/k8sgpt-ai/k8sgpt/commit/1681aadac106c608de9774ebfd7ea9df20eed482))
* updated actor for login ([#1430](https://github.com/k8sgpt-ai/k8sgpt/issues/1430)) ([b626102](https://github.com/k8sgpt-ai/k8sgpt/commit/b6261026f8b41e505359a52c18bebec7ef5079f9))
## [0.4.5](https://github.com/k8sgpt-ai/k8sgpt/compare/v0.4.4...v0.4.5) (2025-04-07)

View File

@@ -62,7 +62,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_386.rpm
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_386.rpm
```
<!---x-release-please-end-->
@@ -70,7 +70,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_amd64.rpm
sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_amd64.rpm
```
<!---x-release-please-end-->
</details>
@@ -83,7 +83,7 @@ brew install k8sgpt
<!---x-release-please-start-version-->
```
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_386.deb
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_386.deb
sudo dpkg -i k8sgpt_386.deb
```
@@ -94,7 +94,7 @@ sudo dpkg -i k8sgpt_386.deb
<!---x-release-please-start-version-->
```
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_amd64.deb
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_amd64.deb
sudo dpkg -i k8sgpt_amd64.deb
```
@@ -109,7 +109,7 @@ sudo dpkg -i k8sgpt_amd64.deb
<!---x-release-please-start-version-->
```
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_386.apk
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_386.apk
apk add --allow-untrusted k8sgpt_386.apk
```
<!---x-release-please-end-->
@@ -118,7 +118,7 @@ sudo dpkg -i k8sgpt_amd64.deb
<!---x-release-please-start-version-->
```
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.7/k8sgpt_amd64.apk
wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.4.5/k8sgpt_amd64.apk
apk add --allow-untrusted k8sgpt_amd64.apk
```
<!---x-release-please-end-->