Skip to content

Commit 1765d1f

Browse files
ci: use infrastructure-publish-action v1 (#2011)
1 parent e9c03c8 commit 1765d1f

4 files changed

+35
-12
lines changed

.github/workflows/component_linux_publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
password: ${{ env.DOCKER_HUB_PASSWORD }}
9090
- name: Publish ${{ matrix.assetsType }} to S3 action
9191
if: ${{ (env.ASSETS_TYPE == 'all' || env.ASSETS_TYPE == matrix.assetsType) }}
92-
uses: newrelic/infrastructure-publish-action@v1.3.4
92+
uses: newrelic/infrastructure-publish-action@v1
9393
with:
9494
tag: ${{env.TAG}}
9595
app_name: "newrelic-infra${{ matrix.suffix }}"

.github/workflows/component_windows_publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
password: ${{ env.DOCKER_HUB_PASSWORD }}
8989
- name: Publish ${{ matrix.assetsType }} to S3 action
9090
if: ${{ (env.ASSETS_TYPE == 'all' || env.ASSETS_TYPE == matrix.assetsType) }}
91-
uses: newrelic/infrastructure-publish-action@v1.3.4
91+
uses: newrelic/infrastructure-publish-action@v1
9292
with:
9393
tag: ${{env.TAG}}
9494
app_name: "newrelic-infra"

.github/workflows/prerelease_linux_on_demand.yml

+32-9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
fake_tag:
1010
description: 'Version to be given to the packages'
1111
default: '0.0.0'
12+
skip_mirror_repo:
13+
type: boolean
14+
required: true
15+
description: 'Skip mirroring the repository'
16+
default: 'true'
1217
dest_prefix:
1318
description: 'Repo prefix'
1419
required: true
@@ -27,11 +32,17 @@ env:
2732
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }}
2833
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded
2934
BRANCH: ${{ github.event.inputs.branch }}
35+
# publish packages to a custom path
3036
DEST_PREFIX: ${{ github.event.inputs.dest_prefix }}
37+
# force all custom packages to be published to a fixed path
38+
FIXED_PREFIX: "testing-pre-releases"
39+
# using infrastructure_agent as suffix allows use to mirror an on_demand repo
40+
FIXED_SUFFIX: "infrastructure_agent/"
41+
# skip mirror repo for a single package test, or allow mirroring to have multiple packages in a custom repo
42+
SKIP_MIRROR_REPO: ${{ github.event.inputs.skip_mirror_repo }}
3143
AWS_S3_BUCKET_NAME: "nr-downloads-ohai-staging"
3244
AWS_REGION: "us-east-1"
3345
AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock-staging"
34-
ACCESS_POINT_HOST: "staging"
3546
RUN_ID: ${{ github.run_id }}
3647
GPG_MAIL: '[email protected]'
3748
AWS_ACCESS_KEY_ID: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }}
@@ -46,6 +57,18 @@ jobs:
4657
runs-on: ubuntu-20.04
4758

4859
steps:
60+
- name: dest_prefix for testing
61+
run: |
62+
# append trailing slash if no present
63+
dest_prefix="${{ env.DEST_PREFIX }}"
64+
if [[ "${dest_prefix}" != */ ]]; then
65+
dest_prefix="${dest_prefix}/"
66+
fi
67+
echo "DEST_PREFIX=${{ env.FIXED_PREFIX }}/${dest_prefix}${{ env.FIXED_SUFFIX }}" >> $GITHUB_ENV
68+
# remove trailing slash from dest prefix
69+
dest_prefix="${dest_prefix%/}"
70+
echo "ACCESS_POINT_HOST=http://nr-downloads-ohai-staging.s3-website-us-east-1.amazonaws.com/${{ env.FIXED_PREFIX }}/${dest_prefix}" >> $GITHUB_ENV
71+
4972
- uses: actions/checkout@v3
5073
with:
5174
ref: ${{ env.BRANCH }}
@@ -74,7 +97,7 @@ jobs:
7497

7598
- name: Publish NON-FIPS deb to S3 action
7699
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
77-
uses: newrelic/infrastructure-publish-action@v1.3.4
100+
uses: newrelic/infrastructure-publish-action@v1
78101
with:
79102
tag: ${{env.FAKE_TAG}}
80103
app_name: "newrelic-infra"
@@ -96,11 +119,11 @@ jobs:
96119
disable_lock: ${{ env.DISABLE_LOCK }}
97120
dest_prefix: ${{ env.DEST_PREFIX }}
98121
local_packages_path: "/srv/dist/"
99-
apt_skip_mirror: true
122+
apt_skip_mirror: ${{ env.SKIP_MIRROR_REPO }}
100123

101124
- name: Publish NON-FIPS rpm to S3 action
102125
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
103-
uses: newrelic/infrastructure-publish-action@v1.3.4
126+
uses: newrelic/infrastructure-publish-action@v1
104127
with:
105128
tag: ${{env.FAKE_TAG}}
106129
app_name: "newrelic-infra"
@@ -125,7 +148,7 @@ jobs:
125148

126149
- name: Publish NON-FIPS targz to S3 action
127150
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'NON-FIPS' }}
128-
uses: newrelic/infrastructure-publish-action@v1.3.4
151+
uses: newrelic/infrastructure-publish-action@v1
129152
with:
130153
tag: ${{env.FAKE_TAG}}
131154
app_name: "newrelic-infra"
@@ -169,7 +192,7 @@ jobs:
169192

170193
- name: Publish FIPS deb to S3 action
171194
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
172-
uses: newrelic/infrastructure-publish-action@v1.3.4
195+
uses: newrelic/infrastructure-publish-action@v1
173196
with:
174197
tag: ${{env.FAKE_TAG}}
175198
app_name: "newrelic-infra-fips"
@@ -191,11 +214,11 @@ jobs:
191214
disable_lock: ${{ env.DISABLE_LOCK }}
192215
dest_prefix: ${{ env.DEST_PREFIX }}
193216
local_packages_path: "/srv/dist/"
194-
apt_skip_mirror: true
217+
apt_skip_mirror: ${{ env.SKIP_MIRROR_REPO }}
195218

196219
- name: Publish FIPS rpm to S3 action
197220
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
198-
uses: newrelic/infrastructure-publish-action@v1.3.4
221+
uses: newrelic/infrastructure-publish-action@v1
199222
with:
200223
tag: ${{env.FAKE_TAG}}
201224
app_name: "newrelic-infra-fips"
@@ -220,7 +243,7 @@ jobs:
220243

221244
- name: Publish FIPS targz to S3 action
222245
if: ${{ inputs.BUILD_MODE == 'ALL' || inputs.BUILD_MODE == 'FIPS' }}
223-
uses: newrelic/infrastructure-publish-action@v1.3.4
246+
uses: newrelic/infrastructure-publish-action@v1
224247
with:
225248
tag: ${{env.FAKE_TAG}}
226249
app_name: "newrelic-infra-fips"

.github/workflows/prerelease_windows_on_demand.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
name: windows-assets
107107

108108
- name: Publish msi to S3 action
109-
uses: newrelic/infrastructure-publish-action@v1.3.4
109+
uses: newrelic/infrastructure-publish-action@v1
110110
env:
111111
DOCKER_HUB_ID: ${{secrets.OHAI_DOCKER_HUB_ID}}
112112
DOCKER_HUB_PASSWORD: ${{secrets.OHAI_DOCKER_HUB_PASSWORD}}

0 commit comments

Comments
 (0)