forked from trufflesecurity/trufflehog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update docs and support multi platform docker images
- Loading branch information
1 parent
c45bca4
commit a96de1a
Showing
6 changed files
with
109 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,47 @@ | ||
name: release | ||
|
||
# on: | ||
# push: | ||
# tags: | ||
# - 'v*' | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
Release: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_CLI_EXPERIMENTAL: "enabled" | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Docker Login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- | ||
name: Run GoReleaser | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.idea | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
builds: | ||
- env: [CGO_ENABLED=0] | ||
binary: trufflehog | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
dockers: | ||
- image_templates: ["ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64"] | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/amd64 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
- image_templates: ["ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8"] | ||
goarch: arm64 | ||
dockerfile: Dockerfile.goreleaser | ||
use: buildx | ||
build_flag_templates: | ||
- --platform=linux/arm64/v8 | ||
- --label=org.opencontainers.image.title={{ .ProjectName }} | ||
- --label=org.opencontainers.image.description={{ .ProjectName }} | ||
- --label=org.opencontainers.image.url=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.source=https://github.com/trufflesecurity/{{ .ProjectName }} | ||
- --label=org.opencontainers.image.version={{ .Version }} | ||
- --label=org.opencontainers.image.revision={{ .FullCommit }} | ||
- --label=org.opencontainers.image.licenses=AGPL-3.0 | ||
docker_manifests: | ||
- name_template: ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8 | ||
- name_template: ghcr.io/trufflesecurity/{{ .ProjectName }}:latest | ||
image_templates: | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/trufflesecurity/{{ .ProjectName }}:{{ .Version }}-arm64v8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM golang:bullseye as builder | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY trufflehog /usr/bin/trufflehog | ||
ENTRYPOINT ["/usr/bin/trufflehog"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters