mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
do not build dev images
This commit is contained in:
16
.github/workflows/build-image.yaml
vendored
16
.github/workflows/build-image.yaml
vendored
@@ -11,11 +11,6 @@ on:
|
||||
description: 'image tag'
|
||||
required: true
|
||||
type: string
|
||||
tag_latest:
|
||||
description: 'should this image have the latest tag'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
image_name:
|
||||
description: 'image registry and name'
|
||||
required: true
|
||||
@@ -75,18 +70,11 @@ jobs:
|
||||
|
||||
- name: Build and push image
|
||||
if: ${{ inputs.support_platforms }}
|
||||
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --platform linux/amd64,linux/arm64
|
||||
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --tag ${{ inputs.image_name }}:latest --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --push --platform linux/amd64,linux/arm64
|
||||
|
||||
- name: Build and push image without amd64/arm64 support
|
||||
if: ${{ !inputs.support_platforms }}
|
||||
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }}
|
||||
|
||||
- name: Tag image as latest
|
||||
if: ${{ inputs.tag_latest }}
|
||||
run: docker tag ${{ inputs.image_name }}:${{ inputs.image_tag }} ${{ inputs.image_name }}:latest
|
||||
|
||||
- name: Push image to registry
|
||||
run: docker push ${{ inputs.image_name }}
|
||||
run: docker buildx build . --file build/Dockerfile --tag ${{ inputs.image_name }}:${{ inputs.image_tag }} --tag ${{ inputs.image_name }}:latest --build-arg image_version=${{ inputs.image_tag }} --build-arg client=${{ inputs.client }} --push
|
||||
|
||||
- name: Install cosign
|
||||
uses: sigstore/cosign-installer@main
|
||||
|
||||
126
.github/workflows/build.yaml
vendored
126
.github/workflows/build.yaml
vendored
@@ -6,80 +6,80 @@ on:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
jobs:
|
||||
# test:
|
||||
# uses: ./.github/workflows/test.yaml
|
||||
# with:
|
||||
# release: "v2.0.${{ github.run_number }}"
|
||||
# client: test
|
||||
test:
|
||||
uses: ./.github/workflows/test.yaml
|
||||
with:
|
||||
release: "v2.0.${{ github.run_number }}"
|
||||
client: test
|
||||
|
||||
# create-release:
|
||||
# uses: ./.github/workflows/release.yaml
|
||||
# needs: test
|
||||
# with:
|
||||
# release_name: "Release v2.0.${{ github.run_number }}"
|
||||
# tag_name: "v2.0.${{ github.run_number }}"
|
||||
# secrets: inherit
|
||||
create-release:
|
||||
uses: ./.github/workflows/release.yaml
|
||||
needs: test
|
||||
with:
|
||||
release_name: "Release v2.0.${{ github.run_number }}"
|
||||
tag_name: "v2.0.${{ github.run_number }}"
|
||||
secrets: inherit
|
||||
|
||||
# publish-artifacts:
|
||||
# name: Build and publish artifacts
|
||||
# needs: create-release
|
||||
# runs-on: ${{ matrix.os }}
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# strategy:
|
||||
# matrix:
|
||||
# os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# with:
|
||||
# submodules: recursive
|
||||
publish-artifacts:
|
||||
name: Build and publish artifacts
|
||||
needs: create-release
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# - name: Set up Go
|
||||
# uses: actions/setup-go@v3
|
||||
# with:
|
||||
# go-version: 1.18
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.18
|
||||
|
||||
# - name: Install MSYS2 & libgit2 (Windows)
|
||||
# shell: cmd
|
||||
# run: .\build.bat all
|
||||
# if: matrix.os == 'windows-latest'
|
||||
- name: Install MSYS2 & libgit2 (Windows)
|
||||
shell: cmd
|
||||
run: .\build.bat all
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
# - name: Install libgit2 (Linux/macOS)
|
||||
# run: make libgit2
|
||||
# if: matrix.os != 'windows-latest'
|
||||
- name: Install libgit2 (Linux/macOS)
|
||||
run: make libgit2
|
||||
if: matrix.os != 'windows-latest'
|
||||
|
||||
# - name: Build
|
||||
# env:
|
||||
# RELEASE: v2.0.${{ github.run_number }}
|
||||
# CLIENT: release
|
||||
# CGO_ENABLED: 1
|
||||
# run: python3 --version && python3 build.py
|
||||
- name: Build
|
||||
env:
|
||||
RELEASE: v2.0.${{ github.run_number }}
|
||||
CLIENT: release
|
||||
CGO_ENABLED: 1
|
||||
run: python3 --version && python3 build.py
|
||||
|
||||
# - name: Upload release binaries
|
||||
# id: upload-release-asset
|
||||
# uses: actions/upload-release-asset@v1
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# with:
|
||||
# upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
# asset_path: build/${{ matrix.os }}/kubescape
|
||||
# asset_name: kubescape-${{ matrix.os }}
|
||||
# asset_content_type: application/octet-stream
|
||||
- name: Upload release binaries
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: build/${{ matrix.os }}/kubescape
|
||||
asset_name: kubescape-${{ matrix.os }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
# - name: Upload release hash
|
||||
# id: upload-release-hash
|
||||
# uses: actions/upload-release-asset@v1
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# with:
|
||||
# upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
# asset_path: build/${{ matrix.os }}/kubescape.sha256
|
||||
# asset_name: kubescape-${{ matrix.os }}-sha256
|
||||
# asset_content_type: application/octet-stream
|
||||
- name: Upload release hash
|
||||
id: upload-release-hash
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
||||
asset_path: build/${{ matrix.os }}/kubescape.sha256
|
||||
asset_name: kubescape-${{ matrix.os }}-sha256
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
publish-image:
|
||||
uses: ./.github/workflows/build-image.yaml
|
||||
# needs: create-release
|
||||
needs: create-release
|
||||
with:
|
||||
client: "image-release"
|
||||
image_name: "quay.io/${{ github.repository_owner }}/kubescape"
|
||||
|
||||
20
.github/workflows/build_dev.yaml
vendored
20
.github/workflows/build_dev.yaml
vendored
@@ -13,13 +13,13 @@ jobs:
|
||||
release: "v2.0.${{ github.run_number }}"
|
||||
client: test
|
||||
|
||||
publish-dev-image:
|
||||
uses: ./.github/workflows/build-image.yaml
|
||||
needs: test
|
||||
with:
|
||||
client: "image-dev"
|
||||
image_name: "quay.io/${{ github.repository_owner }}/kubescape"
|
||||
image_tag: "dev-v2.0.${{ github.run_number }}"
|
||||
support_platforms: true
|
||||
cosign: true
|
||||
secrets: inherit
|
||||
# publish-dev-image:
|
||||
# uses: ./.github/workflows/build-image.yaml
|
||||
# needs: test
|
||||
# with:
|
||||
# client: "image-dev"
|
||||
# image_name: "quay.io/${{ github.repository_owner }}/kubescape"
|
||||
# image_tag: "dev-v2.0.${{ github.run_number }}"
|
||||
# support_platforms: true
|
||||
# cosign: true
|
||||
# secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user