From 9d4cfce06db8458bd80d5af3d6e84fd5b1ba9487 Mon Sep 17 00:00:00 2001 From: Tom Kennedy Date: Mon, 2 Oct 2023 11:24:43 -0400 Subject: [PATCH] Pull in ci and codeowners from main Signed-off-by: Tom Kennedy --- .github/workflows/add-to-project.yml | 21 ----- .github/workflows/ci.yaml | 117 ++++++++++++++------------- CODEOWNERS | 2 +- 3 files changed, 63 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/add-to-project.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml deleted file mode 100644 index d55cbe6f5..000000000 --- a/.github/workflows/add-to-project.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Add issues to project - -on: - issues: - types: - - opened - pull_request_target: - types: - - opened - -jobs: - add-to-project: - if: ${{ github.actor != 'dependabot[bot]' }} - name: Add To GitHub Projects Beta - runs-on: ubuntu-latest - steps: - - name: Add To GitHub Projects Beta - uses: actions/add-to-project@v0.5.0 - with: - project-url: https://github.com/orgs/pivotal/projects/18 - github-token: ${{ secrets.KPACK_BOT_PAT }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41fb691b3..2184cdbe0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,9 +5,8 @@ on: branches: - main - release/** - pull_request: - branches: - - release/** + tags: + - v[0-9]+.[0-9]+.[0-9]+-?** defaults: run: @@ -23,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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/login-action@v3.0.0 + 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 @@ -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 @@ -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 @@ -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 @@ -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 }} @@ -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 @@ -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 @@ -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 @@ -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 @@ -534,4 +541,4 @@ jobs: ${{ steps.release_yaml.outputs.sha }} ``` - **Full Changelog**: + **Full Changelog**: \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS index e415a36cc..4aa94494c 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @matthewmcnew @tomkennedy513 @chenbh @pviraj59 +* @buildpacks-community/kpack-maintainers