Skip to content

Commit

Permalink
chore: sign rpm/deb
Browse files Browse the repository at this point in the history
  • Loading branch information
mailo-nr committed Jan 23, 2025
1 parent ed943f3 commit b075b7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/ci_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,32 @@ jobs:
gpg_private_key: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }}
passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}

- name: Write GPG to path in memory
id: write_gpg_to_path
run: |
GPG_KEY_PATH="$(mktemp /dev/shm/gpg.XXXXXX)"
echo "$GPG_PRIVATE_KEY" | base64 -d >> "$GPG_KEY_PATH"
echo "gpg_key_path=$GPG_KEY_PATH" >> $GITHUB_OUTPUT
env:
GPG_PRIVATE_KEY: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }}

- name: Build binaries & packages with GoReleaser
id: goreleaser_snapshot
uses: goreleaser/goreleaser-action@v6
env:
NFPM_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_KEY_PATH: ${{ steps.write_gpg_to_path.outputs.gpg_key_path }}
REGISTRY: "newrelic/nr-otel-collector"
with:
distribution: goreleaser
version: '~> v2'
args: --snapshot --clean --skip=publish,validate --timeout 2h --config .goreleaser-nightly.yaml
workdir: distributions/nr-otel-collector

- name: List contents of dist folder
run: ls -la distributions/nr-otel-collector/dist

- name: Extract image version
run: echo "version=$(echo '${{ steps.goreleaser_snapshot.outputs.metadata }}' | jq -r '.version')" >> $GITHUB_ENV

Expand All @@ -70,7 +84,7 @@ jobs:

- name: Run slow local tests
run: |
IMAGE_TAG=${{ env.version }}-nightly \
IMAGE_TAG=${{ env.version }}-nightly-amd64 \
KIND_CLUSTER_NAME=${{ env.TEST_CLUSTER_NAME }} \
NR_BACKEND_URL=${{ secrets.NR_STAGING_BACKEND_URL }} \
NR_INGEST_KEY=${{ secrets.OTELCOMM_NR_INGEST_KEY }} \
Expand Down
6 changes: 6 additions & 0 deletions distributions/nr-otel-collector/.goreleaser-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ nfpms:
maintainer: New Relic <[email protected]>
description: OpenTelemetry Collector - nr-otel-collector
license: Apache 2.0
rpm:
signature:
key_file: "{{ .Env.GPG_KEY_PATH }}"
deb:
signature:
key_file: "{{ .Env.GPG_KEY_PATH }}"

dockers:
- goos: linux
Expand Down

0 comments on commit b075b7c

Please sign in to comment.