mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
Restore single goreleaser file (#853)
This commit is contained in:
parent
1d1a7de314
commit
d2f28e0eb1
8 changed files with 54 additions and 82 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -19,7 +19,6 @@ CHANGELOG.md
|
||||||
.tmp/
|
.tmp/
|
||||||
coverage.txt
|
coverage.txt
|
||||||
bin/
|
bin/
|
||||||
.goreleaser.yaml
|
|
||||||
|
|
||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
*.exe
|
*.exe
|
||||||
|
|
|
@ -2,6 +2,10 @@ release:
|
||||||
prerelease: auto
|
prerelease: auto
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
# required to support multi architecture docker builds
|
||||||
|
- DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- ./.github/scripts/apple-signing/setup.sh {{ .IsSnapshot }}
|
- ./.github/scripts/apple-signing/setup.sh {{ .IsSnapshot }}
|
||||||
|
@ -89,3 +93,41 @@ brews:
|
||||||
description: *description
|
description: *description
|
||||||
license: "Apache License 2.0"
|
license: "Apache License 2.0"
|
||||||
|
|
||||||
|
dockers:
|
||||||
|
- image_templates:
|
||||||
|
- "anchore/syft:latest"
|
||||||
|
- "anchore/syft:{{ .Tag }}-amd64"
|
||||||
|
- "anchore/syft:v{{ .Major }}-amd64"
|
||||||
|
- "anchore/syft:v{{ .Major }}.{{ .Minor }}-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"
|
||||||
|
- "anchore/syft:v{{ .Major }}-arm64v8"
|
||||||
|
- "anchore/syft:v{{ .Major }}.{{ .Minor }}-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}}"
|
||||||
|
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: anchore/syft:{{ .Tag }}
|
||||||
|
image_templates:
|
||||||
|
- anchore/syft:v{{ .Major }}.{{ .Minor }}-amd64
|
||||||
|
- anchore/syft:v{{ .Major }}.{{ .Minor }}-arm64v8
|
||||||
|
- name_template: anchore/syft:latest
|
||||||
|
image_templates:
|
||||||
|
- anchore/syft:v{{ .Major }}.{{ .Minor }}-amd64
|
||||||
|
- anchore/syft:v{{ .Major }}.{{ .Minor }}-arm64v8
|
|
@ -1,24 +0,0 @@
|
||||||
TARGET=../.goreleaser.yaml
|
|
||||||
|
|
||||||
.PHONY: snapshot-config
|
|
||||||
snapshot-config:
|
|
||||||
cat snapshot.yaml > $(TARGET)
|
|
||||||
cat env-skip-signing.yaml >> $(TARGET)
|
|
||||||
cat main.yaml >> $(TARGET)
|
|
||||||
cat docker.yaml >> $(TARGET)
|
|
||||||
cat $(TARGET)
|
|
||||||
|
|
||||||
.PHONY: snapshot-with-signing-config
|
|
||||||
snapshot-with-signing-config:
|
|
||||||
# we leave out docker entirely such that this can easily be tested in CI
|
|
||||||
cat snapshot.yaml > $(TARGET)
|
|
||||||
cat env-default.yaml >> $(TARGET)
|
|
||||||
cat main.yaml >> $(TARGET)
|
|
||||||
cat $(TARGET)
|
|
||||||
|
|
||||||
.PHONY: release-config
|
|
||||||
release-config:
|
|
||||||
cat env-default.yaml > $(TARGET)
|
|
||||||
cat docker.yaml >> $(TARGET)
|
|
||||||
cat main.yaml >> $(TARGET)
|
|
||||||
cat $(TARGET)
|
|
|
@ -1,39 +0,0 @@
|
||||||
|
|
||||||
dockers:
|
|
||||||
- image_templates:
|
|
||||||
- "anchore/syft:latest"
|
|
||||||
- "anchore/syft:{{ .Tag }}-amd64"
|
|
||||||
- "anchore/syft:v{{ .Major }}-amd64"
|
|
||||||
- "anchore/syft:v{{ .Major }}.{{ .Minor }}-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"
|
|
||||||
- "anchore/syft:v{{ .Major }}-arm64v8"
|
|
||||||
- "anchore/syft:v{{ .Major }}.{{ .Minor }}-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}}"
|
|
||||||
|
|
||||||
docker_manifests:
|
|
||||||
- name_template: anchore/syft:{{ .Tag }}
|
|
||||||
image_templates:
|
|
||||||
- anchore/syft:v{{ .Major }}.{{ .Minor }}-amd64
|
|
||||||
- anchore/syft:v{{ .Major }}.{{ .Minor }}-arm64v8
|
|
||||||
- name_template: anchore/syft:latest
|
|
||||||
image_templates:
|
|
||||||
- anchore/syft:v{{ .Major }}.{{ .Minor }}-amd64
|
|
||||||
- anchore/syft:v{{ .Major }}.{{ .Minor }}-arm64v8
|
|
|
@ -1,4 +0,0 @@
|
||||||
|
|
||||||
env:
|
|
||||||
# required to support multi architecture docker builds
|
|
||||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
env:
|
|
||||||
# required to support multi architecture docker builds
|
|
||||||
- DOCKER_CLI_EXPERIMENTAL=enabled
|
|
||||||
- SKIP_SIGNING=true
|
|
|
@ -1 +0,0 @@
|
||||||
dist: snapshot
|
|
20
Makefile
20
Makefile
|
@ -234,24 +234,25 @@ build: $(SNAPSHOTDIR) ## Build release snapshot binaries and packages
|
||||||
$(SNAPSHOTDIR): ## Build snapshot release binaries and packages
|
$(SNAPSHOTDIR): ## Build snapshot release binaries and packages
|
||||||
$(call title,Building snapshot artifacts)
|
$(call title,Building snapshot artifacts)
|
||||||
|
|
||||||
cd .goreleaser && make snapshot-config
|
# create a config with the dist dir overridden
|
||||||
|
echo "dist: $(SNAPSHOTDIR)" > $(TEMPDIR)/goreleaser.yaml
|
||||||
|
cat .goreleaser.yaml >> $(TEMPDIR)/goreleaser.yaml
|
||||||
|
|
||||||
# build release snapshots
|
# build release snapshots
|
||||||
bash -c "$(SNAPSHOT_CMD) --skip-sign"
|
bash -c "SKIP_SIGNING=true $(SNAPSHOT_CMD) --skip-sign --config $(TEMPDIR)/goreleaser.yaml"
|
||||||
|
|
||||||
.PHONY: snapshot-with-signing
|
.PHONY: snapshot-with-signing
|
||||||
snapshot-with-signing: ## Build snapshot release binaries and packages (with dummy signing)
|
snapshot-with-signing: ## Build snapshot release binaries and packages (with dummy signing)
|
||||||
$(call title,Building snapshot artifacts (+ signing))
|
$(call title,Building snapshot artifacts (+ signing))
|
||||||
|
|
||||||
cd .goreleaser && make snapshot-with-signing-config
|
# create a config with the dist dir overridden
|
||||||
|
echo "dist: $(SNAPSHOTDIR)" > $(TEMPDIR)/goreleaser.yaml
|
||||||
|
cat .goreleaser.yaml >> $(TEMPDIR)/goreleaser.yaml
|
||||||
|
|
||||||
rm -f .github/scripts/apple-signing/log/*.txt
|
rm -f .github/scripts/apple-signing/log/*.txt
|
||||||
|
|
||||||
# remove the keychain with the trusted self-signed cert automatically (from failed previous runs)
|
|
||||||
.github/scripts/apple-signing/cleanup.sh
|
|
||||||
|
|
||||||
# build release snapshots
|
# build release snapshots
|
||||||
bash -c "$(SNAPSHOT_CMD) || (cat .github/scripts/apple-signing/log/*.txt && false)"
|
bash -c "$(SNAPSHOT_CMD) --config $(TEMPDIR)/goreleaser.yaml || (cat .github/scripts/apple-signing/log/*.txt && false)"
|
||||||
|
|
||||||
# remove the keychain with the trusted self-signed cert automatically
|
# remove the keychain with the trusted self-signed cert automatically
|
||||||
.github/scripts/apple-signing/cleanup.sh
|
.github/scripts/apple-signing/cleanup.sh
|
||||||
|
@ -315,13 +316,16 @@ CHANGELOG.md:
|
||||||
release: clean-dist CHANGELOG.md ## Build and publish final binaries and packages. Intended to be run only on macOS.
|
release: clean-dist CHANGELOG.md ## Build and publish final binaries and packages. Intended to be run only on macOS.
|
||||||
$(call title,Publishing release artifacts)
|
$(call title,Publishing release artifacts)
|
||||||
|
|
||||||
cd .goreleaser && make release-config
|
# create a config with the dist dir overridden
|
||||||
|
echo "dist: $(DISTDIR)" > $(TEMPDIR)/goreleaser.yaml
|
||||||
|
cat .goreleaser.yaml >> $(TEMPDIR)/goreleaser.yaml
|
||||||
|
|
||||||
rm -f .github/scripts/apple-signing/log/*.txt
|
rm -f .github/scripts/apple-signing/log/*.txt
|
||||||
|
|
||||||
# note: notarization cannot be done in parallel, thus --parallelism 1
|
# note: notarization cannot be done in parallel, thus --parallelism 1
|
||||||
bash -c "\
|
bash -c "\
|
||||||
$(RELEASE_CMD) \
|
$(RELEASE_CMD) \
|
||||||
|
--config $(TEMPDIR)/goreleaser.yaml \
|
||||||
--parallelism 1 \
|
--parallelism 1 \
|
||||||
--release-notes <(cat CHANGELOG.md)\
|
--release-notes <(cat CHANGELOG.md)\
|
||||||
|| (cat .github/scripts/apple-signing/log/*.txt && false)"
|
|| (cat .github/scripts/apple-signing/log/*.txt && false)"
|
||||||
|
|
Loading…
Reference in a new issue