2024-06-07 16:55:32 +00:00
|
|
|
version: 2
|
|
|
|
|
2021-03-11 17:41:10 +00:00
|
|
|
release:
|
|
|
|
prerelease: auto
|
2022-06-01 15:55:33 +00:00
|
|
|
draft: false
|
2021-03-11 17:41:10 +00:00
|
|
|
|
2022-10-24 17:03:10 +00:00
|
|
|
env:
|
|
|
|
# required to support multi architecture docker builds
|
|
|
|
- DOCKER_CLI_EXPERIMENTAL=enabled
|
2023-01-17 15:04:22 +00:00
|
|
|
- CGO_ENABLED=0
|
2022-02-04 21:49:42 +00:00
|
|
|
|
2021-03-11 17:41:10 +00:00
|
|
|
builds:
|
2022-02-04 17:41:37 +00:00
|
|
|
- id: linux-build
|
2022-04-26 18:23:03 +00:00
|
|
|
dir: ./cmd/syft
|
2022-02-04 17:41:37 +00:00
|
|
|
binary: syft
|
2021-03-11 17:41:10 +00:00
|
|
|
goos:
|
|
|
|
- linux
|
|
|
|
goarch:
|
|
|
|
- amd64
|
2022-01-10 19:52:31 +00:00
|
|
|
- arm64
|
2022-07-21 13:12:52 +00:00
|
|
|
- ppc64le
|
2022-07-27 20:33:54 +00:00
|
|
|
- s390x
|
2022-02-04 17:41:37 +00:00
|
|
|
# set the modified timestamp on the output binary to the git timestamp to ensure a reproducible build
|
|
|
|
mod_timestamp: &build-timestamp '{{ .CommitTimestamp }}'
|
|
|
|
ldflags: &build-ldflags |
|
2021-03-11 17:41:10 +00:00
|
|
|
-w
|
|
|
|
-s
|
|
|
|
-extldflags '-static'
|
2023-08-29 19:52:26 +00:00
|
|
|
-X main.version={{.Version}}
|
|
|
|
-X main.gitCommit={{.Commit}}
|
|
|
|
-X main.buildDate={{.Date}}
|
|
|
|
-X main.gitDescription={{.Summary}}
|
2021-10-26 13:42:35 +00:00
|
|
|
|
2022-02-04 17:41:37 +00:00
|
|
|
- id: darwin-build
|
2022-04-26 18:23:03 +00:00
|
|
|
dir: ./cmd/syft
|
2022-02-04 17:41:37 +00:00
|
|
|
binary: syft
|
2021-03-11 17:41:10 +00:00
|
|
|
goos:
|
|
|
|
- darwin
|
|
|
|
goarch:
|
|
|
|
- amd64
|
2021-10-26 13:42:35 +00:00
|
|
|
- arm64
|
2022-02-04 17:41:37 +00:00
|
|
|
mod_timestamp: *build-timestamp
|
|
|
|
ldflags: *build-ldflags
|
2022-02-07 21:55:15 +00:00
|
|
|
hooks:
|
|
|
|
post:
|
2023-10-25 13:08:43 +00:00
|
|
|
- cmd: .tool/quill sign-and-notarize "{{ .Path }}" --dry-run={{ .IsSnapshot }} --ad-hoc={{ .IsSnapshot }} -vv
|
2022-10-24 17:03:10 +00:00
|
|
|
env:
|
|
|
|
- QUILL_LOG_FILE=/tmp/quill-{{ .Target }}.log
|
2022-02-04 17:41:37 +00:00
|
|
|
|
|
|
|
- id: windows-build
|
2022-04-26 18:23:03 +00:00
|
|
|
dir: ./cmd/syft
|
2022-02-04 17:41:37 +00:00
|
|
|
binary: syft
|
|
|
|
goos:
|
|
|
|
- windows
|
|
|
|
goarch:
|
|
|
|
- amd64
|
|
|
|
mod_timestamp: *build-timestamp
|
|
|
|
ldflags: *build-ldflags
|
2021-03-11 17:41:10 +00:00
|
|
|
|
|
|
|
archives:
|
2022-02-04 17:41:37 +00:00
|
|
|
- id: linux-archives
|
|
|
|
builds:
|
|
|
|
- linux-build
|
2022-01-10 19:52:31 +00:00
|
|
|
|
2022-02-04 17:41:37 +00:00
|
|
|
# note: the signing process is depending on tar.gz archives. If this format changes then .github/scripts/apple-signing/*.sh will need to be adjusted
|
|
|
|
- id: darwin-archives
|
2021-03-11 17:41:10 +00:00
|
|
|
builds:
|
2022-02-04 17:41:37 +00:00
|
|
|
- darwin-build
|
|
|
|
|
|
|
|
- id: windows-archives
|
|
|
|
format: zip
|
|
|
|
builds:
|
|
|
|
- windows-build
|
2021-03-11 17:41:10 +00:00
|
|
|
|
|
|
|
nfpms:
|
|
|
|
- license: "Apache 2.0"
|
|
|
|
maintainer: "Anchore, Inc"
|
|
|
|
homepage: &website "https://github.com/anchore/syft"
|
|
|
|
description: &description "A tool that generates a Software Bill Of Materials (SBOM) from container images and filesystems"
|
|
|
|
formats:
|
|
|
|
- rpm
|
|
|
|
- deb
|
|
|
|
|
|
|
|
brews:
|
2024-06-07 16:55:32 +00:00
|
|
|
- repository:
|
2021-03-11 17:41:10 +00:00
|
|
|
owner: anchore
|
|
|
|
name: homebrew-syft
|
2022-11-02 14:05:20 +00:00
|
|
|
token: "{{.Env.GITHUB_BREW_TOKEN}}"
|
2022-01-10 19:52:31 +00:00
|
|
|
ids:
|
2022-02-04 17:41:37 +00:00
|
|
|
- darwin-archives
|
|
|
|
- linux-archives
|
2021-03-11 17:41:10 +00:00
|
|
|
homepage: *website
|
|
|
|
description: *description
|
2022-01-10 19:52:31 +00:00
|
|
|
license: "Apache License 2.0"
|
2022-10-24 17:03:10 +00:00
|
|
|
|
|
|
|
dockers:
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:debug
|
|
|
|
- anchore/syft:{{.Tag}}-debug
|
|
|
|
- ghcr.io/anchore/syft:debug
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug
|
|
|
|
goarch: amd64
|
|
|
|
dockerfile: Dockerfile.debug
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/amd64"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:debug-arm64v8
|
|
|
|
- anchore/syft:{{.Tag}}-debug-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:debug-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-arm64v8
|
|
|
|
goarch: arm64
|
|
|
|
dockerfile: Dockerfile.debug
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/arm64/v8"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:debug-ppc64le
|
|
|
|
- anchore/syft:{{.Tag}}-debug-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:debug-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-ppc64le
|
|
|
|
goarch: ppc64le
|
|
|
|
dockerfile: Dockerfile.debug
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/ppc64le"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:debug-s390x
|
|
|
|
- anchore/syft:{{.Tag}}-debug-s390x
|
|
|
|
- ghcr.io/anchore/syft:debug-s390x
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-s390x
|
|
|
|
goarch: s390x
|
|
|
|
dockerfile: Dockerfile.debug
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/s390x"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:latest
|
|
|
|
- anchore/syft:{{.Tag}}
|
|
|
|
- ghcr.io/anchore/syft:latest
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}
|
|
|
|
goarch: amd64
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/amd64"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
goarch: arm64
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/arm64/v8"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
goarch: ppc64le
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/ppc64le"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
- image_templates:
|
|
|
|
- anchore/syft:{{.Tag}}-s390x
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-s390x
|
|
|
|
goarch: s390x
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
use: buildx
|
|
|
|
build_flag_templates:
|
|
|
|
- "--platform=linux/s390x"
|
|
|
|
- "--build-arg=BUILD_DATE={{.Date}}"
|
|
|
|
- "--build-arg=BUILD_VERSION={{.Version}}"
|
|
|
|
- "--build-arg=VCS_REF={{.FullCommit}}"
|
|
|
|
- "--build-arg=VCS_URL={{.GitURL}}"
|
|
|
|
|
|
|
|
docker_manifests:
|
|
|
|
- name_template: anchore/syft:latest
|
|
|
|
image_templates:
|
|
|
|
- anchore/syft:{{.Tag}}
|
|
|
|
- anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
- anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
- anchore/syft:{{.Tag}}-s390x
|
|
|
|
|
|
|
|
- name_template: anchore/syft:debug
|
|
|
|
- anchore/syft:{{.Tag}}-debug
|
|
|
|
- anchore/syft:{{.Tag}}-debug-arm64v8
|
|
|
|
- anchore/syft:{{.Tag}}-debug-ppc64le
|
|
|
|
- anchore/syft:{{.Tag}}-debug-s390x
|
|
|
|
|
|
|
|
- name_template: anchore/syft:{{.Tag}}
|
|
|
|
image_templates:
|
|
|
|
- anchore/syft:{{.Tag}}
|
|
|
|
- anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
- anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
- anchore/syft:{{.Tag}}-s390x
|
|
|
|
|
|
|
|
- name_template: ghcr.io/anchore/syft:latest
|
|
|
|
image_templates:
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-s390x
|
|
|
|
|
|
|
|
- name_template: ghcr.io/anchore/syft:debug
|
|
|
|
image_templates:
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-debug-s390x
|
|
|
|
|
|
|
|
- name_template: ghcr.io/anchore/syft:{{.Tag}}
|
|
|
|
image_templates:
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-arm64v8
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-ppc64le
|
|
|
|
- ghcr.io/anchore/syft:{{.Tag}}-s390x
|
2024-01-30 18:16:40 +00:00
|
|
|
|
|
|
|
sboms:
|
|
|
|
- artifacts: archive
|
|
|
|
# this is relative to the snapshot/dist directory, not the root of the repo
|
|
|
|
cmd: ../.tool/syft
|
|
|
|
documents:
|
|
|
|
- "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sbom"
|
|
|
|
args:
|
|
|
|
- "scan"
|
|
|
|
- "$artifact"
|
|
|
|
- "--output"
|
|
|
|
- "json=$document"
|
2024-01-31 18:19:41 +00:00
|
|
|
|
|
|
|
signs:
|
|
|
|
- cmd: .tool/cosign
|
|
|
|
signature: "${artifact}.sig"
|
|
|
|
certificate: "${artifact}.pem"
|
|
|
|
args:
|
|
|
|
- "sign-blob"
|
|
|
|
- "--oidc-issuer=https://token.actions.githubusercontent.com"
|
|
|
|
- "--output-certificate=${certificate}"
|
|
|
|
- "--output-signature=${signature}"
|
|
|
|
- "${artifact}"
|
|
|
|
- "--yes"
|
|
|
|
artifacts: checksum
|