Skip to content

Commit

Permalink
Pull in ci and codeowners from main
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Kennedy <[email protected]>
  • Loading branch information
tomkennedy513 committed Oct 2, 2023
1 parent a3edeb3 commit 9d4cfce
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 77 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/add-to-project.yml

This file was deleted.

117 changes: 62 additions & 55 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on:
branches:
- main
- release/**
pull_request:
branches:
- release/**
tags:
- v[0-9]+.[0-9]+.[0-9]+-?**

defaults:
run:
Expand All @@ -23,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -42,9 +41,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -60,9 +59,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -78,9 +77,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -96,9 +95,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -114,9 +113,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -132,9 +131,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -150,9 +149,9 @@ jobs:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -170,9 +169,9 @@ jobs:
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
Expand All @@ -190,13 +189,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker Login
uses: docker/[email protected]
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Build
run: |
trap 'echo -e "$output"' EXIT
output=$(go run ./hack/lifecycle/main.go --tag=${{ env.PUBLIC_IMAGE_DEV_REPO }}/lifecycle 2>&1)
image=$(echo "$output" | grep "saved lifecycle" | awk -F "saved lifecycle image: " '{print $2}')
mkdir images
Expand All @@ -221,7 +228,7 @@ jobs:
- completion-windows-image
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -240,17 +247,17 @@ jobs:
name: images

- name: Build release yaml
run: |
run: |
ytt -f config/ \
-v controller_image=$(cat controller) \
-v webhook_image=$(cat webhook) \
-v build_init_image=$(cat build-init) \
-v build_init_windows_image=$(cat build-init-windows) \
-v build_waiter_image=$(cat build-waiter) \
-v rebase_image=$(cat rebase) \
-v completion_image=$(cat completion) \
-v completion_windows_image=$(cat completion-windows) \
-v lifecycle_image=$(cat lifecycle) > prerelease.yaml
-v controller.image=$(cat controller) \
-v webhook.image=$(cat webhook) \
-v build_init.image=$(cat build-init) \
-v build_init_windows.image=$(cat build-init-windows) \
-v build_waiter.image=$(cat build-waiter) \
-v rebase.image=$(cat rebase) \
-v completion.image=$(cat completion) \
-v completion_windows.image=$(cat completion-windows) \
-v lifecycle.image=$(cat lifecycle) > prerelease.yaml
cat prerelease.yaml
Expand All @@ -275,7 +282,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -343,13 +350,13 @@ jobs:
EOF
- name: Create Kind Cluster
uses: helm/kind-action@v1.7.0
uses: helm/kind-action@v1.8.0
with:
cluster_name: e2e
config: kind.yaml

- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ env.REGISTRY_URL }}
username: ${{ env.REGISTRY_USER }}
Expand Down Expand Up @@ -428,11 +435,11 @@ jobs:
- build-init-windows-image
- completion-windows-image
- lifecycle-image
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -452,16 +459,16 @@ jobs:
uses: actions/download-artifact@v3

- name: Docker Login
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Parse branch name
- name: Parse tag name
run: |
echo "GITHUB_REF=${GITHUB_REF}"
[[ $GITHUB_REF =~ ^refs\/heads\/release\/(.*)$ ]] && version=${BASH_REMATCH[1]}
[[ $GITHUB_REF =~ ^refs\/tags\/v(.*)$ ]] && version=${BASH_REMATCH[1]}
if [[ -z "${version}" ]]; then
echo "ERROR: kpack version not detected."
exit 1
Expand All @@ -474,12 +481,12 @@ jobs:
for image in images/*; do
dev_image=$(cat $image)
digest=$(echo $dev_image| cut -d "@" -f 2)
name=$(basename $image)
final_repo="${{ env.PUBLIC_IMAGE_REPO }}/${name}"
final_repo="${{ env.PUBLIC_IMAGE_REPO }}/${name}"
crane copy "$dev_image" "$final_repo"
echo "${final_repo}@${digest}" > final-image-refs/$name
done
Expand All @@ -494,16 +501,16 @@ jobs:
run: |
file="release-${{ env.KPACK_VERSION }}.yaml"
ytt -f config/ \
-v controller_image=$(cat final-image-refs/controller) \
-v webhook_image=$(cat final-image-refs/webhook) \
-v build_init_image=$(cat final-image-refs/build-init) \
-v build_init_windows_image=$(cat final-image-refs/build-init-windows) \
-v build_waiter_image=$(cat final-image-refs/build-waiter) \
-v rebase_image=$(cat final-image-refs/rebase) \
-v completion_image=$(cat final-image-refs/completion) \
-v completion_windows_image=$(cat final-image-refs/completion-windows) \
-v lifecycle_image=$(cat final-image-refs/lifecycle) \
-v version=${{ env.KPACK_VERSION }} > $file
-v controller.image=$(cat final-image-refs/controller) \
-v webhook.image=$(cat final-image-refs/webhook) \
-v build_init.image=$(cat final-image-refs/build-init) \
-v build_init_windows.image=$(cat final-image-refs/build-init-windows) \
-v build_waiter.image=$(cat final-image-refs/build-waiter) \
-v rebase.image=$(cat final-image-refs/rebase) \
-v completion.image=$(cat final-image-refs/completion) \
-v completion_windows.image=$(cat final-image-refs/completion-windows) \
-v lifecycle.image=$(cat final-image-refs/lifecycle) \
-v kpack_version=${{ env.KPACK_VERSION }} > $file
echo "sha=$(shasum -a 256 $file)" >> $GITHUB_OUTPUT
- name: Upload Release
Expand Down Expand Up @@ -534,4 +541,4 @@ jobs:
${{ steps.release_yaml.outputs.sha }}
```
**Full Changelog**:
**Full Changelog**:
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @matthewmcnew @tomkennedy513 @chenbh @pviraj59
* @buildpacks-community/kpack-maintainers

0 comments on commit 9d4cfce

Please sign in to comment.