Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.11.x] Fix cloning with Azure DevOps Git #1339

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/actions/pack-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ runs:
if: ${{ runner.os == 'linux' }}
shell: bash
run: |
[[ $GITHUB_REF =~ ^refs\/heads\/release\/(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0
[[ $GITHUB_REF =~ ^refs\/tags\/v(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0

KPACK_VERSION=$version
KPACK_COMMIT=$GITHUB_SHA
mkdir report

export PATH="$PATH:$(pwd)"
pack build ${{ inputs.tag }} \
--builder ${{ inputs.builder }} \
Expand All @@ -55,7 +55,7 @@ runs:
--report-output-dir . \
--cache-image ${{ inputs.tag }}-cache \
--publish ${{ inputs.additional_pack_args }}

mkdir images
digest=$(go run .github/actions/pack-build/report.go -path ./report.toml)
name=$(basename ${{ inputs.tag }})
Expand All @@ -65,7 +65,7 @@ runs:
if: ${{ runner.os == 'windows' }}
shell: bash
run: |
[[ $GITHUB_REF =~ ^refs\/heads\/release\/(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0
[[ $GITHUB_REF =~ ^refs\/tags\/v(.*)$ ]] && version=${BASH_REMATCH[1]} || version=0.0.0

KPACK_VERSION=$version
KPACK_COMMIT=$GITHUB_SHA
Expand All @@ -88,4 +88,4 @@ runs:
uses: actions/upload-artifact@v3
with:
name: images
path: images/
path: images/
10 changes: 0 additions & 10 deletions .github/actions/run-tests/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions .github/actions/run-tests/action.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/add-to-project.yml

This file was deleted.

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

defaults:
run:
Expand All @@ -23,7 +25,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 +44,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 +62,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 +80,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 +98,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 +116,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 +134,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 +152,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 +172,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 +192,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,15 +231,15 @@ jobs:
- completion-windows-image
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'

- name: Setup carvel
uses: carvel-dev/setup-action@v1
uses: carvel-dev/setup-action@v2
with:
token: ${{ secrets.RELEASE_TOKEN }}
only: ytt, kapp
Expand All @@ -240,7 +250,7 @@ jobs:
name: images

- name: Build release yaml
run: |
run: |
ytt -f config/ \
-v controller_image=$(cat controller) \
-v webhook_image=$(cat webhook) \
Expand Down Expand Up @@ -275,7 +285,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 All @@ -286,7 +296,7 @@ jobs:
uses: imjasonh/[email protected]

- name: Setup carvel
uses: carvel-dev/setup-action@v1
uses: carvel-dev/setup-action@v2
with:
token: ${{ secrets.RELEASE_TOKEN }}
only: ytt, kapp
Expand Down Expand Up @@ -343,13 +353,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 +438,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 @@ -443,7 +453,7 @@ jobs:
uses: imjasonh/[email protected]

- name: Setup carvel
uses: carvel-dev/setup-action@v1
uses: carvel-dev/setup-action@v2
with:
token: ${{ secrets.RELEASE_TOKEN }}
only: ytt
Expand All @@ -452,16 +462,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 +484,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 @@ -503,7 +513,7 @@ jobs:
-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 kpack_version=${{ env.KPACK_VERSION }} > $file
echo "sha=$(shasum -a 256 $file)" >> $GITHUB_OUTPUT

- name: Upload Release
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ name: Test

on:
pull_request:
branches:
- main

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run tests
uses: ./.github/actions/run-tests
run: make unit-ci
- name: Report coverage
uses: codecov/[email protected]
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
Loading
Loading