Skip to content

Commit c78c6ea

Browse files
pdabelf5AlexFenlon
andauthored
Update CI to address deprecation notices, remove assertion docs and fix go_proxy variable (#1170)
Co-authored-by: Alex Fenlon <[email protected]>
1 parent 6135194 commit c78c6ea

File tree

3 files changed

+160
-161
lines changed

3 files changed

+160
-161
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ jobs:
3737
forked_workflow=${{ (github.event.pull_request && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) || github.repository != 'nginx/nginx-prometheus-exporter' }}
3838
echo "forked_workflow=${forked_workflow}" >> $GITHUB_OUTPUT
3939
if [ "$forked_workflow" = "false" ] && [ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]; then
40-
go_proxy="${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
40+
go_proxy="${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}" >> $GITHUB_OUTPUT
4141
elif [ "${{ github.ref_name }}" = "${{ github.event.repository.default_branch }}" ]; then
42-
go_proxy="${{ secrets.ARTIFACTORY_ENDPOINT }}"
42+
go_proxy="${{ secrets.ARTIFACTORY_ENDPOINT }}" >> $GITHUB_OUTPUT
4343
else
44-
go_proxy="https://proxy.golang.org,direct"
44+
go_proxy="https://proxy.golang.org,direct" >> $GITHUB_OUTPUT
4545
fi
46-
echo "go_proxy=${go_proxy}" >> $GITHUB_OUTPUT
4746
cat $GITHUB_OUTPUT
4847
4948
unit-tests:
@@ -257,74 +256,74 @@ jobs:
257256
rm -f $HOME/.netrc
258257
if: ${{ always() }}
259258

260-
generate-assertion-doc:
261-
if: ${{ github.event_name != 'pull_request' }}
262-
name: Assertion Doc ${{ matrix.prometheus.arch }}
263-
needs: [build-docker, variables]
264-
runs-on: ubuntu-24.04-amd64
265-
permissions:
266-
contents: read
267-
id-token: write # for compliance-rules action to sign assertion doc
268-
strategy:
269-
fail-fast: false
270-
matrix:
271-
prometheus: ${{ fromJSON( needs.build-docker.outputs.binaries ) }}
272-
steps:
273-
- name: Checkout Repository
274-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
275-
276-
- name: Setup Golang Environment
277-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
278-
with:
279-
go-version-file: go.mod
280-
281-
- name: Setup netrc
282-
run: |
283-
cat <<EOF > $HOME/.netrc
284-
machine azr.artifactory.f5net.com
285-
login ${{ secrets.ARTIFACTORY_USER }}
286-
password ${{ secrets.ARTIFACTORY_TOKEN }}
287-
EOF
288-
chmod 600 $HOME/.netrc
289-
290-
- name: Fetch Cached Artifacts
291-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
292-
with:
293-
path: ${{ github.workspace }}/dist
294-
key: nginx-prometheus-exporter-${{ github.sha }}
295-
fail-on-cache-miss: true
296-
297-
- name: List packages in Go binary
298-
id: godeps
299-
env:
300-
GOPROXY: ${{ needs.variables.outputs.go_proxy }}
301-
run: |
302-
go version -m ${{ matrix.prometheus.path }} > go_version_out_${{ github.run_id }}_${{ github.run_number }}.txt
303-
echo "go_version_out=$(find -type f -name "go_version_out*.txt" | head -n 1)" >> $GITHUB_OUTPUT
304-
echo "artifact_digest=$(openssl dgst -sha256 -r ${{ matrix.prometheus.path }} | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
305-
cat $GITHUB_OUTPUT
306-
307-
- name: Generate Assertion Document
308-
id: assertiondoc
309-
uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
310-
with:
311-
artifact-name: "${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}"
312-
artifact-digest: ${{ steps.godeps.outputs.artifact_digest }}
313-
build-type: "github.com"
314-
builder-id: "github"
315-
builder-version: v0.1.0
316-
started-on: ${{ github.event.head_commit.timestamp }}
317-
finished-on: ${{ github.event.head_commit.timestamp }}
318-
invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
319-
artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
320-
artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
321-
artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
322-
artifactory-repo: 'f5-nginx-go-local-approved-dependency'
323-
assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}.json
324-
build-content-path: ${{ steps.godeps.outputs.go_version_out }}
325-
326-
- name: Sign and Store Assertion Document
327-
id: sign
328-
uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
329-
with:
330-
assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}
259+
# generate-assertion-doc:
260+
# if: ${{ github.event_name != 'pull_request' }}
261+
# name: Assertion Doc ${{ matrix.prometheus.os }}/${{ matrix.prometheus.arch }}
262+
# needs: [build-docker, variables]
263+
# runs-on: ubuntu-24.04-amd64
264+
# permissions:
265+
# contents: read
266+
# id-token: write # for compliance-rules action to sign assertion doc
267+
# strategy:
268+
# fail-fast: false
269+
# matrix:
270+
# prometheus: ${{ fromJSON( needs.build-docker.outputs.binaries ) }}
271+
# steps:
272+
# - name: Checkout Repository
273+
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
274+
275+
# - name: Setup Golang Environment
276+
# uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
277+
# with:
278+
# go-version-file: go.mod
279+
280+
# - name: Setup netrc
281+
# run: |
282+
# cat <<EOF > $HOME/.netrc
283+
# machine azr.artifactory.f5net.com
284+
# login ${{ secrets.ARTIFACTORY_USER }}
285+
# password ${{ secrets.ARTIFACTORY_TOKEN }}
286+
# EOF
287+
# chmod 600 $HOME/.netrc
288+
289+
# - name: Fetch Cached Artifacts
290+
# uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
291+
# with:
292+
# path: ${{ github.workspace }}/dist
293+
# key: nginx-prometheus-exporter-${{ github.sha }}
294+
# fail-on-cache-miss: true
295+
296+
# - name: List packages in Go binary
297+
# id: godeps
298+
# env:
299+
# GOPROXY: ${{ needs.variables.outputs.go_proxy }}
300+
# run: |
301+
# go version -m ${{ matrix.prometheus.path }} > go_version_out_${{ github.run_id }}_${{ github.run_number }}.txt
302+
# echo "go_version_out=$(find -type f -name "go_version_out*.txt" | head -n 1)" >> $GITHUB_OUTPUT
303+
# echo "artifact_digest=$(openssl dgst -sha256 -r ${{ matrix.prometheus.path }} | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
304+
# cat $GITHUB_OUTPUT
305+
306+
# - name: Generate Assertion Document
307+
# id: assertiondoc
308+
# uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
309+
# with:
310+
# artifact-name: "${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}"
311+
# artifact-digest: ${{ steps.godeps.outputs.artifact_digest }}
312+
# build-type: "github.com"
313+
# builder-id: "github"
314+
# builder-version: v0.1.0
315+
# started-on: ${{ github.event.head_commit.timestamp }}
316+
# finished-on: ${{ github.event.head_commit.timestamp }}
317+
# invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
318+
# artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
319+
# artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
320+
# artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
321+
# artifactory-repo: 'f5-nginx-go-local-approved-dependency'
322+
# assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}.json
323+
# build-content-path: ${{ steps.godeps.outputs.go_version_out }}
324+
325+
# - name: Sign and Store Assertion Document
326+
# id: sign
327+
# uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
328+
# with:
329+
# assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}

.github/workflows/release.yml

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -275,81 +275,81 @@ jobs:
275275
rm -f $HOME/.netrc
276276
if: ${{ always() }}
277277

278-
generate-assertion-doc:
279-
if: ${{ !contains(inputs.skip_jobs, 'generate-assertion-doc') }}
280-
name: Assertion Doc ${{ matrix.prometheus.arch }}
281-
needs: [build-docker, variables]
282-
runs-on: ubuntu-24.04-amd64
283-
permissions:
284-
contents: read
285-
id-token: write # for compliance-rules action to sign assertion doc
286-
strategy:
287-
fail-fast: false
288-
matrix:
289-
prometheus: ${{ fromJSON( needs.build-docker.outputs.binaries ) }}
290-
steps:
291-
- name: Checkout Repository
292-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
293-
294-
- name: Setup Golang Environment
295-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
296-
with:
297-
go-version-file: go.mod
298-
299-
- name: Configure pipeline Variables
300-
id: vars
301-
run: |
302-
timestamp=$(date --iso-8601=seconds)
303-
echo "timestamp=${timestamp}" >> $GITHUB_OUTPUT
304-
cat $GITHUB_OUTPUT
305-
306-
- name: Setup netrc
307-
run: |
308-
cat <<EOF > $HOME/.netrc
309-
machine azr.artifactory.f5net.com
310-
login ${{ secrets.ARTIFACTORY_USER }}
311-
password ${{ secrets.ARTIFACTORY_TOKEN }}
312-
EOF
313-
chmod 600 $HOME/.netrc
314-
315-
- name: Fetch Cached Artifacts
316-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
317-
with:
318-
path: ${{ github.workspace }}/dist
319-
key: nginx-prometheus-exporter-${{ github.sha }}
320-
fail-on-cache-miss: true
321-
322-
- name: List packages in Go binary
323-
id: godeps
324-
env:
325-
GOPROXY: ${{ secrets.ARTIFACTORY_ENDPOINT }}
326-
run: |
327-
go version -m ${{ matrix.prometheus.path }} > go_version_out_${{ github.run_id }}_${{ github.run_number }}.txt
328-
echo "go_version_out=$(find -type f -name "go_version_out*.txt" | head -n 1)" >> $GITHUB_OUTPUT
329-
echo "artifact_digest=$(openssl dgst -sha256 -r ${{ matrix.prometheus.path }} | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
330-
cat $GITHUB_OUTPUT
331-
332-
- name: Generate Assertion Document
333-
id: assertiondoc
334-
uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
335-
with:
336-
artifact-name: "${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}"
337-
artifact-digest: ${{ steps.godeps.outputs.artifact_digest }}
338-
build-type: "github.com"
339-
builder-id: "github"
340-
builder-version: v0.1.0
341-
started-on: ${{ steps.vars.outputs.timestamp }}
342-
finished-on: ${{ steps.vars.outputs.timestamp }}
343-
invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
344-
artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
345-
artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
346-
artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
347-
artifactory-repo: 'f5-nginx-go-local-approved-dependency'
348-
assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}.json
349-
build-content-path: ${{ steps.godeps.outputs.go_version_out }}
350-
351-
- name: Sign and Store Assertion Document
352-
id: sign
353-
uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
354-
with:
355-
assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}
278+
# generate-assertion-doc:
279+
# if: ${{ !contains(inputs.skip_jobs, 'generate-assertion-doc') }}
280+
# name: Assertion Doc ${{ matrix.prometheus.os }}/${{ matrix.prometheus.arch }}
281+
# needs: [build-docker, variables]
282+
# runs-on: ubuntu-24.04-amd64
283+
# permissions:
284+
# contents: read
285+
# id-token: write # for compliance-rules action to sign assertion doc
286+
# strategy:
287+
# fail-fast: false
288+
# matrix:
289+
# prometheus: ${{ fromJSON( needs.build-docker.outputs.binaries ) }}
290+
# steps:
291+
# - name: Checkout Repository
292+
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
293+
294+
# - name: Setup Golang Environment
295+
# uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
296+
# with:
297+
# go-version-file: go.mod
298+
299+
# - name: Configure pipeline Variables
300+
# id: vars
301+
# run: |
302+
# timestamp=$(date --iso-8601=seconds)
303+
# echo "timestamp=${timestamp}" >> $GITHUB_OUTPUT
304+
# cat $GITHUB_OUTPUT
305+
306+
# - name: Setup netrc
307+
# run: |
308+
# cat <<EOF > $HOME/.netrc
309+
# machine azr.artifactory.f5net.com
310+
# login ${{ secrets.ARTIFACTORY_USER }}
311+
# password ${{ secrets.ARTIFACTORY_TOKEN }}
312+
# EOF
313+
# chmod 600 $HOME/.netrc
314+
315+
# - name: Fetch Cached Artifacts
316+
# uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
317+
# with:
318+
# path: ${{ github.workspace }}/dist
319+
# key: nginx-prometheus-exporter-${{ github.sha }}
320+
# fail-on-cache-miss: true
321+
322+
# - name: List packages in Go binary
323+
# id: godeps
324+
# env:
325+
# GOPROXY: ${{ secrets.ARTIFACTORY_ENDPOINT }}
326+
# run: |
327+
# go version -m ${{ matrix.prometheus.path }} > go_version_out_${{ github.run_id }}_${{ github.run_number }}.txt
328+
# echo "go_version_out=$(find -type f -name "go_version_out*.txt" | head -n 1)" >> $GITHUB_OUTPUT
329+
# echo "artifact_digest=$(openssl dgst -sha256 -r ${{ matrix.prometheus.path }} | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
330+
# cat $GITHUB_OUTPUT
331+
332+
# - name: Generate Assertion Document
333+
# id: assertiondoc
334+
# uses: nginxinc/compliance-rules/.github/actions/assertion@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
335+
# with:
336+
# artifact-name: "${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}"
337+
# artifact-digest: ${{ steps.godeps.outputs.artifact_digest }}
338+
# build-type: "github.com"
339+
# builder-id: "github"
340+
# builder-version: v0.1.0
341+
# started-on: ${{ steps.vars.outputs.timestamp }}
342+
# finished-on: ${{ steps.vars.outputs.timestamp }}
343+
# invocation-id: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
344+
# artifactory-user: ${{ secrets.ARTIFACTORY_USER }}
345+
# artifactory-api-token: ${{ secrets.ARTIFACTORY_TOKEN }}
346+
# artifactory-url: ${{ secrets.ARTIFACTORY_URL }}
347+
# artifactory-repo: 'f5-nginx-go-local-approved-dependency'
348+
# assertion-doc-file: assertion_${{ github.event.repository.name }}_${{ github.sha }}_${{ github.run_id }}_${{ github.run_number }}_${{ matrix.prometheus.os }}_${{ matrix.prometheus.arch }}.json
349+
# build-content-path: ${{ steps.godeps.outputs.go_version_out }}
350+
351+
# - name: Sign and Store Assertion Document
352+
# id: sign
353+
# uses: nginxinc/compliance-rules/.github/actions/sign@83e452166aaf0ad8f07caf91a4f1f903b3dea1e6 # v0.3.0
354+
# with:
355+
# assertion-doc: ${{ steps.assertiondoc.outputs.assertion-document-path }}

.goreleaser.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ changelog:
4444
archives:
4545
- format_overrides:
4646
- goos: windows
47-
format: zip
47+
formats: ['zip']
4848
files:
4949
- README.md
5050
- LICENSE
@@ -71,22 +71,22 @@ signs:
7171
milestones:
7272
- close: true
7373

74-
brews:
74+
homebrew_casks:
7575
- repository:
7676
owner: nginx
7777
name: homebrew-tap
7878
token: "{{ .Env.NGINX_GITHUB_TOKEN }}"
79-
directory: Formula
79+
directory: Casks
8080
homepage: https://github.com/nginx/nginx-prometheus-exporter
8181
description: NGINX Prometheus Exporter for NGINX and NGINX Plus
82-
license: Apache-2.0
8382
commit_author:
8483
name: nginx-bot
8584
86-
extra_install: |-
87-
bash_completion.install "completions/nginx-prometheus-exporter.bash" => "nginx-prometheus-exporter"
88-
zsh_completion.install "completions/nginx-prometheus-exporter.zsh" => "_nginx-prometheus-exporter"
89-
man1.install "manpages/nginx-prometheus-exporter.1.gz"
85+
manpages:
86+
- "manpages/nginx-prometheus-exporter.1.gz"
87+
completions:
88+
bash: "completions/nginx-prometheus-exporter.bash"
89+
zsh: "completions/nginx-prometheus-exporter.zsh"
9090

9191
nix:
9292
- name: nginx-prometheus-exporter

0 commit comments

Comments
 (0)