mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
92 lines
2.6 KiB
YAML
92 lines
2.6 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths-ignore:
|
|
# Do not run the pipeline if only Markdown files changed
|
|
- '**.md'
|
|
jobs:
|
|
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
|
|
|
|
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: 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: 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 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:
|
|
# if: ${{ github.repository == 'kubescape/kubescape' }} # TODO
|
|
# uses: ./.github/workflows/build-image.yaml
|
|
# needs: create-release
|
|
# with:
|
|
# client: "image-release"
|
|
# image_name: "quay.io/${{ github.repository_owner }}/kubescape"
|
|
# image_tag: "v2.0.${{ github.run_number }}"
|
|
# support_platforms: true
|
|
# cosign: true
|
|
# secrets: inherit
|