2024-01-27 22:32:42 +00:00
|
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
|
2020-12-15 19:46:53 +00:00
|
|
|
name: releaser
|
2023-01-06 15:24:55 +00:00
|
|
|
|
2023-06-30 15:28:46 +00:00
|
|
|
permissions: {}
|
|
|
|
|
2020-08-11 00:16:13 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
2020-11-25 23:50:56 +00:00
|
|
|
- 'v*'
|
2022-01-16 01:14:22 +00:00
|
|
|
|
2020-08-11 00:16:13 +00:00
|
|
|
jobs:
|
2023-01-19 06:28:26 +00:00
|
|
|
release-images:
|
|
|
|
runs-on: ubuntu-latest
|
2022-02-25 08:11:22 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
id-token: write
|
2023-04-07 13:47:15 +00:00
|
|
|
outputs:
|
|
|
|
kyverno-digest: ${{ steps.release-kyverno.outputs.digest }}
|
|
|
|
kyverno-init-digest: ${{ steps.release-kyverno-init.outputs.digest }}
|
|
|
|
background-controller-digest: ${{ steps.release-background-controller.outputs.digest }}
|
|
|
|
cleanup-controller-digest: ${{ steps.release-cleanup-controller.outputs.digest }}
|
|
|
|
cli-digest: ${{ steps.release-cli.outputs.digest }}
|
2023-04-07 17:37:07 +00:00
|
|
|
reports-controller-digest: ${{ steps.release-reports-controller.outputs.digest }}
|
2023-01-19 06:28:26 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 10:36:00 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
build-cache-key: release-images
|
2023-01-19 06:28:26 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-09-20 22:35:49 +00:00
|
|
|
timeout-minutes: 30
|
2023-01-19 06:28:26 +00:00
|
|
|
- name: Run Trivy vulnerability scanner in repo mode
|
2024-05-15 10:53:32 +00:00
|
|
|
uses: aquasecurity/trivy-action@b2933f565dbc598b29947660e66259e3c7bc8561 # v0.20.0
|
2023-01-19 06:28:26 +00:00
|
|
|
with:
|
|
|
|
scan-type: 'fs'
|
|
|
|
ignore-unfixed: true
|
|
|
|
format: 'sarif'
|
|
|
|
output: 'trivy-results.sarif'
|
|
|
|
severity: 'CRITICAL,HIGH'
|
|
|
|
- name: Install Cosign
|
2024-04-16 08:41:29 +00:00
|
|
|
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
|
2023-01-19 06:28:26 +00:00
|
|
|
- name: Publish kyverno
|
2023-04-07 13:47:15 +00:00
|
|
|
id: release-kyverno
|
2023-01-19 06:28:26 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-kyverno
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-19 06:28:26 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-19 06:28:26 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: kyverno
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/kyverno
|
2023-04-07 13:47:15 +00:00
|
|
|
- name: Publish kyverno-init
|
|
|
|
id: release-kyverno-init
|
2023-01-19 06:28:26 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
2023-01-29 20:49:45 +00:00
|
|
|
makefile-target: ko-publish-kyverno-init
|
2023-01-19 06:28:26 +00:00
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-19 06:28:26 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-19 06:28:26 +00:00
|
|
|
sign-image: true
|
2023-04-07 13:47:15 +00:00
|
|
|
sbom-name: kyverno-init
|
2023-01-19 06:28:26 +00:00
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
2023-01-29 20:49:45 +00:00
|
|
|
main-path: ./cmd/kyverno-init
|
2023-02-28 16:54:37 +00:00
|
|
|
- name: Publish background-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
id: release-background-controller
|
2023-02-28 16:54:37 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-background-controller
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 16:54:37 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-02-28 16:54:37 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: background-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/background-controller
|
2023-01-19 06:28:26 +00:00
|
|
|
- name: Publish cleanup-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
id: release-cleanup-controller
|
2023-01-19 06:28:26 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-cleanup-controller
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-19 06:28:26 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-19 06:28:26 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: cleanup-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/cleanup-controller
|
|
|
|
- name: Publish cli
|
2023-04-07 13:47:15 +00:00
|
|
|
id: release-cli
|
2023-01-19 06:28:26 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-cli
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-01-19 06:28:26 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-01-19 06:28:26 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: cli
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/cli/kubectl-kyverno
|
2023-02-28 16:54:37 +00:00
|
|
|
- name: Publish reports-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
id: release-reports-controller
|
2023-02-28 16:54:37 +00:00
|
|
|
uses: ./.github/actions/publish-image
|
|
|
|
with:
|
|
|
|
makefile-target: ko-publish-reports-controller
|
|
|
|
registry: ghcr.io
|
|
|
|
registry-username: ${{ github.actor }}
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 16:54:37 +00:00
|
|
|
repository: ${{ github.repository_owner }}
|
2023-04-07 12:10:53 +00:00
|
|
|
version: ${{ github.ref_name }}
|
2023-02-28 16:54:37 +00:00
|
|
|
sign-image: true
|
|
|
|
sbom-name: reports-controller
|
|
|
|
sbom-repository: ghcr.io/${{ github.repository_owner }}/sbom
|
|
|
|
signature-repository: ghcr.io/${{ github.repository_owner }}/signatures
|
|
|
|
main-path: ./cmd/reports-controller
|
2022-08-26 16:56:27 +00:00
|
|
|
|
2023-04-07 13:47:15 +00:00
|
|
|
generate-kyverno-provenance:
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: release-images
|
2022-12-21 11:13:21 +00:00
|
|
|
permissions:
|
2023-01-19 06:28:26 +00:00
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
2022-12-21 11:13:21 +00:00
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2022-12-21 11:13:21 +00:00
|
|
|
with:
|
2023-04-07 13:47:15 +00:00
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyverno
|
|
|
|
digest: "${{ needs.release-images.outputs.kyverno-digest }}"
|
2022-12-21 11:13:21 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-21 11:13:21 +00:00
|
|
|
|
2023-04-07 13:47:15 +00:00
|
|
|
generate-kyverno-init-provenance:
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: release-images
|
2022-12-21 11:13:21 +00:00
|
|
|
permissions:
|
2023-01-19 06:28:26 +00:00
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
2022-12-21 11:13:21 +00:00
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2022-12-21 11:13:21 +00:00
|
|
|
with:
|
2023-04-07 13:47:15 +00:00
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyvernopre
|
|
|
|
digest: "${{ needs.release-images.outputs.kyverno-init-digest }}"
|
2022-12-21 11:13:21 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-21 11:13:21 +00:00
|
|
|
|
2023-02-28 16:54:37 +00:00
|
|
|
generate-background-controller-provenance:
|
|
|
|
needs: release-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2023-02-28 16:54:37 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/background-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
digest: "${{ needs.release-images.outputs.background-controller-digest }}"
|
2023-02-28 16:54:37 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 16:54:37 +00:00
|
|
|
|
2022-12-21 12:07:59 +00:00
|
|
|
generate-cleanup-controller-provenance:
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: release-images
|
2022-12-21 12:07:59 +00:00
|
|
|
permissions:
|
2023-01-19 06:28:26 +00:00
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
2022-12-21 12:07:59 +00:00
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2022-12-21 12:07:59 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/cleanup-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
digest: "${{ needs.release-images.outputs.cleanup-controller-digest }}"
|
2022-12-21 12:07:59 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-21 12:07:59 +00:00
|
|
|
|
2022-12-21 11:13:21 +00:00
|
|
|
generate-kyverno-cli-provenance:
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: release-images
|
2022-12-21 11:13:21 +00:00
|
|
|
permissions:
|
2023-01-19 06:28:26 +00:00
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
2022-12-21 11:13:21 +00:00
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2022-12-21 11:13:21 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/kyverno-cli
|
2023-04-07 13:47:15 +00:00
|
|
|
digest: "${{ needs.release-images.outputs.cli-digest }}"
|
2022-12-21 11:13:21 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-21 11:13:21 +00:00
|
|
|
|
2023-02-28 16:54:37 +00:00
|
|
|
generate-reports-controller-provenance:
|
|
|
|
needs: release-images
|
|
|
|
permissions:
|
|
|
|
id-token: write # To sign the provenance.
|
|
|
|
packages: write # To upload assets to release.
|
|
|
|
actions: read # To read the workflow path.
|
|
|
|
# NOTE: The container generator workflow is not officially released as GA.
|
2024-04-25 10:45:13 +00:00
|
|
|
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
|
2023-02-28 16:54:37 +00:00
|
|
|
with:
|
|
|
|
image: ghcr.io/${{ github.repository_owner }}/reports-controller
|
2023-04-07 13:47:15 +00:00
|
|
|
digest: "${{ needs.release-images.outputs.reports-controller-digest }}"
|
2023-02-28 16:54:37 +00:00
|
|
|
registry-username: ${{ github.actor }}
|
|
|
|
secrets:
|
2023-06-30 22:55:58 +00:00
|
|
|
registry-password: ${{ secrets.GITHUB_TOKEN }}
|
2023-02-28 16:54:37 +00:00
|
|
|
|
2021-08-10 16:07:46 +00:00
|
|
|
create-release:
|
|
|
|
runs-on: ubuntu-latest
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: release-images
|
2023-06-29 16:37:45 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
id-token: write
|
2021-08-10 16:07:46 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 10:36:00 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-09-20 22:35:49 +00:00
|
|
|
timeout-minutes: 30
|
2023-01-19 06:28:26 +00:00
|
|
|
- uses: creekorful/goreportcard-action@1f35ced8cdac2cba28c9a2f2288a16aacfd507f9 # v1.0
|
2023-06-09 16:05:45 +00:00
|
|
|
- name: Install Cosign
|
2024-04-16 08:41:29 +00:00
|
|
|
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
|
2021-08-10 16:07:46 +00:00
|
|
|
- name: Make Release
|
|
|
|
env:
|
2023-04-07 12:10:53 +00:00
|
|
|
VERSION: ${{ github.ref_name }}
|
2021-08-10 16:07:46 +00:00
|
|
|
run: |
|
|
|
|
rm -rf release
|
|
|
|
mkdir release
|
|
|
|
make release-notes > release/release-notes.out
|
|
|
|
cat release/release-notes.out
|
|
|
|
- name: Run GoReleaser
|
2024-05-17 06:53:11 +00:00
|
|
|
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0
|
2021-08-10 16:07:46 +00:00
|
|
|
with:
|
|
|
|
version: latest
|
2023-09-21 08:24:45 +00:00
|
|
|
args: release --clean --timeout 90m --debug --release-notes=release/release-notes.out
|
2021-08-10 16:07:46 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-02-22 22:48:11 +00:00
|
|
|
|
2022-10-18 09:31:31 +00:00
|
|
|
push-and-sign-install-manifest:
|
|
|
|
runs-on: ubuntu-latest
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: create-release
|
2022-10-18 09:31:31 +00:00
|
|
|
permissions:
|
|
|
|
contents: write # needed to write releases
|
|
|
|
id-token: write # needed for keyless signing
|
|
|
|
packages: write # needed for ghcr access
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 10:36:00 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2022-10-18 09:31:31 +00:00
|
|
|
- name: Setup Flux CLI
|
2024-05-23 07:30:14 +00:00
|
|
|
uses: fluxcd/flux2/action@896e0fa46d5107a05e953dd0a5261d78a145ec8c # v2.3.0
|
2022-10-18 09:31:31 +00:00
|
|
|
with:
|
|
|
|
version: 0.35.0
|
|
|
|
- name: Install Cosign
|
2024-04-16 08:41:29 +00:00
|
|
|
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
|
2022-10-03 15:12:43 +00:00
|
|
|
- name: Build yaml manifest
|
2023-04-07 12:10:53 +00:00
|
|
|
run: VERSION=${{ github.ref_name }} make codegen-manifest-release
|
2023-01-11 04:54:23 +00:00
|
|
|
- name: Upload install manifest
|
2024-02-24 10:22:38 +00:00
|
|
|
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
2022-10-03 15:12:43 +00:00
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-19 15:26:07 +00:00
|
|
|
file: .manifest/release.yaml
|
2022-10-03 15:12:43 +00:00
|
|
|
asset_name: install.yaml
|
|
|
|
tag: ${{ github.ref }}
|
2023-01-11 04:54:23 +00:00
|
|
|
- name: Upload CRD manifest
|
2024-02-24 10:22:38 +00:00
|
|
|
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
|
2023-01-11 04:54:23 +00:00
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2024-03-04 16:11:00 +00:00
|
|
|
file: config/crds/**/*.yaml
|
2023-01-11 04:54:23 +00:00
|
|
|
file_glob: true
|
|
|
|
tag: ${{ github.ref }}
|
2022-10-20 18:23:27 +00:00
|
|
|
- name: Login to GHCR
|
2024-03-14 08:19:11 +00:00
|
|
|
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
|
2022-10-20 18:23:27 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-14 12:48:32 +00:00
|
|
|
- name: Push manifests to GHCR with Flux
|
2022-10-18 09:31:31 +00:00
|
|
|
env:
|
2023-06-30 22:55:58 +00:00
|
|
|
CR_PAT_ARTIFACTS: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-14 12:48:32 +00:00
|
|
|
run: |
|
2022-10-20 18:23:27 +00:00
|
|
|
set -e
|
2022-10-21 12:29:55 +00:00
|
|
|
mkdir -p config/.release-manifests
|
2022-12-19 15:26:07 +00:00
|
|
|
cp .manifest/release.yaml config/.release-manifests/install.yaml
|
2022-10-21 12:29:55 +00:00
|
|
|
cd config/.release-manifests/ && \
|
2023-04-07 12:10:53 +00:00
|
|
|
flux push artifact oci://ghcr.io/${{ github.repository_owner }}/manifests/kyverno:${{ github.ref_name }} \
|
2022-10-20 18:23:27 +00:00
|
|
|
--path="." \
|
|
|
|
--source="$(git config --get remote.origin.url)" \
|
2023-04-07 12:10:53 +00:00
|
|
|
--revision="${{ github.ref_name }}/$(git rev-parse HEAD)"
|
2022-10-14 12:48:32 +00:00
|
|
|
- name: Sign manifests in GHCR with Cosign
|
|
|
|
run: |
|
2023-07-06 12:19:21 +00:00
|
|
|
cosign sign --yes ghcr.io/${{ github.repository_owner }}/manifests/kyverno:${{ github.ref_name }}
|
2022-10-03 15:12:43 +00:00
|
|
|
|
2021-02-22 22:48:11 +00:00
|
|
|
release-cli-via-krew:
|
|
|
|
runs-on: ubuntu-latest
|
2023-01-19 06:28:26 +00:00
|
|
|
needs: create-release
|
2021-02-22 22:48:11 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-05-07 10:36:00 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-09-27 08:24:27 +00:00
|
|
|
- name: Setup caches
|
|
|
|
uses: ./.github/actions/setup-caches
|
|
|
|
timeout-minutes: 5
|
|
|
|
continue-on-error: true
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2023-08-30 20:44:51 +00:00
|
|
|
timeout-minutes: 10
|
2021-02-22 22:48:11 +00:00
|
|
|
- name: Check Tag
|
|
|
|
id: check-tag
|
|
|
|
run: |
|
|
|
|
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
2022-11-30 11:53:30 +00:00
|
|
|
echo "match=true" >> $GITHUB_OUTPUT
|
2021-02-22 22:48:11 +00:00
|
|
|
fi
|
|
|
|
- name: Update new version in krew-index
|
|
|
|
if: steps.check-tag.outputs.match == 'true'
|
2023-03-27 09:52:25 +00:00
|
|
|
uses: rajatjindal/krew-release-bot@df3eb197549e3568be8b4767eec31c5e8e8e6ad8 # v0.0.46
|