Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move nightly config and add signign
Browse files Browse the repository at this point in the history
mailo-nr committed Jan 23, 2025
1 parent 53671b4 commit ed943f3
Showing 6 changed files with 39 additions and 17 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci_nightly.yaml
Original file line number Diff line number Diff line change
@@ -39,15 +39,27 @@ jobs:

- uses: docker/setup-buildx-action@v2

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }}
passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}

- 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 }}
with:
distribution: goreleaser
version: '~> v2'
args: --snapshot --clean --skip=sign --timeout 2h
args: --snapshot --clean --skip=publish,validate --timeout 2h --config .goreleaser-nightly.yaml
workdir: distributions/nr-otel-collector

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

- name: Setup local kind cluster
uses: helm/kind-action@v1
@@ -58,7 +70,7 @@ jobs:

- name: Run slow local tests
run: |
IMAGE_TAG=${{ env.version }}-rc-amd64 \
IMAGE_TAG=${{ env.version }}-nightly \
KIND_CLUSTER_NAME=${{ env.TEST_CLUSTER_NAME }} \
NR_BACKEND_URL=${{ secrets.NR_STAGING_BACKEND_URL }} \
NR_INGEST_KEY=${{ secrets.OTELCOMM_NR_INGEST_KEY }} \
@@ -87,6 +99,7 @@ jobs:
distribution: goreleaser
version: '~> v2'
args: --skip=announce,validate --clean --timeout 2h --config .goreleaser-nightly.yaml
workdir: distributions/nr-otel-collector

- name: Run nightly tests
run: |
9 changes: 5 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -29,7 +29,8 @@ archives:

format_overrides:
- goos: windows
format: zip
formats:
- zip

nfpms:
- package_name: nr-otel-collector
@@ -52,7 +53,7 @@ nfpms:
- src: distributions/nr-otel-collector/nr-otel-collector.conf
dst: /etc/nr-otel-collector/nr-otel-collector.conf
type: config|noreplace
- src: configs/nr-otel-collector-agent-linux.yaml
- src: distributions/nr-otel-collector/configs/nr-otel-collector-agent-linux.yaml
dst: /etc/nr-otel-collector/config.yaml
type: config
scripts:
@@ -76,7 +77,7 @@ dockers:
image_templates:
- newrelic/nr-otel-collector:{{ .Version }}-rc-amd64
extra_files:
- configs/nr-otel-collector-agent-linux.yaml
- distributions/nr-otel-collector/configs/nr-otel-collector-agent-linux.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
@@ -92,7 +93,7 @@ dockers:
image_templates:
- newrelic/nr-otel-collector:{{ .Version }}-rc-arm64
extra_files:
- configs/nr-otel-collector-agent-linux.yaml
- distributions/nr-otel-collector/configs/nr-otel-collector-agent-linux.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ builds:
ignore:
- goos: windows
goarch: arm64
dir: distributions/nr-otel-collector/_build
dir: _build
binary: nr-otel-collector
ldflags:
- -s
@@ -30,7 +30,8 @@ archives:

format_overrides:
- goos: windows
format: zip
formats:
- zip

nfpms:
- package_name: nr-otel-collector
@@ -48,18 +49,18 @@ nfpms:
{{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{- end }}
contents:
- src: distributions/nr-otel-collector/nr-otel-collector.service
- src: nr-otel-collector.service
dst: /lib/systemd/system/nr-otel-collector.service
- src: distributions/nr-otel-collector/nr-otel-collector.conf
- src: nr-otel-collector.conf
dst: /etc/nr-otel-collector/nr-otel-collector.conf
type: config|noreplace
- src: configs/nr-otel-collector-agent-linux.yaml
dst: /etc/nr-otel-collector/config.yaml
type: config
scripts:
preinstall: distributions/nr-otel-collector/preinstall.sh
postinstall: distributions/nr-otel-collector/postinstall.sh
preremove: distributions/nr-otel-collector/preremove.sh
preinstall: preinstall.sh
postinstall: postinstall.sh
preremove: preremove.sh
id: nr-otel-collector
builds:
- nr-otel-collector
@@ -73,7 +74,7 @@ nfpms:
dockers:
- goos: linux
goarch: amd64
dockerfile: distributions/nr-otel-collector/Dockerfile
dockerfile: Dockerfile
image_templates:
- '{{ .Env.REGISTRY }}:{{ .Version }}-nightly-amd64'
- '{{ .Env.REGISTRY }}:nightly-amd64'
@@ -90,7 +91,7 @@ dockers:
use: buildx
- goos: linux
goarch: arm64
dockerfile: distributions/nr-otel-collector/Dockerfile
dockerfile: Dockerfile
image_templates:
- '{{ .Env.REGISTRY }}:{{ .Version }}-nightly-arm64'
- '{{ .Env.REGISTRY }}:nightly-arm64'
@@ -120,9 +121,16 @@ docker_manifests:
release:
disable: true

signs:
- args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
artifacts: all
# Disable default checksum generator as we use a custom one per each artifact.
checksum:
disable: true
name_template: "{{ .ArtifactName }}.sum"
# Create a checksum per each artifact.
split: true
# This is the default, but we are explicit here for clarity.
algorithm: sha256

# Skip auto-generating changelog.
changelog:
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ed943f3

Please sign in to comment.