Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add gpg signing for RPM packages #3612

Merged
merged 10 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/reusable-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,25 @@ jobs:
args: mod -licenses -json -output bom.json
version: ^v1

- name: "save gpg key"
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
run: |
echo "$GPG_KEY" > gpg.txt

- name: GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.4.1
args: release -f=${{ inputs.goreleaser_config}} ${{ inputs.goreleaser_options}}
env:
GITHUB_TOKEN: ${{ secrets.ORG_REPO_TOKEN }}
NFPM_DEFAULT_RPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_FILE: "gpg.txt"

- name: "remove gpg key"
run: |
rm gpg.txt

## push images to registries
## only for canary build
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ jobs:
with:
version: v1.4.1
args: release --skip-sign --snapshot --rm-dist --skip-publish --timeout 90m

env:
GPG_FILE: "nofile"
knqyf263 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ In this section you will find an aggregation of the different ways to install Tr
[trivy]
name=Trivy repository
baseurl=https://aquasecurity.github.io/trivy-repo/rpm/releases/$RELEASE_VERSION/\$basearch/
gpgcheck=0
gpgcheck=1
enabled=1
gpgkey=https://aquasecurity.github.io/trivy-repo/rpm/public.key
EOF
sudo yum -y update
sudo yum -y install trivy
Expand Down
3 changes: 3 additions & 0 deletions goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ nfpms:
contents:
- src: contrib/*.tpl
dst: /usr/local/share/trivy/templates
rpm:
signature:
key_file: '{{ .Env.GPG_FILE }}'

archives:
-
Expand Down