6
6
paths :
7
7
- ' instrumentation/nginx/**'
8
8
- ' .github/workflows/nginx.yml'
9
+ tags :
10
+ - ' nginx/*'
9
11
pull_request :
10
- branches : [ main ]
12
+ branches : [main]
11
13
paths :
12
14
- ' instrumentation/nginx/**'
13
15
- ' .github/workflows/nginx.yml'
14
-
15
16
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/*
16
41
nginx-build-test :
17
42
name : nginx
18
43
runs-on : ubuntu-24.04
55
80
cd instrumentation/nginx
56
81
docker build -t otel-nginx-test/nginx \
57
82
--build-arg image=${{ matrix.image }} \
83
+ --build-arg nginx_version=${{ matrix.nginx }} \
58
84
-f test/${{ env.dockerfile }} \
59
85
--cache-from type=local,src=/tmp/buildx-cache/nginx \
60
86
--cache-to type=local,dest=/tmp/buildx-cache/nginx-new \
@@ -80,11 +106,15 @@ jobs:
80
106
mkdir -p /tmp/otel_ngx/
81
107
docker build -f test/${{ env.dockerfile }} \
82
108
--build-arg image=${{ matrix.image }} \
109
+ --build-arg nginx_version=${{ matrix.nginx }} \
83
110
--target export \
84
111
--output type=local,dest=/tmp/otel_ngx .
85
112
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 }}
86
116
- name : upload artifacts
87
117
uses : actions/upload-artifact@v4
88
118
with :
89
119
name : ${{ env.artifactName }}
90
- path : /tmp/otel_ngx/otel_ngx_module.so
120
+ path : /tmp/otel_ngx/${{ env.artifactName }}
0 commit comments