Skip to content

Commit af0474b

Browse files
feat(windows): release pipeline
1 parent 19abce5 commit af0474b

File tree

9 files changed

+140
-12
lines changed

9 files changed

+140
-12
lines changed

.github/workflows/component_packages.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ on:
1212
type: boolean
1313
required: false
1414
default: false
15-
skip_upload_artifact:
16-
description: 'skip uploading the artifact'
15+
skip_upload_pipeline:
16+
description: 'skip uploading the artifact to the github pipeline'
1717
type: boolean
1818
required: false
1919
default: false
@@ -83,7 +83,7 @@ jobs:
8383
run: |
8484
cargo install --locked cargo-xwin --force
8585
86-
- name: Set tag and skip_upload=false for pre-release
86+
- name: If pre-release set and verify tag matches Cargo.toml version
8787
if: ${{ inputs.pre-release}}
8888
run: |
8989
NEWRELIC_AGENT_CONTROL_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' agent-control/Cargo.toml)
@@ -92,11 +92,11 @@ jobs:
9292
exit 1
9393
fi
9494
95-
- name: Set tag and skip_upload=true for testing
95+
- name: If not pre-release, set tag and SKIP_UPLOAD_RELEASE=true
9696
if: ${{ ! inputs.pre-release }}
9797
run: |
9898
git tag ${{ inputs.tag_name }}
99-
echo SKIP_UPLOAD="--skip=publish" >> $GITHUB_ENV
99+
echo SKIP_UPLOAD_RELEASE="--skip=publish" >> $GITHUB_ENV
100100
101101
- name: Skip packages sign
102102
if: ${{ inputs.skip_sign }}
@@ -106,7 +106,7 @@ jobs:
106106
- name: Release packages with GoReleaser
107107
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
108108
with:
109-
args: release ${{ env.SKIP_UPLOAD }} ${{ env.SKIP_SIGN }} --clean --verbose --timeout 2h
109+
args: release ${{ env.SKIP_UPLOAD_RELEASE }} ${{ env.SKIP_SIGN }} --clean --verbose --timeout 2h
110110
env:
111111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112112
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
@@ -116,7 +116,7 @@ jobs:
116116
GORELEASER_CURRENT_TAG: ${{ inputs.tag_name }}
117117

118118
- name: Upload assets to pipeline
119-
if: ${{ !inputs.skip_upload_artifact }}
119+
if: ${{ !inputs.skip_upload_pipeline }}
120120
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
121121
with:
122122
retention-days: 1

.github/workflows/nightly.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,32 @@ jobs:
6464
app_name: "newrelic-agent-control"
6565
repo_name: ${{ github.repository }}
6666
schema: "custom-local"
67-
schema_path: "./build/upload-schema-linux-deb-nightly.yml"
67+
schema_path: "/srv/build/upload-schema-linux-deb-nightly.yml"
68+
aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_TESTING }}
69+
aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_TESTING }}
70+
aws_s3_bucket_name: "nr-downloads-ohai-testing"
71+
aws_s3_lock_bucket_name: "onhost-ci-lock-testing"
72+
access_point_host: "testing"
73+
run_id: ${{ github.run_id }}
74+
aws_region: "us-east-1"
75+
aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_TESTING }}
76+
aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_TESTING }}
77+
# used for signing package stuff
78+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
79+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
80+
disable_lock: false
81+
dest_prefix: "preview/"
82+
local_packages_path: "/srv/dist/"
83+
apt_skip_mirror: true
84+
85+
- name: Publish windows artifacts
86+
uses: newrelic/infrastructure-publish-action@v1
87+
with:
88+
tag: 0.100.${{ github.run_id }}
89+
app_name: "newrelic-agent-control"
90+
repo_name: ${{ github.repository }}
91+
schema: "custom-local"
92+
schema_path: "/srv/build/upload-schema-windows-zip.yml"
6893
aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_TESTING }}
6994
aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_TESTING }}
7095
aws_s3_bucket_name: "nr-downloads-ohai-testing"

.github/workflows/on_demand_release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ jobs:
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727

28+
- name: Publish windows artifacts
29+
uses: newrelic/infrastructure-publish-action@v1
30+
with:
31+
tag: ${{ github.event.inputs.tag }}
32+
app_name: "newrelic-agent-control"
33+
repo_name: ${{ github.repository }}
34+
schema: "custom-local"
35+
schema_path: "/srv/build/upload-schema-windows-zip.yml"
36+
aws_access_key_id: ${{ secrets.TMP_OHAI_AWS_ACCESS_KEY_ID_PRODUCTION }}
37+
aws_secret_access_key: ${{ secrets.TMP_OHAI_AWS_SECRET_ACCESS_KEY_PRODUCTION }}
38+
aws_s3_bucket_name: "nr-downloads-main"
39+
aws_s3_lock_bucket_name: "onhost-ci-lock"
40+
access_point_host: "production"
41+
run_id: ${{ github.run_id }}
42+
aws_region: "us-east-1"
43+
aws_role_session_name: ${{ secrets.TMP_OHAI_AWS_ROLE_SESSION_NAME_PRODUCTION }}
44+
aws_role_arn: ${{ secrets.TMP_OHAI_AWS_ROLE_ARN_PRODUCTION }}
45+
# used for signing package stuff
46+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
47+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
48+
disable_lock: false
49+
dest_prefix: "preview/"
50+
local_packages_path: "/srv/dist/"
51+
apt_skip_mirror: false
52+
2853
- name: Publish deb to S3 action
2954
uses: newrelic/infrastructure-publish-action@v1
3055
with:

.github/workflows/prerelease.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,31 @@ jobs:
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353

54+
- name: Publish windows artifacts
55+
uses: newrelic/infrastructure-publish-action@v1
56+
with:
57+
tag: ${{ github.event.release.tag_name }}
58+
app_name: "newrelic-agent-control"
59+
repo_name: ${{ github.repository }}
60+
schema: "custom-local"
61+
schema_path: "/srv/build/upload-schema-windows-zip.yml"
62+
aws_access_key_id: ${{ secrets.TMP_OHAI_AWS_ACCESS_KEY_ID_STAGING }}
63+
aws_secret_access_key: ${{ secrets.TMP_OHAI_AWS_SECRET_ACCESS_KEY_STAGING }}
64+
aws_s3_bucket_name: "nr-downloads-ohai-staging"
65+
aws_s3_lock_bucket_name: "onhost-ci-lock-staging"
66+
access_point_host: "staging"
67+
run_id: ${{ github.run_id }}
68+
aws_region: "us-east-1"
69+
aws_role_session_name: ${{ secrets.TMP_OHAI_AWS_ROLE_SESSION_NAME_STAGING }}
70+
aws_role_arn: ${{ secrets.TMP_OHAI_AWS_ROLE_ARN_STAGING }}
71+
# used for signing package stuff
72+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
73+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
74+
disable_lock: false
75+
dest_prefix: "preview/"
76+
local_packages_path: "/srv/dist/"
77+
apt_skip_mirror: false
78+
5479
- name: Publish deb to S3 action
5580
uses: newrelic/infrastructure-publish-action@v1
5681
with:

.github/workflows/push_pr_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: ./.github/workflows/component_packages.yml
2222
with:
2323
pre-release: false
24-
skip_upload_artifact: true
24+
skip_upload_pipeline: true
2525
skip_sign: true
2626
tag_name: 0.100.0
2727

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,31 @@ jobs:
7373
dest_prefix: "preview/"
7474
local_packages_path: "/srv/dist/"
7575
apt_skip_mirror: false
76+
77+
- name: Publish windows artifacts
78+
uses: newrelic/infrastructure-publish-action@v1
79+
with:
80+
tag: ${{ github.event.release.tag_name }}
81+
app_name: "newrelic-agent-control"
82+
repo_name: ${{ github.repository }}
83+
schema: "custom-local"
84+
schema_path: "/srv/build/upload-schema-windows-zip.yml"
85+
aws_access_key_id: ${{ secrets.TMP_OHAI_AWS_ACCESS_KEY_ID_PRODUCTION }}
86+
aws_secret_access_key: ${{ secrets.TMP_OHAI_AWS_SECRET_ACCESS_KEY_PRODUCTION }}
87+
aws_s3_bucket_name: "nr-downloads-main"
88+
aws_s3_lock_bucket_name: "onhost-ci-lock"
89+
access_point_host: "production"
90+
run_id: ${{ github.run_id }}
91+
aws_region: "us-east-1"
92+
aws_role_session_name: ${{ secrets.TMP_OHAI_AWS_ROLE_SESSION_NAME_PRODUCTION }}
93+
aws_role_arn: ${{ secrets.TMP_OHAI_AWS_ROLE_ARN_PRODUCTION }}
94+
# used for signing package stuff
95+
gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }}
96+
gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
97+
disable_lock: false
98+
dest_prefix: "preview/"
99+
local_packages_path: "/srv/dist/"
100+
apt_skip_mirror: false
76101

77102
push-container-tags:
78103
runs-on: ubuntu-latest

.goreleaser.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,18 @@ builds:
8585
output: true
8686

8787
archives:
88-
- formats: tar.gz
88+
- id: linux
89+
formats: tar.gz
8990
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
91+
builds:
92+
- newrelic-agent-control-linux
93+
- newrelic-agent-control-cli-linux
94+
- id: windows
95+
formats: zip
96+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
97+
builds:
98+
- newrelic-agent-control-windows
99+
- newrelic-agent-control-cli-windows
90100

91101
nfpms: # deb and rpm are only built for linux targets
92102
- package_name: newrelic-agent-control
@@ -218,7 +228,7 @@ signs:
218228

219229
# Path to the checksum command.
220230
cmd: ./build/scripts/generate_checksum.sh
221-
args: ["-f", "{{ .Env.artifact }}"]
231+
args: [ "-f", "{{ .Env.artifact }}" ]
222232
artifacts: all
223233
- id: signing
224234

agent-control/src/agent_control/defaults.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub const AGENT_CONTROL_VERSION: &str = env!("CARGO_PKG_VERSION");
1616

1717
// Keys identifying attributes
1818
pub const OPAMP_SUBAGENT_CHART_VERSION_ATTRIBUTE_KEY: &str = "chart.version";
19-
pub const OPAMP_AC_CHART_VERSION_ATTRIBUTE_KEY: &str = "chart.version"; // TODO `ac.chart.version`?
19+
pub const OPAMP_AC_CHART_VERSION_ATTRIBUTE_KEY: &str = "chart.version";
2020
pub const OPAMP_CD_CHART_VERSION_ATTRIBUTE_KEY: &str = "cd.chart.version";
2121
pub const OPAMP_SERVICE_NAME: &str = "service.name";
2222
pub const OPAMP_SERVICE_VERSION: &str = "service.version";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- src: "newrelic-agent-control_{version}_windows_{arch}.zip"
3+
uploads:
4+
- type: file
5+
dest: "{dest_prefix}binaries/windows/{arch}/{src}"
6+
arch:
7+
- amd64
8+
9+
#########################
10+
# UPLOAD CHECKSUMS #
11+
#########################
12+
13+
- src: "newrelic-agent-control_{version}_windows_{arch}.zip.sum"
14+
uploads:
15+
- type: file
16+
dest: "{dest_prefix}binaries/windows/{arch}/{src}"
17+
arch:
18+
- amd64

0 commit comments

Comments
 (0)