Skip to content

Commit 42196ba

Browse files
authored
CI: add nginx instrumentation release job (#502)
1 parent c80826c commit 42196ba

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

Diff for: .github/workflows/nginx.yml

+33-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,38 @@ on:
66
paths:
77
- 'instrumentation/nginx/**'
88
- '.github/workflows/nginx.yml'
9+
tags:
10+
- 'nginx/*'
911
pull_request:
10-
branches: [ main ]
12+
branches: [main]
1113
paths:
1214
- 'instrumentation/nginx/**'
1315
- '.github/workflows/nginx.yml'
14-
1516
jobs:
17+
create-release:
18+
if: startsWith(github.ref, 'refs/tags/nginx')
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Release
22+
uses: softprops/action-gh-release@v2
23+
upload-release-artifacts:
24+
if: startsWith(github.ref, 'refs/tags/nginx')
25+
runs-on: ubuntu-latest
26+
needs: [nginx-build-test, create-release]
27+
steps:
28+
- name: Create directory
29+
run: |
30+
mkdir artifacts
31+
- name: Download artifacts
32+
uses: actions/download-artifact@v4
33+
with:
34+
path: artifacts
35+
merge-multiple: true
36+
- name: Upload release artifacts
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
fail_on_unmatched_files: true
40+
files: ./artifacts/*
1641
nginx-build-test:
1742
name: nginx
1843
runs-on: ubuntu-24.04
@@ -55,6 +80,7 @@ jobs:
5580
cd instrumentation/nginx
5681
docker build -t otel-nginx-test/nginx \
5782
--build-arg image=${{ matrix.image }} \
83+
--build-arg nginx_version=${{ matrix.nginx }} \
5884
-f test/${{ env.dockerfile }} \
5985
--cache-from type=local,src=/tmp/buildx-cache/nginx \
6086
--cache-to type=local,dest=/tmp/buildx-cache/nginx-new \
@@ -80,11 +106,15 @@ jobs:
80106
mkdir -p /tmp/otel_ngx/
81107
docker build -f test/${{ env.dockerfile }} \
82108
--build-arg image=${{ matrix.image }} \
109+
--build-arg nginx_version=${{ matrix.nginx }} \
83110
--target export \
84111
--output type=local,dest=/tmp/otel_ngx .
85112
echo "artifactName=otel_ngx_module-$(echo ${{ matrix.image }} | sed s/:/-/)-${{ matrix.nginx }}.so" >> $GITHUB_ENV
113+
- name: rename artifact
114+
run: |
115+
mv /tmp/otel_ngx/otel_ngx_module.so /tmp/otel_ngx/${{ env.artifactName }}
86116
- name: upload artifacts
87117
uses: actions/upload-artifact@v4
88118
with:
89119
name: ${{ env.artifactName }}
90-
path: /tmp/otel_ngx/otel_ngx_module.so
120+
path: /tmp/otel_ngx/${{ env.artifactName }}

0 commit comments

Comments
 (0)