diff --git a/.github/actions/setup-go-kpt/action.yml b/.github/actions/setup-go-kpt/action.yml deleted file mode 100644 index ff428d8a9..000000000 --- a/.github/actions/setup-go-kpt/action.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2026 The kpt Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: "Setup Go and kpt" -description: "Sets up Go from go.mod and installs kpt version matching go.mod" - -inputs: - install-kpt: - description: "Whether to install kpt" - required: false - default: "true" - kpt-fallback-version: - description: "Fallback kpt version if extraction from go.mod fails" - required: false - default: "v1.0.0-beta.65" - go-version: - description: "Exact version for Go version setup, go-version-file is ignored if set" - required: false - go-version-file: - description: "Path to go.mod file for Go version setup" - required: false - default: "go.mod" - go-cache: - description: "Enable Go module caching" - required: false - default: "true" - cache-dependency-path: - description: "Relative path to go.sum file for Go module caching" - required: false - default: "go.sum" - -outputs: - kpt-version: - description: "The kpt version installed" - value: ${{ steps.kpt-version.outputs.version }} - -runs: - using: "composite" - steps: - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version }} - go-version-file: ${{ inputs.go-version-file }} - cache: ${{ inputs.go-cache == 'true' }} - cache-dependency-path: ${{ inputs.cache-dependency-path }} - - - name: Get kpt version from go.mod - if: inputs.install-kpt == 'true' - id: kpt-version - shell: bash - env: - GO_VERSION_FILE: ${{ inputs.go-version-file }} - KPT_FALLBACK: ${{ inputs.kpt-fallback-version }} - run: | - GO_MOD_DIR=$(dirname -- "$GO_VERSION_FILE") - KPT_VERSION=$(cd "$GO_MOD_DIR" && go list -m -f '{{.Version}}' github.com/kptdev/kpt 2>/dev/null) - if [ -z "$KPT_VERSION" ]; then - echo "Warning: Could not resolve kpt version from ${GO_VERSION_FILE}, using fallback." - KPT_VERSION="$KPT_FALLBACK" - fi - echo "version=${KPT_VERSION}" >> "$GITHUB_OUTPUT" - - - name: Install kpt - if: inputs.install-kpt == 'true' - uses: jaxxstorm/action-install-gh-release@v2.1.0 - with: - repo: kptdev/kpt - tag: ${{ steps.kpt-version.outputs.version }} - chmod: 0755 diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 31796a11d..113aecac9 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -45,7 +45,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" - name: Run Linter diff --git a/.github/workflows/gosec-scan.yaml b/.github/workflows/gosec-scan.yaml index 11a5188ab..daf23513b 100644 --- a/.github/workflows/gosec-scan.yaml +++ b/.github/workflows/gosec-scan.yaml @@ -47,7 +47,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" diff --git a/.github/workflows/image-build-push-release.yaml b/.github/workflows/image-build-push-release.yaml index 1e8eb5d8c..48eb70043 100644 --- a/.github/workflows/image-build-push-release.yaml +++ b/.github/workflows/image-build-push-release.yaml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v7 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" diff --git a/.github/workflows/porch-e2e-ci-jobs.yaml b/.github/workflows/porch-e2e-ci-jobs.yaml index 4ce5ad90b..13e951cb8 100644 --- a/.github/workflows/porch-e2e-ci-jobs.yaml +++ b/.github/workflows/porch-e2e-ci-jobs.yaml @@ -58,7 +58,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" go-cache: "true" @@ -145,7 +145,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go and kpt - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: go-cache: "true" - name: Install Kind diff --git a/.github/workflows/porch-e2e-nightly.yaml b/.github/workflows/porch-e2e-nightly.yaml index a900adda7..fd733b225 100644 --- a/.github/workflows/porch-e2e-nightly.yaml +++ b/.github/workflows/porch-e2e-nightly.yaml @@ -44,7 +44,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" go-cache: "true" @@ -117,7 +117,7 @@ jobs: - name: Checkout Porch uses: actions/checkout@v4 - name: Set up Go and kpt - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: go-cache: "true" - name: Install Kind diff --git a/.github/workflows/porchctl-dev-release.yaml b/.github/workflows/porchctl-dev-release.yaml index 359ddc629..3891dd809 100644 --- a/.github/workflows/porchctl-dev-release.yaml +++ b/.github/workflows/porchctl-dev-release.yaml @@ -35,7 +35,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false" - name: Build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index eaf2a615e..0ec4dae8d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,7 +36,7 @@ jobs: fetch-depth: 0 - name: Set up Go and kpt - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main - name: Check for replace directives in go.mod uses: kptdev/kpt/.github/actions/check-go-mod-replace@main diff --git a/.github/workflows/sonar-ci-artifacts.yaml b/.github/workflows/sonar-ci-artifacts.yaml index 73f713b23..669ca38be 100644 --- a/.github/workflows/sonar-ci-artifacts.yaml +++ b/.github/workflows/sonar-ci-artifacts.yaml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 - name: Set up Go - uses: ./.github/actions/setup-go-kpt + uses: kptdev/kpt/.github/actions/setup-go-kpt@main with: install-kpt: "false"