diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f177439..c4e6be70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,34 +22,14 @@ jobs: matrix: nginx_version: [ - 1.17.3, - 1.17.8, + 1.15.12, + 1.16.1, + 1.17.10, 1.18.0, - 1.19.2, - 1.19.3, - 1.19.4, - 1.19.5, - 1.19.6, - 1.19.7, - 1.19.8, - 1.19.9, 1.19.10, - 1.20.0, - 1.20.1, 1.20.2, - 1.21.0, - 1.21.1, - 1.21.2, - 1.21.3, - 1.21.4, - 1.21.5, 1.21.6, - 1.22.0, 1.22.1, - 1.23.0, - 1.23.1, - 1.23.2, - 1.23.3, 1.23.4, 1.24.0, 1.25.0, @@ -73,6 +53,11 @@ jobs: - name: Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Build binary uses: docker/build-push-action@v5 with: @@ -82,24 +67,28 @@ jobs: tags: ${{ matrix.nginx_version }} cache-from: type=gha,scope=${{ matrix.nginx_version }} cache-to: type=gha,scope=${{ matrix.nginx_version }},mode=max + platforms: linux/amd64,linux/arm64 provenance: true target: export build-args: NGINX_VERSION=${{ matrix.nginx_version }} - outputs: type=tar,dest=linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tar + outputs: type=local,dest=out - - name: Compress tar + - name: Compress output run: | - gzip -9 linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tar + tar -czf linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tgz out/linux_amd64/ngx_http_opentracing_module.so + tar -czf linux-arm64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tgz out/linux_arm64/ngx_http_opentracing_module.so + cp out/linux_amd64/provenance.json linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.provenance.json + cp out/linux_arm64/provenance.json linux-arm64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.provenance.json - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tar.gz - path: linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tar.gz + name: nginx-opentracing-modules-${{ matrix.nginx_version }} + path: linux-(amd64|arm64)-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.(tgz|provenance.json) - name: Upload binaries on release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: github.ref_type == 'tag' run: | - gh release upload ${{ github.ref_name }} linux-amd64-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.tar.gz --clobber + gh release upload ${{ github.ref_name }} linux-(amd64|arm64)-nginx-${{ matrix.nginx_version }}-ngx_http_module.so.(tgz|provenance.json) --clobber diff --git a/.gitignore b/.gitignore index 92b5f87e..b5d11599 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,8 @@ test-log/ # IDEs .vscode + +# macOS +.DS_Store + +out diff --git a/build/Dockerfile b/build/Dockerfile index 016aa03a..8992e361 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -16,8 +16,8 @@ RUN apt-get update && \ libpcre3 libpcre3-dev \ zlib1g-dev -ENV CFLAGS="-march=x86-64 -fPIC" -ENV CXXFLAGS="-march=x86-64 -fPIC" +ENV CFLAGS="-fPIC" +ENV CXXFLAGS="-fPIC" ENV LDFLAGS="-fPIC"