Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into k0s-1-28
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Sep 13, 2024
2 parents 2d74fe0 + c831306 commit bbb1ffa
Show file tree
Hide file tree
Showing 109 changed files with 2,201 additions and 1,237 deletions.
435 changes: 245 additions & 190 deletions .github/workflows/ci.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: K0s
run: |
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.
export CURVERSION=$(awk '/^K0S_VERSION/{split($3,a,"-"); print a[1]}' Makefile)
export CURVERSION=$(make print-K0S_VERSION)
export VERSION=`curl https://api.github.com/repos/k0sproject/k0s/releases/latest | jq -r .name`
if [ "$CURVERSION" != "$VERSION" ]; then
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
Expand Down
60 changes: 55 additions & 5 deletions .github/workflows/image-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ permissions:

jobs:

build-images:
build-deps:
outputs:
local-artifact-mirror: ${{ steps.local-artifact-mirror.outputs.image }}
local-artifact-mirror-image: ${{ steps.local-artifact-mirror.outputs.image }}
operator-image: ${{ steps.operator.outputs.image }}
operator-chart: ${{ steps.operator.outputs.chart }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -30,7 +32,8 @@ jobs:
uses: actions/cache@v4
with:
path: |
build/.melange-cache
local-artifact-mirror/cache/.melange-cache
operator/cache/.melange-cache
key: melange-cache

- name: Setup Melange
Expand All @@ -42,9 +45,38 @@ jobs:
make -C local-artifact-mirror apko build-ttl.sh
echo "image=$(cat local-artifact-mirror/build/image)" >> $GITHUB_OUTPUT
- name: Build and push operator image
id: operator
run: |
make -C operator apko build-ttl.sh build-chart-ttl.sh
echo "image=$(cat operator/build/image)" >> $GITHUB_OUTPUT
echo "chart=$(cat operator/build/chart)" >> $GITHUB_OUTPUT
buildtools:
name: Build buildtools
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"
- name: Compile buildtools
run: |
make buildtools
- name: Upload buildtools artifact
uses: actions/upload-artifact@v4
with:
name: buildtools
path: output/bin/buildtools

output-matrix:
runs-on: ubuntu-latest
needs: [build-images]
needs:
- build-deps
- buildtools
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
Expand All @@ -57,9 +89,27 @@ jobs:
go-version-file: go.mod
cache-dependency-path: "**/*.sum"

- name: Download buildtools artifact
uses: actions/download-artifact@v4
with:
name: buildtools
path: output/bin

- name: Compile buildtools
run: |
make buildtools
- name: Update embedded-cluster-operator metadata.yaml
env:
IMAGES_REGISTRY_SERVER: ttl.sh
OPERATOR_CHART: ${{ needs.build-deps.outputs.operator-chart }}
OPERATOR_IMAGE: ${{ needs.build-deps.outputs.operator-image }}
run: |
./scripts/ci-update-operator-metadata.sh
- name: Build
run: |
export LOCAL_ARTIFACT_MIRROR_IMAGE=${{ needs.build-images.outputs.local-artifact-mirror }}
export LOCAL_ARTIFACT_MIRROR_IMAGE=${{ needs.build-deps.outputs.local-artifact-mirror-image }}
make embedded-cluster-linux-amd64
- name: List images
Expand Down
37 changes: 24 additions & 13 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
uses: actions/cache@v4
with:
path: |
build/.melange-cache
operator/cache/.melange-cache
key: melange-cache

- name: Setup Melange
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
uses: actions/cache@v4
with:
path: |
build/.melange-cache
local-artifact-mirror/cache/.melange-cache
key: melange-cache

- name: Setup Melange
Expand All @@ -137,6 +137,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cache embedded bins
uses: actions/cache@v4
with:
path: |
output/bins
key: bins-cache

- name: Setup Go
uses: actions/setup-go@v5
with:
Expand All @@ -151,22 +158,26 @@ jobs:

- name: Update embedded-cluster-operator metadata.yaml
env:
IMAGES_REGISTRY_SERVER: ttl.sh
IMAGES_REGISTRY_SERVER: index.docker.io
IMAGES_REGISTRY_USER: ${{ secrets.DOCKERHUB_USER }}
IMAGES_REGISTRY_PASS: ${{ secrets.DOCKERHUB_PASSWORD }}
OPERATOR_CHART: ${{ needs.publish-operator-chart.outputs.chart }}
OPERATOR_IMAGE: ${{ needs.publish-operator-image.outputs.image }}
run: |
./scripts/ci-update-operator-metadata.sh
- name: Build linux-amd64
run: |
mkdir -p build
make embedded-cluster-linux-amd64 \
VERSION=${{ needs.get-tag.outputs.tag-name }} \
LOCAL_ARTIFACT_MIRROR_IMAGE=proxy.replicated.com/anonymous/${{ needs.publish-images.outputs.local-artifact-mirror }}
tar -C output/bin -czvf embedded-cluster-linux-amd64.tgz embedded-cluster
tar -C output/bin -czvf build/embedded-cluster-linux-amd64.tgz embedded-cluster
- name: Output Metadata
run: |
./output/bin/embedded-cluster version metadata > metadata.json
mkdir -p build
./output/bin/embedded-cluster version metadata > build/metadata.json
- name: Cache Staging Files
env:
Expand All @@ -176,10 +187,10 @@ jobs:
AWS_REGION: "us-east-1"
run: |
export EC_VERSION="${{ needs.get-tag.outputs.tag-name }}"
export OPERATOR_IMAGE=proxy.replicated.com/anonymous/${{ needs.publish-operator-image.outputs.image }}
export OPERATOR_VERSION=$(echo "${{ needs.get-tag.outputs.tag-name }}" | sed 's/^v//')
mkdir -p operator/build
echo "${{ needs.publish-operator-image.outputs.image }}" > "operator/build/image-$EC_VERSION"
./scripts/cache-files.sh
./scripts/ci-upload-binaries.sh
- name: Cache Prod Files
env:
Expand All @@ -189,16 +200,16 @@ jobs:
AWS_REGION: "us-east-1"
run: |
export EC_VERSION="${{ needs.get-tag.outputs.tag-name }}"
export OPERATOR_IMAGE=proxy.replicated.com/anonymous/${{ needs.publish-operator-image.outputs.image }}
export OPERATOR_VERSION=$(echo "${{ needs.get-tag.outputs.tag-name }}" | sed 's/^v//')
mkdir -p operator/build
echo "${{ needs.publish-operator-image.outputs.image }}" > "operator/build/image-$EC_VERSION"
./scripts/cache-files.sh
./scripts/ci-upload-binaries.sh
- name: Publish release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
files: |
*.tgz
metadata.json
build/*.tgz
build/metadata.json
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
output
bundle
pkg/goods/bins
pkg/goods/internal/bins
pkg/goods/bins/*
!pkg/goods/bins/.placeholder
pkg/goods/internal/bins/*
!pkg/goods/internal/bins/.placeholder
pkg/goods/images
*tgz
.pre-commit-config.yaml
vendor
e2e/kots-release-install/license.yaml
/build/
/bin/
/build/
/output/
go.work
go.work.sum
.gocache
.gomodcache
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
external-sources=true
Loading

0 comments on commit bbb1ffa

Please sign in to comment.