Skip to content

Commit

Permalink
add arm
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Oct 29, 2023
1 parent 4277ee6 commit 934838a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
47 changes: 18 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand All @@ -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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ test-log/

# IDEs
.vscode

# macOS
.DS_Store

out
4 changes: 2 additions & 2 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 934838a

Please sign in to comment.