-
Notifications
You must be signed in to change notification settings - Fork 12
132 lines (113 loc) · 4.42 KB
/
ci-prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Prerelease
on:
release:
types:
- prereleased
tags:
- '*'
jobs:
prerelease:
name: Pre-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set and validate distribution name and version
run: .github/workflows/scripts/set_version.sh
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-go@v5
with:
go-version: '~1.22.3'
check-latest: true
- name: Generate distribution sources
run: make generate-sources
- name: Log into Docker.io
uses: docker/login-action@v2
with:
username: ${{ secrets.OHAI_DOCKER_HUB_ID }}
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
- name: Build binaries & packages with GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: '~> v1'
args: release --rm-dist --timeout 2h
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
GPG_MAIL: '[email protected]'
publishing-to-s3:
name: Publish artifacts into s3 staging bucket
uses: ./.github/workflows/component_publish.yml
needs: [prerelease]
secrets:
DOCKER_HUB_ID: ${{ secrets.OHAI_DOCKER_HUB_ID }}
DOCKER_HUB_PASSWORD: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
AWS_ACCESS_KEY_ID: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_STAGING }}
AWS_ROLE_ARN: ${{ secrets.OHAI_AWS_ROLE_ARN_STAGING }}
AWS_ROLE_SESSION_NAME: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_STAGING }}
with:
ACCESS_POINT_HOST: "staging"
SCHEMA_BRANCH: "main"
RUN_ID: ${{ github.run_id }}
TAG: ${{ github.event.release.tag_name }}
AWS_S3_BUCKET_NAME: "nr-downloads-ohai-staging"
AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock-staging"
ASSETS_TYPE: "all"
molecule-tests:
runs-on: ubuntu-latest
needs: [publishing-to-s3]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set and validate distribution name and go-version
run: .github/workflows/scripts/set_version.sh
- uses: newrelic/pkg-installation-testing-action@v1
with:
gpg_key: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
repo_base_url: "http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/infrastructure_agent"
package_name: ${{ env.NR_DISTRO }}
package_version: ${{ env.NR_VERSION }}
platforms: "al2,al2023,centos8,debian-bullseye,debian-bookworm,redhat8,redhat9,suse15.2,suse15.3,suse15.4,ubuntu1604,ubuntu1804,ubuntu2004,ubuntu2204,ubuntu2404"
packaging-tests:
uses: ./.github/workflows/component_provision_packaging.yml
needs: [publishing-to-s3]
secrets:
AWS_ROLE_ARN: ${{secrets.AWS_ROLE_ARN}}
AWS_VPC_SUBNET: ${{secrets.AWS_VPC_SUBNET}}
with:
TAG_OR_UNIQUE_NAME: ${{ github.event.release.tag_name }}
canaries:
uses: ./.github/workflows/component_canaries.yml
needs: [packaging-tests]
with:
TAG: ${{ github.ref_name }}
PREVIOUS_TAG: "latest"
PLATFORM: "linux"
IMAGE: "newrelic/nr-otel-collector" #should be changed after pre-release
secrets:
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
AWS_VPC_SUBNET: ${{secrets.AWS_VPC_SUBNET}}
alerts:
needs: [canaries]
uses: ./.github/workflows/component_canary_alerts.yml
secrets:
AWS_VPC_SUBNET: ${{secrets.AWS_VPC_SUBNET}}
CANARIES_NR_API_KEY: ${{ secrets.CANARIES_NR_API_KEY }}
with:
TAG: ${{ github.ref_name }}
NR_ACCOUNT_ID: 11952800
NR_REGION: Staging
INSTANCE_NAME_PATTERN: otel-canary:${{ github.ref_name }}-*
TF_STATE_KEY: nr_otel_collector_prerelease_alerts/state_${{ github.ref_name }}
TF_STATE_BUCKET: automation-pipeline-terraform-state
TF_STATE_REGION: us-east-2
POLICIES_PREFIX: "nr-otel-collector-pre-release__canaries_metric_comparator"
REF: ${{ github.ref }}